Hi Mark,
As I suspected, you can just send the 128 bytes to the two daisy chained displays.
The default code on the backpack has a deficiency, however, in that the SPI data buffer and the display buffer are one in the same.
This causes the displays to flash the value of the other display as it is shifted through.
You have to modify the backpack code to separate the two buffers. Dedicate a buffer to the SPI data and copy that data to the display buffer when CSn goes inactive, either through polling or through an interrupt.
Here is some simple flashing code (no character array) that shows the chaining.
It lights one LED and moves through all 128 pixels.
// include SPI.h
#include <SPI.h>
// Connect to "Output SPI" JP4
// DIO 10 = CSn (JP4-3)
// DIO 11 = MOSI (JP4-2)
// DIO 13 = SCK (JP4-4)
const int CSn = 10;
const int ColorRED = 1;
const int ColorGREEN = 2;
const int pixels = 128;
void setup()
{
pinMode (CSn, OUTPUT);
SPI.begin();
SPI.setClockDivider(SPI_CLOCK_DIV128);
SPI.setDataMode(SPI_MODE0);
}
void loop()
{
SetLED(ColorRED);
delay(150);
SetLED(ColorGREEN);
delay(150);
}
void SetLED(int color)
{
static int pixel = 0;
digitalWrite(CSn,LOW);
delay(1);
for (int bytenum = 0; bytenum < pixels; bytenum++)
if (bytenum == pixel)
SPI.transfer(color);
else
SPI.transfer(0);
pixel = (pixel + 1) % pixels;
delay(1);
digitalWrite(CSn,HIGH);
}
Let me know if you want some help on the backpack code. I’ll have to dig out my AVR programmer and environment.
Jim