Let's Make Robots!

pwmout newbie questions

Why is this code not registering on my multimeter?

#picaxe 28x1

main:
pwmout 2 , 62, 250 ' 100% @ 16 Khz
pause 2000

pwmout 2 , 62, 25  '  10% @ 16 Khz
pause 2000
goto main

I measure DC over GND and digital output pin #2. And it keeps reading 0 V. Is the pwm too fast for my meter? Should I put a cap in/accross?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
it's comming out of portc 2!! --Easy thing to miss
I just did a test with my measure thingie --I'm getting a varying voltage.

Just read TFM. About pegs and pins on my chip and my project board.

When I tell the picaxe to

high 2

it is not poking in the same direction as when I tell it to

pwmout 2, 62, 250

 

The number (2) is the same, but has very different meaning. Told you I'm a newbie....

Oh and I found the right pin. My Thingey scanner had not found it, because it is at the INPUT  side of the chip 8-(

Thanks for your help though! You sure ruled out some scenarios!

I check PWM with a measure thingie all the time, it works -no cap, not too fast. I think it is the pause -- try the same PWM commad but do it in a for/next loop just to check.

Also -I have had a lot better luck with Pwmout 2,62,0 at the start, and pwmduty 2,XXXX later on when I want to change speed.

I do think it is the pause giving you problems, though

Here's my new code with annotations. Still sucks.

#picaxe 28x1

low 2

high 2
for w0 = 1 to 2000
   ' reading 5V for about 2 seconds
next

low 2
' reading 0V

pwmout 2 , 62,   0  '   0% @ 16 Khz
' reading 0V


main:
for w0 = 1 to 2000
   low  7              ' debug led stays off
   pwmout 2 , 62,  25  ' reading 0V
next

for w0 = 1 to 2000
   high 7              ' debug led comes on
   pwmout 2 , 62, 250  ' reading 0V
next

' still reading 0V 8-(

goto main
 

i dont have any decent input for this, jsut making my presence known.

 

boobS!