The problem is that the backpack of LED matrix has an SPI interface and i dont know what pins of LPC2124 web board must connect to the SPI input of LED matrix and lighting the LEDs from the Java application. Looking at the schematic:
The problem is that those pins are not connected to the EXT header but used to control the CS8900 Ethernet Interface. Could you please give me any idea how can i do all this project work?
It’s unfortunate and surprising that the board designers didn’t put either of the SPI channels on the expansion connector. So you’re left with having to bit-bang your own using GPIO pins that they did put on the connector. For SPI that’s not difficult, nor is it time-sensitive (so e.g. interrupts won’t cause your SPI code to fail).
Thank you for your suggestion. You mean that i must buy GPIO pins (an extra equipement)? or i can do this using jumper wires connected to specific pins on LPC? also i must develop a software to control the GPIO pins with the SPI on LED matrix?
Maybe you want to start off with something easier.
GPIO stands for General Purpose Input/Output and it means any of the pins on the microcontroller that you use the basic on/off toggling rather than use the more advanced hardware blocks for.
They are using the LPC-2124 board right there in the tutorial, so you know it can be done, you just need to investigate how they did it. I checked the source code they provide and they have bit-banged the SPI interface using GPIO like suggested.
// initialize the IO pins used to bit bang the LED matrix controller,
// we could use the hardware SPI peripheral on the ARM but we are lazy
void led_init(void){
IO1DIR |= (LED_SCK | LED_DI | LED_CS);
IO1CLR |= (LED_SCK | LED_DI);
IO1CLR |= LED_CS;
}
// this bit bangs one byte of data to the LED matrix controller
void send_led(unsigned char byte){
int i;
for (i = 0; i < 8; i++){
if (byte & (0x80 >> i))
IO1SET |= LED_DI;
else
IO1CLR |= LED_DI;
IO1SET |= LED_SCK;
IO1CLR |= LED_SCK;
}
}
thank you “TheDirty”. This code it must be sent at the matrix controller? in what way i will program matrix controller? and which pins of the LPC2124 board must connected to the RGB LED matrix SPI input?