I'm trying to use an Arduino Uno to drive 200 LEDs and display animations. The animations are located on an SD memory card. There could be up to 250 animations on the SD card. Eventually, I will convert the sketch and project to use ONLY the ATmega328p chip instead of the Arduino (for cost reasons).
Quote from: ElectricDiode on Nov 08, 2013, 04:55 pmI'm trying to use an Arduino Uno to drive 200 LEDs and display animations. The animations are located on an SD memory card. There could be up to 250 animations on the SD card. Eventually, I will convert the sketch and project to use ONLY the ATmega328p chip instead of the Arduino (for cost reasons).How do you plan on controlling the 200 LEDS?How are the animations stored on the SD card?
unless you are mass producing, you will not save anything using atmega328 chip and building your circuit. you can get an arduino pro mini now for $3.45 and can use the full 32kb program space if you program via icsp.
anyway, if you are doing animation, is that at 15 frames per second? or probably slower right? at 15 frames, that gives you 66ms to setup the data and send it out.did you try this at all yet? sd read should take a shorter time that sd write. worse case you can use timer interrupt code to control your led line, reading from a circular buffer containing the frame data, and the sd card read will be in the main loop just continuously filling up the buffer.
If you are storing the data as XRGB_888, as in one byte per component / 3 bytes per pixel, you could try a different format.XRGB_565 is what many TFT LCD displays use, it allows 65536 colours. Whats even better is a frame now fits in 400 bytes instead of 600, which is within the SD cards native block size. This would also greatly speed up SD card access times, and maybe allow multiple frames to be buffered at once.
How long is each animation, in terms of bytes?
My experience is around 15KB/s continuous speed with SD card running at full SPI bus speed. You should get a different SD card setup to make it at least half speed SPI. Are you using resistors for level shifting or level shifter chips? The latter is faster.
You will have a hard time "streaming" bytes from SD card since it is a block device. Things come in block at a time so pYro_65's idea to fit one frame within one SD card block is quite interesting. You may then pad each frame to the size of one SD card block and access will be faster.
Please enter a valid email to subscribe
We need to confirm your email address.
To complete the subscription, please click the link in the
email we just sent you.
Thank you for subscribing!
via Egeo 16