Another day, another celebration and another video showing a message on my newly found addiction of LED-Dot-Matrix Displays… This time, 2 displays connected together, showing the message as a marquee. The message was also now simply put in as a simple character array, no more manual pattern making, now the MESSAGE can be updated as easily as changing a character array, so it can be controlled quite easily.
Also tested in this demonstration was the capability of merging multiple displays together to form a long display, now I need to make another set and test for multiple lines. Thinking of making small BackPack style PCBs for these displays so that I can easily connect as many as needed in daisy-chain fashion.
The message shown on the LCD is
Heartiest EID GREETINGS to ALL, have a HAPPY, WONDERFUL, JOYOUS, SAFE and mobile-network-less EID.. ZP THANKS for WATCHING….
The camera even shows some columns as lit when they have been turned off (due to the camera’s frame-rate) but in actual this looks pretty amazing and damn cool. Also if you look closely, one column is not lighting up in the video, this is due to a defected Shift Register IC 74HC595, it is not activating 1-bit on its output, since I didn’t have any extra 74HC595 so the video was made without fixing it..
Another day, another LED Matrix video. These 64 LED packs have got me fixed on them and I have been trying all sorts of stuff…
VIDEO AT THE END
I have finally made a completely proper circuit on breadboard with 2x 74HC595s and 1x ULN2803 for current sinking and resistors for current limiting. The first circuit I had made had no resistors for current limiting and was composed only of 2 74HC595 ICs, one of the ICs was getting quite hot and the brightness also varied depending on number of LEDs lit.
I wanted a complete font set for the display so I set out to mak it myself but finally decided to copy the 5×7 dot-matrix-font which is used in alpha-numeric LCDs.
The task of converting all these characters into HEX code was taking a bit too much time, so I wrote a small tool in C# which generated these automatically from pattern made on a Checkbox grid and I ahd the complete set ready in no-time. the two different hex codes shown are for different alignment of display[I saved the other ones as I might need them later].
Here is a video showing alphabets and numbers Marqueeing along the display, though the camera shows flickering and reflections the display looks great in person.
I finally completed writing code for a Marquee Display and since I used the morning of 14th August to write this code, the least I could do was to celebrate Pakistan’s Independence Day as the first message and test for my code.
The code has DEFINE(s) for Display Length, Message Length, Speed Control and a Full-Size-AlphaNumeric-Font. Putting in a new message or updating via UART is also supported as the message array is built at run-time.
Complete code was written by me and this time, I didn’t Google once to see how others have done similar work. Now I think I will do some searching and compare my code with others.
Using AVR Atmega8, with an empty MAIN LOOP as everytihng is handles by a TIMER. The AVR sends commands via SPI to 2 Shift Registers (74HC595) which are connected in a way to overflow the data to the last register.
Here’s the Schematic; the resistors etc are not shown; I will probably put up a more detailed version sometime soon.
The 3 wires going up and out of the schematic are the SPI wires goign to AVR.
I have not uploaded the Project Files yet, as I am still tinkering with the code, but if you want to get the AVR Studio Project Files and the Circuit/Simulation, just say so in the comments…
Having easy UART Functionality can be of great use in AVR Projects, even if they don’t need the UART fucntionality, the UART can be used as a great debugging tool (sending program status to the UART as a console). Peter Fleury has a AVR UART Library as well along with his AVR LCD Library which I explained here some time ago.
The Library handles all the UART related tasks and works on Interrupts so, it can receive data coming in even when the AVR is not explicitly polling the UART Lines. I had made this serial-test project so that I have a working UART snippet for use whenever I need. I have tried to clean up the uart-test file which is provided along with the library and made the IF condition a little more compact.
I am attaching all the project files with this post so you may easily download them and use.
Most AVRs have a small EEPROM which can be used to save variables, configuration settings etc when there is no power and the data is available for read/write/modify the next time AVR powers up.
This post simply shows the most basic method for saving a variable (char) in the AVR EEPROM, modifying it at every start-up and then saving it. Basically it will be a counter for how many times the AVR has been turned-ON.