BAM = Bit angle modulation.
Here's a good description:
https://www.picbasic.co.uk/forum/showthread.php?t=7393
PIC used: PIC18F14K22 at 64 mhz
I'm just looking to do basic 256 levels bam but I don't know how to get the timings right.
I cant use timer1 CCP1 compare because I need it for A realtime clock with 32768 xtal.
I thought i could use the TMR0H and TMR0L registers to set the timings but after checking
it with my oscope there is not a lot of accuracy.
Anyone has an idea?
Here's a good description:
https://www.picbasic.co.uk/forum/showthread.php?t=7393
PIC used: PIC18F14K22 at 64 mhz
I'm just looking to do basic 256 levels bam but I don't know how to get the timings right.
I cant use timer1 CCP1 compare because I need it for A realtime clock with 32768 xtal.
I thought i could use the TMR0H and TMR0L registers to set the timings but after checking
it with my oscope there is not a lot of accuracy.
Anyone has an idea?
Code:
if(INTCON.TMR0IF ) // TMR0 Interrupt? {
LEDRED^=1;
if(BAMbit--==0) BAMbit=7;
TMR0H = ~(BAMmsk<<BAMbit); // 0000 0000
TMR0L=2; // Correct 2 cycles for write
INTCON.TMR0IF = 0; // clear T0 Int flag
}
Last edited: