P10 Display Notes
P10 Display Notes
==========
NOTE in this description the LEDs are numbered in accordance with their
x & y position coordinates beginning at (0,0) at the top left corner to (31,15)
at the lower right, looking at the front of the DMD.
The version of the DMD Library used is the one available at:
https://github.com/cjd/DMD
which has significant updates and improvements over the earlier versions.
There could be a little confusion regarding some numbering within the DMD
library. For example: the locations of LEDs are zero referenced (0,0) to
(31,15) but the rows of LEDs are numbered from 1 to 16.
I will use 0 to 15 here.
Top left LED (0,0) is bit 7 of byte 0, next LED (1,0) bit 6 of byte 0,
. . . . . . . etc to bit 0 of byte 7 as last LED on top row (31,0).
Second row LED (0,1) is bit 7 of byte 4, LED (1,1) is bit 6 of byte 4,
. . . . . . . etc to bit 0 of byte 7 . . . . . . etc through to the bottom
row of LEDs:
Bottom left LED (0,15) is bit 7 of byte 60, . . . . . .
etc to (31,15) bit 0 of byte 63.
0 1 2 3 4 5 6 7 8 9 10 15 23 31 column (x)
/---byte 0----\ /---byte 1----\ /---byte 2----\ /---byte 3----\
7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 Row 0 (y)
/-----------------------DMD1--------------------\ /---------------
DMD2------------\
0 1 2 3 4 5 6 7 8 9 10 15 24 31 32 39 56
63 column (x)
/---byte 0----\ /---byte 1----\ . /---byte 3----\ | /---byte 4----\ . /---byte
7----\
7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 | 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1
0 Row (y) 0
For only 1 DMD high (any number wide), the byte for a particular LED is equal to:
(Xcoord / 8) + (Ycoord * NumberOfDMDs * 4)
For multi dimensional DMD arrays, the byte for a particular LED is equal to:
(DisplaysTotal * 4 * (Ycoord % 16)) + (4 * DisplaysAcross * (Ycoord / 16)) +
(Xcoord / 8)
The bit is equal to:
7 - (Xcoord % 8)
Each shift register output drives 4 LEDs in a vertical column (the cathode).
QA of 74HC585-1 is connected to LEDs 31,0 31,1 31,2 & 31,3.
QB is connected to LEDs 30,0 30,1 30,2 & 30,3 and so on to
QH connecting to 24,0 24,1 24,2 & 24,3.
So each shift register drives a block of LEDs 8 wide by 4 high.
The overflow QH' from 74HC595-1 is fed into the input of 74HC595-2 which drives
the next block of 32 LEDs (31,4 31,5 31,6 31,7; 30,4 30,5 etc to 24,4 24,5 24,6
24,7. Finally, the overflow QH' of 74HC595-16 is connected to the DMD JP2
connector for input to a following board where the same process occurs.
The 4 LEDs driven by each shift register output have their anodes connected to
1 of 4 switched Vcc supplies feeding 4 blocks of interleaved rows such that all
anodes in rows 0, 4, 8, 12 are connected together, as are all anodes in rows
1, 5, 9, 13 and 2, 6, 10, 14 and 3, 7, 11, 15.
(There are actually 2 switched Vcc supplies for each of these 4 blocks each
driven by a separate MOSFET to prevent overloading the MOSFET, but they are
driven in parallel.)
These groups of rows are selected by means of the DMD lines A & B (D6 & D7 on
the Arduino) which selects 1 of 4 via the 74HC128, the output of which switches
a pair of MOSFETS to supply Vcc to a total of 128 LEDs.
For an individual LED to be ON, its corresponding shift register output must be
LOW and its row must be selected.
The DMD shift registers operate in a serial fashion with each bit of data
entered being promulgated to the next position when the next data bit is
entered. The order in which the data is entered is critical. Because the LED
connected to the last output (QH) of the last shift register (74HC595-16) is
LED 0,15 this must be the first bit entered, followed by 1,15 etc. Similarly,
the last bit entered must be for LED 31,0 connected to the first output (QA)
of the first shift register (74HC595-1). So exactly the correct number of
bits must be applied in the correct sequence of both bits and bytes.
Note that the bit order is the most significant bit (bit 7) first.
0 1 2 3 4 5 6 7 8 9 10 15 23 31 column (x)
/- 74HC595-13-\ /- 74HC595-9 -\ /- 74HC595-5 -\ /- 74HC595-1 -\
H G F E D C B A H G F E D C B A H G F E D C B A H G F E D C B A Row 0 (y)
NOTES:
1. Only a maximum of 128 LEDs on a DMD can be ON at any one time - not 512.
2. The data bit for an LED must be LOW for that LED to be ON.
3. The DMD has a 1k pullup and 4k7 pulldown resistors on the CLK and SCLK
lines. Why? and why both? When not driven either HIGH or LOW, these lines
will be read as HIGH because the voltage will be greater than the
(0.7 x Vcc) threshold to guaranty a HIGH, so why the pulldown?
4. There is no pullup/pulldown resistor on an any other line. The OE line
should have a pulldown resistor.
5. The nOE line is incorrectly labelled on the DMD connector board and within
the DMD library. This is active HIGH and should be labelled "OE". It is
correctly labelled in the DMD schematic.
6. There is no reset/clear function on powerup of the DMD. The OE line should
be held LOW until the DMD display is explicitly cleared or updated to
prevent any LEDs from lighting before they are set with valid data.
7. There are no current limiting resistors in the LED circuit. They are driven
directly from the shift register output which has a limited current capacity
of around 35mA (depends on manufacturer). While this is a fairly common
practice, it is not good design. There is a limit of around 70mA total
Vcc or ground current per chip (again depends on the manufacturer) which
will be greatly exceeded if more that 2 LEDs on a single shift register
are ON. Again, poor design.
8. DMDs MUST be powered and NOT fed from the USB port via the Arduino. There
is no Vcc connection between the Arduino board and the DMD. This means that
the only way power can be supplied to the DMD (without its own power supply)
is via the active control lines (D6, D7, D8, D9, D11, D12, & D13). When at
least one of these is in the HIGH state, it will supply current to the bus
tranceiver 74HC245 which feeds its supply line via its input protection
circuitry. This is NOT GOOD for either the Arduino or the DMD. The only
thing saving your Arduino (and possibly the DMD) is the limited current
available on the USB port.
9. There are several hardware versions of the DMD PCB which appear to be
electrically equivalent. I suspect these might be from different supply
contracts for production based on a supplied circuit rather than a
supplied PCB layout.
===========================================================================
Each call of the scanDisplayBySPI() interrupt routine takes about 84 uSec for
a single DMD, plus 44 uSec for each additional DMD - based on the DMD
library as supplied with 8 mHz SPI clock (SPI.setClockDivider(SPI_CLOCK_DIV2)).