Developing Olimex LPC2124-RGB LED matrix

Hi

Im going to develop the LED matrix tutorial. Here is the url of tutorial:

http://www.sparkfun.com/commerce/tutori … id=44&page

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:

http://www.olimex.com/dev/images/lpc-e2124-sch.gif

i found those pins:

P0.4/SCK0/CAP0.1 - 27 - SA0

P0.6/MOSI0/CAP0.2 - 30 - SA2

P0.7/SSEL0/PWM2/EINT - 31 - SA3

and

P0.17/CAP1.2/SCK1/MAT1.2 - 47 - SD1

P0.19/MAT1.2/MOSI1/CAP1.2 - 54 -SD3

P0.20/MAT1.3/SSEL1/EINT3 - 55 - SD4

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?

Thanks a lot!!!

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?