I want to output the string 'LED GAME' as indicated in picture . But in Dot matrix , there are only 16 + 16 = 32 pins . is there any way to print a string from avr to dotmatrix ?
Put common-cathode display drivers that interface microprocessors (µPs) to 7-segment numeric LED dis-plays of up to 8 digits, bar-graph displays, or 64 indi-vidual LEDs. Included on-chip are a BCD code-B decoder, multiplex scan circuitry, segment and digit drivers, and an 8x8 static RAM that stores each digit.
Most LED matrixes are internally built up like this example here:
For a 16x16 LED matrix you thus have 16 pins for the rows and 16 pins for the columns. To see how your specific matrix is built up, you'll have to find its datasheet.
To write anything on the display, you will set the first row to ON, all others to OFF and activate the cols you need. After a delay, you will set the first row to OFF, the second row to ON and activate the cols you want to see in the second row. You will iterate through all rows like this. As the delay will be pretty short, your eyes aren't fast enough to see that the LEDs are off most of the time.
I would suggest to use a timer interrupt on you microcontroller and iterate through the rows in the interrupt routine. That way you can easily use the microcontroller for other things without worrying too much about timing issues.
The leftmost pin of dot matrix on the opposite site of the label '2088BH-B' is pin 1 .
You can get a complete idea from the two following picture .
Hope this will help you a lot . you can also try the following code which is written for showing 9 in dot matrix ( compiler: micro-C)
i am currently trying to get a 8x8 LED Matrix, which is controlled by a MAX7219 IC, working. The chip supports SPI with DIN
, CS
and CLK
pins. I tried to control the chip via software SPI with a STM32F103
. This is my code:
And this is how the pin states look like, captured with a logic analyzer:
Even though i think i did everything correctly (bit state of the DIN
pin is transfered on rising edge of CLK
, full 16 bits are shifted on CS
rising edge, which should appear at or after the 16th rising edge of CLK
) it doesn't work. The longest timing is 100ns which should be fulfilled. Any help is very much appreciated.
Edit: This is how the PCB looks:
Try replacing your transmitData() function, as follows:
Now, I don't have a compiler to check for stupid typing errors or forgetting to declare a needed variable. But it should get across the idea, anyway.
I've created an intermediate function to transmit a byte, since the communication appears to break down this way. The transmitByte() function handles the transmission of one byte. Each send-packet to the MAX7219 requires two bytes: one for the register and one for the data used to modify that register value.
You can change that uint16_t to a uint8_t, if you have such a thing available, in transmitByte(). I couldn't tell if you had one (though I expect you do.)
The code I wrote assumes that CLK and LOAD (your SCK and CS) lines are all '1' to start. So you'd need to initialize those according to this new plan. Something like this:
Note that I've added an intensity register change?
Use the above to consider your code, or try it out. One thing I think is important is that you may have missed adjusting the intensity register value. So perhaps just change your code on that point and see if it gets you there. But, if it doesn't, try out the above changes and see if that makes a difference.