I'm attempting to port the ledheart.c code from
(a ATmega168) to a Tiny13 8pin uC so that I can implement a better flashing effect for my fiberoptic modification of my Star Trek Pinball:
I like the way his leds randomly enter into a brightness phase then dim back down... and move on the the next led in random order.
I only need to flash 4 LEDs so his code is proably overkill for such a small number of LEDs.
I've had to minimize the code by hand to just get the program to fit within the 1K flash available on the Tiny13.
I've been debugging the code all day long and can't seem to get it to flash right.
Basically; in it's current setup - I've set PB4 to be the ROW driver. PB1-3
are the COL drivers.
I've basically wired all the LEDs the same direction. Kathode to pin. Anode to 100ohm resistor. Resistor to Row driver (PB4).
None of the LEDs are lighting.
I've checked the pins with a logic probe. I only seem to be getting transitions on PB1 and PB4. PB2 and PB3 are low.
This leads me to beleive the code either doesn't work with a small number of COLs or I've introduced a bug with the minimization.
For debug purposes; I've #defined in the blink_all function... and taken out the twinkle() function.
Leading me to beleive there is something wrong with the ISR function. I'm thinking it's related to the way he's calculating the indexes of the columns.
His original code is here: