Using a DM13A sink driver to drive the cathode columns.Other similar designs can be used with this library. In this case, the row would be on if the its pin on the 74HC595 is low, which turns on the PNP transistor allowing current to flow. However, since the 74HC595 cannot source enough power to drive the multiple LEDs in the row, you might use a PNP transistor to drive the row. Basically, the shift register is sinking the columns and powering the rows. In this common anode set up, the rows would be "on" when the proper 74HC595 pin is in the high state and the column would "on" when its respective pin is in the low state. In this configuration, the first bit shifted out in an update cycle is for C01, and the last bit shifted out is for R1. So the second 74HC595 (U2) would have its Q0 through Q3 attached to R1 through R4, and its Q4 through Q7 attached to C12 down through C09. Since there are 12 column and 4 rows, two 8-bit shift registers are needed. In this case, Q7 of the first 74HC595 (U1) would be attached to C01, Q6 to C02, and so on. The input serial stream flows into U2, so the LSB will be on Q0 of U2. U1's SER pin will need to be connected to the SER' (aka Q7') pin on U2. Give that, U1 should be a downstream slave to U2 and the MSB ultimately will reside in the Q7 pin of U1. The first one, U1, will contain the MSB, which will be the first bit shifted out. Since there are 16 bits needed to control the rows and columns, two 74HC595 shift registers will be used. The shift registers are connected in serial such that the most significant bit (MSB) being the first LED column and the least significant bit (LSB) being the first row. If common cathode LEDs were used instead, this would be swapped with the rows becoming sinks and the columns being power source. To light any particular LED color, its row should be powered and the column sinked. In this example, the RGB LED common anodes are connected into rows, and the cathodes are connected into columns aligned with the colors of each LED. This library can support either common anode or common cathode RGB LEDs, but default settings assume common anode.Ĭonsider the following 4x4 matrix using common anode RGB LEDs as an example: The general hardware design of the matrix is to use shift registers to drive the matrix. This driver uses SPI to transfer bits to the shift registers and uses one timer interrupt.įind at more about this library and hardware that it is designed for at: This driver also depends on the Adafruit GFX Library v1.9.0 or later, which can be installed via the libraries manager. To use this driver in the Arduino IDE, add the folder ShiftRegisterLEDMatrixLib as a library as described in this document, or install via the libraries manager in the Arduino IDE. Both single color and RGB LED matrices are supported. This library provides a generalized API to create and drive an image on LED matrix where shift registers, such as the 74HC595 or DM13a, are used to control the rows and columns of the matrix. Arduino Driver for Shift Register LED Matrices
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |