Hi all,
I'm giving this a last shot before giving up on the 08M2 and seeing if I can shoehorn the 14M2 into the available space
Ive got code that is generating two frequencies - 1 x 57.6kHz 'carrier' and 1 x 1800hz 'hit' frequency for an IR based ranged combat system for Live Roleplay.
Ideally I want it on an 08M2 chip, due to the space requirements at the moment. The code below generates the basic signal and works ok, BUT I'm finding the power I can push through the IR LED is limited, mainly due to the duty cycle of the pulsout command (Without it I can push up to 130mA (before I chickened out as the LED is only rated for just over 100mA ), with it... 10mA)
Is there a way to either increase the duty on the pulsout command? alternatively, is there a way internal to the chip to drop the 57.6kHz frequency (by 4 I beleive) so that I can output the PWM 57.6 signal with max duty cycle, then quarter the frequency with the same duty cycle?
I was thinkiong of having a loop running that checks the PWM pin for HIGH condition and every 4th one, turn the 2nd output pin on then off to replicate it, but having tried it it was less than succesful, although that may be down to me more than the cjip.
Code is below.
Thanks in advance all.
I'm giving this a last shot before giving up on the 08M2 and seeing if I can shoehorn the 14M2 into the available space
Ive got code that is generating two frequencies - 1 x 57.6kHz 'carrier' and 1 x 1800hz 'hit' frequency for an IR based ranged combat system for Live Roleplay.
Ideally I want it on an 08M2 chip, due to the space requirements at the moment. The code below generates the basic signal and works ok, BUT I'm finding the power I can push through the IR LED is limited, mainly due to the duty cycle of the pulsout command (Without it I can push up to 130mA (before I chickened out as the LED is only rated for just over 100mA ), with it... 10mA)
Is there a way to either increase the duty on the pulsout command? alternatively, is there a way internal to the chip to drop the 57.6kHz frequency (by 4 I beleive) so that I can output the PWM 57.6 signal with max duty cycle, then quarter the frequency with the same duty cycle?
I was thinkiong of having a loop running that checks the PWM pin for HIGH condition and every 4th one, turn the 2nd output pin on then off to replicate it, but having tried it it was less than succesful, although that may be down to me more than the cjip.
Code is below.
Code:
symbol counter = w0
init:
SETFREQ M32
let counter = 0
low c.1
low c.4
pwmout C.2, 138, 416 ;57600 pulse
pause 500
main:
for counter = 1 to 100 ;output 1800hz pulse
low c.1
pulsout c.1,140
low c.1
pauseus 2
next