08M2 pwmout 0,1

hippy

Technical Support
Staff member
The firmware treats "PWMOUT 0,x" as if a "PWMOUT OFF" command, hence what you are seeing.

It should be possible to "POKESFR PR2, $00" to set a zero value duty.
Code:
Symbol PR2 = $1B ; $01B
After that I believe "PWMDUTY C.2, 2" should set 50% duty. So in full, this will hopefully work. Untested -
Code:
#Picaxe 08M2
Symbol PR2 = $1B   ; $01B
PwmOut C.2, 1, 0   ; Enable PWMOUT with duty = 0%
PokeSfr PR2, $00   ; Set period to zero
Do
  PwmDuty C.2, 2   ; 50% for one second
  Pause 1000
  PwmDuty C.2, 0   ; Off for one second
  Pause 1000
Loop
 
Top