jaydeep.gajjar90
Newbie level 6
Hello Everyone !
I am trying to make POV clock. I have previously build POV display using pic16f84a with 8 LEDs. In that project i dont have synchronization between motor and display timings. i just added fixed delay to display text and changed motor speed with variable potentiometer.
Currently I have pic18f24j11 connected to two TLC9525 (spi 16-bit led driver) daisy chained consisting 32 LEDs. the led glows properly with given 32-bit data through spi protocol.
I have connected MOC7811 photo-interrupter to EXT INT0 pin of pic. I have taken following approach to synchronize (which is not working properly :-()
-> load two timers tmr0 and tmr1 with same time period (50 uS).
-> timer tmr1 has variable that increments at every interrupt (ie. 50 uS). this timer is used to calculate time between two successive intervals. for example if variable value is 500 from first to second internal then time for 1 rotation is 500 x 50 uS = 25000 uS = 25 ms.
-> second timer tmr0 is used to generate delay between two led column patterns. this timer also contains a variable which is updated at every external interrupt.
Here timer0 variable = (timer1 variable) / (total no of columns of 1 rotation).
so if timer1 varible is 500 and total no of columns is 4 then timer0 variable = 500/4 = 125.
so the columns are updated at every (125) * 50 uS = 6250 uS = 6.25 ms
Though this is theoretically looks correct, practically the display shifts slowly in one direction.
If any one have better solution or suggestion please help:grin:.
Thanks for reading.
I am trying to make POV clock. I have previously build POV display using pic16f84a with 8 LEDs. In that project i dont have synchronization between motor and display timings. i just added fixed delay to display text and changed motor speed with variable potentiometer.
Currently I have pic18f24j11 connected to two TLC9525 (spi 16-bit led driver) daisy chained consisting 32 LEDs. the led glows properly with given 32-bit data through spi protocol.
I have connected MOC7811 photo-interrupter to EXT INT0 pin of pic. I have taken following approach to synchronize (which is not working properly :-()
-> load two timers tmr0 and tmr1 with same time period (50 uS).
-> timer tmr1 has variable that increments at every interrupt (ie. 50 uS). this timer is used to calculate time between two successive intervals. for example if variable value is 500 from first to second internal then time for 1 rotation is 500 x 50 uS = 25000 uS = 25 ms.
-> second timer tmr0 is used to generate delay between two led column patterns. this timer also contains a variable which is updated at every external interrupt.
Here timer0 variable = (timer1 variable) / (total no of columns of 1 rotation).
so if timer1 varible is 500 and total no of columns is 4 then timer0 variable = 500/4 = 125.
so the columns are updated at every (125) * 50 uS = 6250 uS = 6.25 ms
Though this is theoretically looks correct, practically the display shifts slowly in one direction.
If any one have better solution or suggestion please help:grin:.
Thanks for reading.