microduino(Atmega1284p) with tlc5940 data throughput calculation help needed

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:

  1. Do the problems I listed above even exist, if so how do I solve them?
  2. 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.

poc display pic.png

flowchart screen shot.png

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.

This calculation is wrong. The Arduino doesn't have to provide that amount of data because the TLC5940 is handling the PWM. The Arduino just has to 192 x 6 x 83 x 40 = 478kB/s which almost as high as the amount you calculated. It gets worse because the Arduino doesn't have to provide only that amount of data but also some control commands which have to be transmitted in the same time. So you should thing if you really need 12 bit of PWM as you probably won't really notice more than about 4-16 levels of "grey" anyway.

Your problem 2 gets changed the same way.

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.

That calculation is also wrong. 1/3906.25 is 3906.25 Hz by definition. So the frequency you're looking for is 4.5MHz and that's a bit high. Although it's theoretically possible to send data in such a speed (8MHz is the upper limit) you might get problem providing the data in that speed.

I would completely eliminate the TLC5940 from that equation as it's not well suited for that project. Tell us what you want to achieve, maybe we have better alternatives.

I am glad you replied.
About my project i am making a pov display. With the main function as a clock dsiplay. So i have two parts, a static part and the spinning display. My plan is:
The spinning display has the LEDs, led driver/shift register, microduino core +(processor atmega1284p) and a bluetooth to communicate with the atmega 2560, which is on the static part
The static part has:mega2560, bluetooth, display to display the rpm of the display speed, hall sensor to measure the speed and tell the position of the display, and the mega2560 also controls a brushless motor powering the display.
I am unsure whether the mega2560 can handle the display, bluetooth, motor anc sensor altogether, i have seen other people use a seperate atmega328p to control the rpm manually.
The display has three arms each with 32 LEDs on each arm, one arm facing outwards of the cylinder display, the other two arm facing inwards. The radious of the cylinder is about 4cm. And the lenght of the arms depend on led drivers chip znd is yet to be determined. You can refer to the picture i attached in the first post.
Pov display need to spin at 25 revolution per second minimum and i don't want it to go over 40 revolution per second, because of safety factors and te faster the speed the more data needed to be processed.
I can have max 83 slice on the display, circumference divied by LEDs width, initallly i was thinking of having 64 slice.

That is my proposal for the pov display in a nutshell. If you have more questions on the project please ask. I have not recieved my parts yet and i want to design the circuit for the arms, which will host the led drivers and LEDs and the rest of the circuit will be on the base of the cylinder hosting the microduino and bluetooth. I plan to connet the arms and the base with wires.

If you need diagrams i will try to provide it.

From what you described I don't see the need to control the brightness of individual LEDs with PWM. So I probably would use simple shift registers (p.e. 74HC595) to drive the LEDs because they are fast and you only need three signal lines to controll all LEDs. You can use the SPI hardware to shift out the bit information, although with the current specification you might be fast enough with direct port manipulation too.

Thanks for the suggestion, i looked at the data sheet for 74HC595 but it was hard to read and i didn't want to get confused. Can you please explain a few things please:

  1. how do i determine the resistor value, the LEDs are rated 3.3V and 20mA each? what is the voltage and current the 74HC595 sources?
  2. how do i set up the power supply, would i need a separate power supply for the LEDs with the 74HC595 as the LEDs take up about 2A together. or do i use the arduino 5v/3.3 pin?
    cheers

Can you tell me where in all of your explanation you describe what this thing is supposed to look like? What is a spectator going (or supposed to see? ie; why all the leds ? why spinning ? What's the point ? POV (persistence of vision ) is too general . It doesn't tell us what special effect your are trying to achieve. Can you tell me where you explained that ? (like a quote or something)

Sorry, Raschemmel, i have not describe what the POV display looks like, all i have posted so far only included the general parts i will use for the spinning part and the static parts. as below:

About my project i am making a pov display. With the main function as a clock dsiplay. So i have two parts, a static part and the spinning display. My plan is:
The spinning display has the LEDs, led driver/shift register, microduino core +(processor atmega1284p) and a bluetooth to communicate with the atmega 2560, which is on the static part
The static part has:mega2560, bluetooth, display to display the rpm of the display speed, hall sensor to measure the speed and tell the position of the display, and the mega2560 also controls a brushless motor powering the display.
I am unsure whether the mega2560 can handle the display, bluetooth, motor and sensor altogether, i have seen other people use a separate atmega328p to control the rpm manually.
The display has three arms each with 32 LEDs on each arm, one arm facing outwards of the cylinder display, the other two arm facing inwards. The radius of the cylinder is about 4cm. And the length of the arms depend on led drivers chip and is yet to be determined. You can refer to the picture i attached in the first post.
Pov display need to spin at 25 revolution per second minimum and i don't want it to go over 40 revolution per second, because of safety factors and the faster the speed the more data needed to be processed.
I can have max 83 slice on the display, circumference divided by LEDs width, initially i was thinking of having 64 slice.

to give you an idea, below is a link to an example of POV display, it is similar to what i have in mind in terms of the cylinder shape of the display. form the video, what i mean by the static part and the spinning part should be obvious.

i hope that gives you some ideas, the difference of the above example to what i have in mind are:

  1. I am not using RGB LEDs, but single color LEDs.
  2. the arms will not be spaced apart with even angles.
  3. My design has three arms but only one of the arms have LEDs facing outwards, the two other arms have LEDs facing inwards. this is so the back half of the cylinder display can also display when viewed by the spectator, in the video, when the numbers are being display (about 1 minute into the video), noticed how the back half of the display are not displaying anything as the LEDs are facing the outwards, which is opposite to the viewer.
  4. The radius and length of my display is smaller, the radius i have in mind is 4 cm and the length depends on the led driver i will use, which i have been suggested to use 74HC595, 4 74HC595 per arm with 32 x 3258 LEDs would be about 20 cm?
  5. i want to have the cylinder side ways to suite the display of a digital clock.
  6. i am using a RC plan brush less motor with ESC to spin the display

I call it POV display because as the LEDs passes over a certain postition the LEDs will flash and to the human eyes it is as constantly on.
i have attached two rough drawn picture to illustrate what i mean, one is the 3d view of the spinning display with three arms, not equally angled/spaced. this is really rough drawing and missing details like counter balance weight,etc. The other view is the cross section of the display, mainly the arms. sorry about the quality, i hope it is enough for you to understand the basic design. If not, tell me, and i will try to do better.

pov dispaly.jpg

i have some questions on how to power the 74HC595 and the LEDs
Form the data sheet it says that the recommended current sourced to the LEDs per channel is +-6mA and the max is +-35mA before the chip is damaged. i read that as the current sources increases the voltage would drop. the rating of my LEDs are 3.3 V and max 20mA white LEDs. how much current can i drive each while maintaining the correct voltage? and what resistor value should i use?

The other question is how do i power the LEDs and the 74HC595. because i have 96 LEDs, ideally i would drive them at full brightness and that would mean around 2A is needed. but would that be over the 74HC595's total current limit and fry it?

The number you're looking for is in the data sheet: "DC current drain per VCC, GND". It's 75 mA. That's the total that the power/GND pins can carry without damage. Since all drive current passes through Vcc or GND, it then becomes the absolute maximum total drive current.

As noted, this is a damage threshold and function isn't guaranteed

above is an extract form another forum in regards to the 74HC595 chip. it says 75 mA is the limit.
it would be nice if someone can point out where on the data sheets it says the max limit for the total current passing each 74HC595 is as i have trouble fully digesting te data sheet information. if i am going to daisy chain the 12 74HC595 chips, how do i ensure they would not get fried and each LEDs get enough power?

attached are two different data sheet i found for the 74HC595 chips

74HC_HCT595.pdf (367 KB)

SN74HC595.pdf (477 KB)

If you want to drive the LEDs at their maximum brightness you might better choose another shift register. I used some TPIC6595 (http://www.ti.com/lit/ds/slis010b/slis010b.pdf) in a project where I used bright LEDs. There each channel is able to drive constantly 250mA and the handling is similar.

thanks for the suggestion.
would i still need resistors? if so how do i determine their value? i am not very good at reading the data sheet, can you also tell me what the total current limit for the TPIC6595 is. Thanks a lot.

The resistor value is calculated simply: Take the power voltage (I guess 5V in your case), subtract the LED forward voltage (3.3V in your case) and divide the resulting value by the current you're targeting (20mA as you wrote). That results in 85? for your case, so I would probably take a 100? resistor to have some room for small over-voltages.

The maximum current a single TPIC6595 can source is 750mA, more than enough for your application.

Thanks for the explanation.
i have drawn a basic circuit for the power setup.Can you please tell me if i have the basic idea of the power setup correct? i did not include all of the 12 TPIC6595, but just one.

The maximum current a single TPIC6595 can source is 750mA, more than enough for your application.

Do you do the calculation as 750-(8 x 20)=90mA? i have to connect the Vcc for each TPIC6595 in parallel right? And you mention "source" the 750 mA, can it 'sink' as well and if so,is there a better option for my project o just preference? i just want to make sure .
Also when can i solder the TIPC695 without using a socket or is that not safe practice.
Thanks

power supply setup.png

If i try to get free sample for the TPIC6595N from Texas instrument, i can only get 5 of it, can i also use TPIC6B595N and TPIC6C595 along side with TPIC6595N for my project, would there be a problem daisy chaining them together? i need 12 x 8 bit chips so 5 of each one just make it up with 3 extra.

i have drawn a basic circuit for the power setup.Can you please tell me if i have the basic idea of the power setup correct?

It's almost the same as I have wired my project (I have the LEDs directly on +5V, then the resistor, then the TPIC6595).

Do you do the calculation as 750-(8 x 20)=90mA?

The calculation is correct but the result is 590mA and not 90mA.

i have to connect the Vcc for each TPIC6595 in parallel right?

Yes, that right.

And you mention "source" the 750 mA, can it 'sink' as well and if so,is there a better option for my project o just preference? i just want to make sure .

Also correct, both ways are possible, as I already wrote, I took the sinking option too.

Also when can i solder the TIPC695 without using a socket or is that not safe practice.

I used the SMD version, so sockets were not an option. For the DIP version you can use sockets if you fear about your soldering skills.

If i try to get free sample for the TPIC6595N from Texas instrument, i can only get 5 of it, can i also use TPIC6B595N and TPIC6C595 along side with TPIC6595N for my project, would there be a problem daisy chaining them together? i need 12 x 8 bit chips so 5 of each one just make it up with 3 extra.

I don't know about the other ones and I also think that getting 12 chips as free samples is not fair practice. These chips are not that expensive, if you don't have the budget to buy them think about redimensioning your project.

pylon:
The maximum current a single TPIC6595 can source is 750mA

Hi, just to clear up any confusion, the TPIC series chips can't source any current. They can only sink it. How much depends on the model: TPIC6A595 can sink 350mA per output, TPIC6C595 only 100mA (that would still be enough).

Also maybe consider STP08CP05

Paul

I also think that getting 12 chips as free samples is not fair practice.

i will keep that in mind next time. But i have already bought other chips: tlc5950s only to find that it does not suite my project, i rather 'sample' first to be safe, so not to blow my budget of 200 AUD. i have spent roughly a 100 already and i want to leave enough for the PCB manufacturing.

I used the SMD version, so sockets were not an option. For the DIP version you can use sockets if you fear about your soldering skills.

Did you use a home made re-flow oven or solder the chips with a fine tip soldering iron?
Thanks for your help. hopefully someone can tell me if i can daisy chain the 3 different chips together.

i will keep that in mind next time. But i have already bought other chips: tlc5950s only to find that it does not suite my project, i rather 'sample' first to be safe, so not to blow my budget of 200 AUD. i have spent roughly a 100 already and i want to leave enough for the PCB manufacturing.

It's OK to get one free sample to check if it works as you want it to. If that one works you can buy the other eleven chips.

Did you use a home made re-flow oven or solder the chips with a fine tip soldering iron?

I started with a fine soldering tip and did the last ones with solder paste and a hot air gun which works just great. The reflow oven is a project I'm just start thinking about.

hopefully someone can tell me if i can daisy chain the 3 different chips together.

You most probably can as they are the same family of chips. You just have to check if they provide the power you need.

Thanks, i have already ordered the sample and it is already shipped, next time i will just order one sample instead.
I read you can just used a small toaster oven with a themometer as the relow oven and manulaly adjusting the temperature with out any need for microcontroller to help. Surface Mount Soldering with a Toaster Oven | Freetronics. perhaps that will help.

Thank you, I know that page too, but without a microcontroller monitoring the reflow oven I don't have more convenience than with the reflow paste and heating with the hot air gun. But controlling a simple oven with some Arduino PLC is not that a big project, I just have to find a slot in my agenda :).

hello, i have received the parts and i am designing the schematics. For the TPIC6595, the data sheet says:

Separate power and logic level ground pins are provided to facilitate maximum system flexibility. Pins 1, 10, 11,
and 20 are internally connected, and each pin must be externally connected to the power system ground in order
to minimize parasitic inductance. A single-point connection between pin 19, logic ground (LGND), and pins 1,
10, 11, and 20, power grounds (PGND), must be externally made in a manner that reduces crosstalk between
the logic and load circuits.

Does this mean all 5 pins(4 PGND and 1 LGND) must all be connected to GND?