Adafruit 16×32 LED matrix on Arduino Due (2)

Not to much time spend so far on this display, but before I continued I wanted to make sure I can make the display illuminate asynchronously with the rest of the program flow. To do this we need to use interrupts which is launched after a certain timer expires. This way we can for example make sure that every 5ms the pixels are refreshed so that we get a clear non-flickering image. This also allows us to program our normal program code in the loop method without having to worry about the display code not being called in time (because then the display would go black for some time). For Arduino Uno the code is already there in the IDE to use, for Due a guy named Ivan Seidel already did some testing and programming and so we can also make use of interrupts on Due really easy (library on https://github.com/ivanseidel/DueTimer).

Here is a 3-bit colors version of the British flag displayed with the Adafruit 16×32 RGB LED matrix and Arduino Due.

2014-03-07 00.05.08I notice though that the LED’s do not really shine so powerful as they should, and also altering the interrupt timer to display at 50 or 100Hz intervals really ruins the picture (also this I can not explain). So more work ahead… may God save the Queen!

Advertisements

7 thoughts on “Adafruit 16×32 LED matrix on Arduino Due (2)

  1. Hi!
    Great that you are using my library…
    Perhaps the problem with higher frequencies is that the time taken to update the LED’s, is higher than the period of the timer interrupt.

    You can use the method “micros” to calculate how much time is taking to update the LCD, and find out the MAXIMUM update frequency…

    Also, If you use REGISTERS to write to output pins, it might improve your speed up to 100x (I tested this once).

    Good luck, and nice blog!
    Ivan

  2. afterhourscoding says:

    Hey Ivan,
    thanks for the tips, I was already doing some reading about this in the weekend so yes there still something to improve as far as writing to the outputs goes. But it seems not so many people have been doing the direct port manipulation on the Due, there is not loads of information to find about it, best source of info so far: http://forum.arduino.cc/index.php?PHPSESSID=d8asct2vnp8lof5rd4mcri7de7&topic=129868.0
    I’ll try it in few days… Also I noticed in the LED Matrix driver there’s already a tiny bit of coding done by Adafruit for the Arduino Due so I’ll also have a look at what they got so far. There is unfortunately nothing documented regarding the Due on the LED matrix website.

  3. I’m going to tackle a RGB 32*16 on the Due very soon. Just finished a TFT driver for a SSD1289 320*240 display using all port manipulation which is capable of clearing the screen 197 times a second and gets blazing speed compared to about every video I’ve seen.

    Unless I’ve overlooked something in my initial “research” I’m going to do all the painting and screen handling in raw rgb565 via a small buffer… then when desired that screen is copied to a back buffer in a format the display likes (ie after some bit bashing). Once a back buffer is refreshed the interrupt will copy it to the working buffer.

    I use interrupts to service wav file output so hoping having 2 won’t upset things. However… the wav file interrupt is very small and short.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s