pwmout 100Hz for Picaxe 28X1

Sepp

New Member
Hi,

i am not really familiar with the PICAXE, so I would need a little help. What pwout values I need for a frequency of 100Hz with a 28x1 picaxe

pwmout C.2,150,100 ;100Hz????
pwmduty C.2,150 ; 50%?????

please Help me.
Thanks
 

fernando_g

Senior Member
This is one of those cases where external logic is required.
If your requirements are exactly 50%, then with a pair of flip-flops, contained in a single CD4013 IC, will do the trick.

You can set the PWMout output frequency at 400 Hz, and it will be divided by 4 to 100 Hz and a perfect 50% duty cycle.
 

premelec

Senior Member
You may have to run at slower clock speed or use external flip-flops [divide by 2] if square wave is OK. SETFREQ M1 would take you to 1/4 PWMOUT shown by wizard at 4MHz - I think though I am not acquainted with 28X1
 

The bear

Senior Member
Using the Wizard:
Also using 08M2 @ 2mHz =pwmout pwmdiv64, C.2, 155, 311 = 100Hz
Just a thought.

Regards, Bear..
 
Top