Even though it's 80hz, the ducycycle is put out to the pin twice, so it's visually better than 80hz PWM would be.How flickery is 80 Hz x 4 @ 4 MHz?
I don't notice any flicker.
<br>
Even though it's 80hz, the ducycycle is put out to the pin twice, so it's visually better than 80hz PWM would be.How flickery is 80 Hz x 4 @ 4 MHz?
I don't notice any flicker.
<br>
DT
Bam sounds great. Does anybody have a sample code? Thank you in advance.
Last edited by PicLearner; - 26th January 2009 at 07:39.
I played with a very simple form of BAM a while back, with at least 24 LEDs on a 20MHz 16F877A. This is the main loop:
Code:BAM: 'each pass is one cycle, equiv to one PWM period delay_index=%00000001 for i=0 to 7 'time slots, 0 shortest, 7 longest PORTA.1=LED1>>i PORTA.2=LED2>>i PORTA.3=LED3>>i . . . PORTA.n=LEDn>>1 for j=1 to delay_index 'empty delay loop for each time slot, total 255 next j delay_index=delay_index<<1 next i GOTO BAM
where LED1, LED2 are intensity values that are updated when needed by interrupt. Refresh is totally dependent on clock speed and number of LEDs driven, but 100Hz is achievable.
I came across a scheme to reorder bits to avoid phase shift glitches but didn't get that far myself. See http://www.tenmilesquare.com/library
I'd love to see Darrel's code...
Gary
<img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=3157&stc=1&d=123328553 8" />
Had that come up first, I woud have tried it. Looks interesting.
But the mirror image seems to work great, so no reason to change horses just yet.
There's 3 of our regular members looking at it now.
I like knowing they can set CONFIGs and disable A/D on their own.
Barring any problems, I'll post it soon.
<br>
DT
After realizing that Pebbles is probably 60-70 years old by now ...
I'm not so interested in BAMBAM anymore.
The name has been changed to MIBAM. (Mirror Imaged Bit Angle Modulation)
And the code for PicBasic Pro is now available here ...
http://www.picbasic.co.uk/forum/showthread.php?t=10564
Cheers,
DT
Hi Darrel.
I am testing your code on a 887 chip at 20MHz.
I am stuck on this error:
Error[115] c:\pbp\mibam-~1.asm 223 : Duplicate label ("BAM_PIN" or redefining symbol that cannot be redefined)
Error[115] c:\pbp\mibam-~1.asm 224 : Duplicate label ("BAM_PIN" or redefining symbol that cannot be redefined)
Error[115] c:\pbp\mibam-~1.asm 225 : Duplicate label ("BAM_PIN" or redefining symbol that cannot be redefined)
Error[115] c:\pbp\mibam-~1.asm 226 : Duplicate label ("BAM_PIN" or redefining symbol that cannot be redefined).
In fact, the code is a copy of the example. Nothing more or less. Of course the part about wsave is included too. Attached is the final test code.
Regards,
Ioannis
In MicroCode Sudio, View | Compile and Program Options | Compiler Tab ...Duplicate label ("BAM_PIN" or redefining symbol that cannot be redefined)
Check the "Case sensitive" box.
<br>
DT
Bookmarks