Hello, I am a newbie in microcontrollers and I have some confusion on the data throughput I need for my POV display (school project) to work:
I am making a cylinder shape POV display with 3 arms and each arm has 32 LEDs .(Attached is a simple picture of what it looks like). I am dividing the display area in to 83 sections because the LEDs have 3 mm width and the circumference is 2 x pi x 40mm. for the processor I am using microduino core+ 1284p version which uses atmega1284p (similar to arduino mega2560 capability I think). And I plan on using another arduino to communicate with it over Bluetooth and tell it what to display. The inquiries I have is in regards to the data throughput needed for the display to work. Initially i calculate the data throughput as 1 bite per LED to control the LEDs as being on and off , 32 LEDs each arm and 3 arms, 83 slices/sections, meaning 83 refreshes of the LEDs per revolution, 25-40 revolutions per second, this becomes: 1 x 32 x 3 x 83 x 40=318720 bites= 39840 bytes =39.84 kilobytes
The arduino should be able to handle this.
Now I will go into the concept behinf the problems and questions I have, please tell me if anyof it is wrong.
The problem comes in when I decided to use tlc5940 to shift register control the LEDs. The grayscale mode of the tlc5940 uses 192 bites per chip to control the 16 LED and has the grayscale frequency determined by the timer it uses. I read in the free pdf “DemystifyingtheTLC5940” if using the CLKO pin running at 16 MHz to provide the GSCLK pulse, the grayscale frequency is 3906.25 Hz. Quote:
“This library uses the CLKO pin of the AVR to drive the GSCLK line of the TLC5940, which allows grayscale values to be updated at 3906.25 Hz with a CLKI/O of 16 MHz, and 4882.8125 Hz with a CLKI/O of 20 MHz.”
This means I would need to divide up the pwm cycles per second (3906.25)by the slices/ sections I have on the display (83 slices) and I get how many pwm cycles I need to display per section. This is basically the number of revolution I need per second, as the LEDs need pass over one section say 3906.25/83=47 times and each time it passes over, it displays one pwm cycle. I can reduce the revolution per second by displaying more than one grayscale pwm cycle every time the LEDs passes over one section(47/2=23.5).but, this causes problem number two, as that is too slow
Note:The problems I have are assuming the grayscale frequency will be at 3906.25 Hz from the CLKO pin and if I use timer of 16 bit the frequency will be similar. I don’t know if this is true and dur to my inexperience with avr chips can no determine ther frequency I will get if using a timer, so I am asking for help
Problem 1:
If I then keep or of above in mind and calculate the data throughput and that I am using 6 tlc5940 chips, I get 192 x 6 x 3906.25 =4500000 bites= 562500 bytes =562.5 kbytes. I have no idea if the Microduino (Atmega 1284p ) can achieve this.
Problem 2:
For a normal POV display it needs to spin at minimum 25 revolution per second up to 40 revolution per second, too fast, the LEDs would not be able to flash fast enough, and too slow there will be flicker, and also keep in mind the safety factors. If the grayscale frequency is at 3906.25Hz I will either have to spin the display at 47 revolution per second or reduce it with the method I describe earlier and I get 47/2= 23 revolution per second, and this is not fast enough. At 47 revolution per second =2820 rpm and will cause quite a lot of vibration if I don’t balance the arms properly, I want the speed to remain between 25-40 revolution per second. Unless I run CLKO at 20Mhz and get 4882.8125 Hz which I can get 4882.8125/83/2= around 29 revolution per second, which is fine, then that would just increase the data through put I need to 94882.8125/83/8/1000)=703.125 Kbytes. Again I don’t know if this is applicable.
Problem 3:
According to the tlc5940 programming flow chart from the Texas instrument website (I have attached a image of it below), the fSCLK I need would be (1/3906.25) X (1/(192 X 6))=0.000000222 Hz.
Once again I just need to confirm if this is possible.
The reason I have post all this rubbish like post is because I am completely new to microcontrollers and the like and have no idea what I am doing, maybe I missed something really obvious and rumbled all for nothing, if so I am really sorry.
My questions are:
- Do the problems I listed above even exist, if so how do I solve them?
- Would the same problems occur if I use one of timer 0 - 3 of the Atmega 1284p to pulse GSCLK, which I think is more common among users?i believe timer 0 and timer 2 are 8 bit. Timer 1 and timer 3 are 16 bit.
Some guidance on how I use the tlc5940 with the atmega1284p would be great.e.g. pinlayout, schematics.etc
I apologize for writing such a confusing and long post. Thank you for your patients. I am open to suggestions, even if they don’t sound nice.