Should be BAMAB... unless your program stick too much on a side of the PWM cycle ;o)
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
I played with BAM some time ago, but always found this step in the middle of the range to be its big issue. Thank you for a workable solution !!!
Its interesting that Artistic License (the inventor, or populariser of BAM) make no mention of this issue.
Bill.
I think Artistic License had given up on it, since all mention of BAM has been removed from their website. And when I was searching the web for answers, all I found was lots of threads with people complaining of blinking problems.Its interesting that Artistic License (the inventor, or populariser of BAM) make no mention of this issue.
BAM-BAM to the rescue!
<img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=3147&stc=1&d=123283468 8" /> <!---->
I now have working code.
Anyone want to beta test it before I make it public?
It can run up to 48 LEDs simultaniously. (48mhz OSC)
Or 1 LED per mhz. 4mhz=4 LEDs, 20mhz=20 LEDs.
It has a self-contained Interrupt system. Instant Interrupts not required.
<br>
DT
Would love a copy. Just emailed you. What's the processor utilization per MHz per LED?
Utilization is less than 6% of total.What's the processor utilization per MHz per LED?
The limiting factor is the Least Significant Bit in the dutycycle. It's so short that it doesn't give much time to do anything. The mirror image helped some, because I was able to combine the LSB of both halves of the mirror for a longer period, but it's still only 68 instructions (worst case).
It has to get into the interrupt handler, save context, reload the Timer, service all the LEDs dutycycles, keep track of the bit sequencing, restore context and exit the interrupt within those 68 instructions.
Each PIN uses 6 instructions, and the rest of the handler uses about 40.
So @ 4 mhz you can only get 4 LED's (40 + 24 = 64).
Refresh rate @ 4mhz = 80 hz with 4 LEDs.
With higher OSC freqs, refresh rates can be as high as 650hz, depends on how many LEDs there are.
The rate can be set lower with a DEFINE if needed.
Warnings from the assembler will indicate if your setup is out of range.
<br>
Last edited by Darrel Taylor; - 13th February 2009 at 14:28. Reason: Change to less than 6%, forgot the othe half of the cycle.
DT
Bookmarks