Hi all,
I have the code below which configures 3 pwm pins to seperately output 1200, 1000, 830 Hz pulses. The only way I could get this to work was to use the Poke command. These PWM outputs are pulsed on and off and it appears I need to send the Poke command everytime I pulse? Is this correct, I would have thought that once the Poke was set, it would stay that way?
I have the code below which configures 3 pwm pins to seperately output 1200, 1000, 830 Hz pulses. The only way I could get this to work was to use the Poke command. These PWM outputs are pulsed on and off and it appears I need to send the Poke command everytime I pulse? Is this correct, I would have thought that once the Poke was set, it would stay that way?
Code:
START:
pwmout PWM1200_Tone, 103, 208 '1200/2 Hz
pwmout PWM830_Tone, 150, 301 '830/2 Hz
pwmout pwmdiv16, PWM1000_Tone, 124, 250 '1000/2 Hz
'Poke the devisor registers
'bit0=0 => 1/1, bit0=1 => 1/4, bit1=1 => 1/16
'Set divisor for B.0
peeksfr $4A,b0
bit0=0
bit1=1
pokesfr $4A,b0
'Set divisor for B.5
peeksfr $51,b0
bit0=0
bit1=1
pokesfr $51,b0
pause 1000
pwmout PWM830_Tone, OFF
pwmout PWM1000_Tone, OFF
pwmout PWM1200_Tone, OFF
goto START