Re: 38Khz IR carrier - best way to turn it on and off

Originally Posted by
mark_s
If you look in the manual under HPWM. You can see that pbp HPWM is only 8bits.
In your code you have the duty set at 254, which is nearly 100%. I think you would want to set
the duty to 50% or 127.
Wow! You are SO right - looks MUCH better now. Thanks!

Still has that slope on it though. I might try DT's Instant Interrupts and use a pin on and off to get it. Here's what the code is now:
Code:
HPWM 1, 127, 38000
MAIN:
pauseus 1000
trisc.2 = 1
pauseus 1000
trisc.2 = 0
GOTO MAIN
"I have noticed that even those who assert that everything is predestined and that
we can change nothing about it still look both ways before they cross the street"
-Stephen Hawking
Bookmarks