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
Bookmarks