With the code above you'll only get a 1/2 ms delay...
http://www.picbasic.co.uk/forum/showthread.php?t=558
With the code above you'll only get a 1/2 ms delay...
http://www.picbasic.co.uk/forum/showthread.php?t=558
Not necessarily true.
If compiled with PM.exe which is NOT case sensitive. It'll do just fine at 8mhz.
texas5,
Much closer, but there's still one issue.
That will work good for the first burst. But since timer2 is still running, the next time you try to send a burst, timer2 may have already past the PR2 value when you start the PWM. Then it will have to wait for it to roll over at 256 counts before it starts up the PWM again.
That would cause the loss of up to 17 of the anticipated 125 cycles you would get during the 1ms period.
After stopping the PWM you should also STOP and RESET Timer2 to 0 ...
<br>
DT
thanx skimask...thanx Darrel Taylor...your explanation seem clear to me.so i just need to set the 'T2CON.2 = 0' after stopping the pwm and set it to 'T2CON.2 = 1' back if i want to burst it one more time.
Which is not a deal-breaker as X-10 receivers only look for 48 cycles during a window that extends from ZC+250uS to ZC+900uS. Still, one should follow X-10's recommendations to start the 120kHz burst within ZC+100uS. You're already losing some of that window as the PIC is late detecting ZC on rising edges (assuming the ZC detector given in AN236).
Bookmarks