I have one of the typical cheapo four-module 7219 LED matrices (e.g. four panels of 8x8 each, with power, ground, clock and cs daisy-chained; each module after the first gets it's DIN from the previous DOUT). I downloaded the current Max72197221.cs from Netduino Helpers, and was able to send letters and patterns to the first module. So far ,so good.
However, according to the 7219 datasheet, I should be able to address each of the subsequent modules by sending a No-Op after each row of data (the four 7219 chips acting as a shift register) for each module I want to move to the right. But sending what I think is the right value to the matrix doesn't work.
For example, I changed the original Max72197221.cs code to define SpiBuffer as ushort[2], and modified the Write subroutine as follows:
protected void Write(byte register, byte value) {
SpiBuffer[0] = register;
SpiBuffer[0] <<= 8;
SpiBuffer[0] |= value;
SpiBuffer[1] = (byte)RegisterAddressMap.NoOp;
SpiBuffer[1] <<= 8;
SpiBuffer[1] |= 0;
Spi.Write(SpiBuffer);
}
But the display doesn't - well, display. It also doesn't work when defining SpiBuffer[1] simply as 0 (without all the bit-shifting nonsense). Can anyone help me spot the flaw in my logic?