The goal is to build up a 32×8 LED matrix with THT parts that you can buy at your local dealer. Currently it uses 4 74HC595 shift registers and 2 4017 decade counter to control the matrix. Controlling the LED matrix should be done with an AtMega32 and an AtMega8 for USB to seriell communication.
Nothing there yet.
The USB interface is build after schematic of http://www.recursion.jp/avrcdc/cdc-232.html and uses the same firmware. The communication between the AtMega8 and the AtMega32 is done via normal UART communication.
To control the LED matrix from the PC, the user must send normal text commands and binary image data.
There are two types of commands. Single line commands and block commands. Each command start with a 3 byte header and consists of a 3 byte text command followed by the data.
While single line commands ends with a normal line break, block commands must end with the 3 byte text command followed by the 3 bytes header.
The 3 header bytes read LED.
Format of single line command: LEDCOMMANDDATA
Format of block command: LEDCOMMANDDATACOMMANDLED
Clears all pixels on the LED Matrix.
Command: CLR Data: none
Usage: LEDCLR
Sets one pixel on the LED matrix indicated by X and Y coordinates.
Command: STP Data: COORDINATES (1 Byte)
Usage: LEDSTPCOORDINATES
The lower 5 bits of the coordinates parameter describe the X coordinate to set. The upper 3 bits of the coordinates parameter describe the Y coordinate to set. All counting starts at zero (0 ⇐ X ⇐ 31; 0 ⇐ Y ⇐ 7).
Examples:
Clears one pixel on the LED matrix indicated by X and Y coordinates.
Command: CLP Data: COORDINATES (1 Byte)
Usage: LEDCLPCOORDINATES
The lower 5 bits of the coordinates parameter describe the X coordinate to set. The upper 3 bits of the coordinates parameter describe the Y coordinate to set. All counting starts at zero (0 ⇐ X ⇐ 31; 0 ⇐ Y ⇐ 7).
Examples:
Toggles one pixel on the LED matrix indicated by X and Y coordinates.
Command: TGP Data: COORDINATES (1 Byte)
Usage: LEDTGPCOORDINATES
The lower 5 bits of the coordinates parameter describe the X coordinate to set. The upper 3 bits of the coordinates parameter describe the Y coordinate to set. All counting starts at zero (0 ⇐ X ⇐ 31; 0 ⇐ Y ⇐ 7).
Examples: