Main Site Documentation

Driver - Rainbowduino RGB 8x8 led matrix driver


#1

[title]Rainbowduino RGB 8x8 led matrix driver[/title]
http://code.tinyclr.com/project/398/rainbowduino-rgb-8x8-led-matrix-driver/
[line]
The rainbowduino is an 8x8 RGB lef matrix driver based upon an ATMEGA328 (Arduino), made by seeedstudio ( http://www.seeedstudio.com/depot/rainbowduino-led-driver-platform-atmega-328-p-371.html?cPath=132_133 ). Each RGB Color has 16 levels availables (so 12 bits colors depht for each led). Rainowduino board and leftmatrix are sold separatly. Don’t use more than 7v DC power supply as it tends to heat then…

Once loaded with an appropriate firmware (just not the default one !!!) it allows you to address either a 8x8 RGB led matrix or a 4x4x4 RGB cube matrix throught either serial (TTL) or I2C. You can eventualy daisychain several of them (here we are going to be able to use several in parallel). Seedstudio sells easytouse 4x4x4 RGB led cube to use with it ( http://www.seeedstudio.com/depot/rainbow-cube-kit-rgb-4x4x4-rainbowduino-compatible-p-596.html?cPath=138 )

The only problem is its firmware : the default one is useless and buggy. Many peoples did their own, and to be able to communicate with the FEZ I chose the RainbowDashBoard, using UART only (
http://code.google.com/p/rainbowdash/ ). Its features: double-buffered graphic operations, high level API/command set, Full ansi (CP1252) character set, proper handling of gamma corrections (see below), programmable inboard animation (just send the animation code, and it will then play it without any intervention from the Fez), or just plain buffer transfert (simply dump 96 bytes or 256 bytes matrix to the board). With software UART from this driver, you can then address easily simultaneously as many rainbowduino as you have digital pins available…

First thing to do is so to flash this new firmware into the rainbowduino:

  • Get the rainbowduino code via CVS ( svn checkout http://rainbowdash.googlecode.com/svn/trunk/
    rainbowdash-read-only ) for the latest version or the zip file attached for v3.0
  • Get a FTDI cable to connect to your PC (rainbowduino v1 or v2 only, v3 has onboard USB interface)
  • Get the arduino software (http://www.arduino.cc)
  • Eventualy adapt the baudrate of the firmware to your needs (by defaults, 9600 bits/s, can be a little slow)
  • Program the rainbowduino, and you’re done.
    The whole process takes less than 15 minutes if you are used to arduino programming.

The driver included here is providing most of the APIs of the rainbowduinodashboard, but if you are missing some you need, it is easy to add them. It can accept both regular FEZ UART connection (3 wires, GND TX and TX), or software UART (just give a single digital pin). Advantage of software UART: can use any digital PIN, uses only one pin. Advantages of regular UARTs : faster, and you can actualy “ping” your rainbowduino (check if it’s here), all functions can be blocking or nonblocking mode (in blocking mode : will return only when the transmit operation completed). With software UART, the functions are always in blocking mode.

About the Gamma:
The gamma table fixes the prob­lem human eyes have cor­rectly deter­min­ing bright­ness of pulsed light. Even though PWM from 0 to 100% duty cycle is accu­rately chang­ing bright­ness in a lin­ear way, the eye sees almost no dif­fer­ence between 75% and 100% bright­ness. So the gamma table uses some­thing like a log­a­rith­mic trans­la­tion; the val­ues will change very slowly at low bright­ness and very quickly at high brightness.

As usual, please contact me for bug reports to opensource (at) grisambre (dot) net

Updated 12/13/2011 to v1.0b, few bugs corrected