Need some help with a program for a LED matrix.
I've recently received a 32x16 LED matrix board from Sure Electronics along with a driver card with a e PIC16F723 on it.
I thought at the time of purchase, that the software they had, would be compatible with the board, but it wasn't. This forced me to get into C-coding.
I'm sorta getting a hand of it by writing the sample program they provided with the baord, and reading up on things to understand the program.
However, I'm sorta stuck at the moment.
The board uses 4 HT1632C chips to control the LED displays. They each control a 16x8 part of the board. The board has both red and green LEDs in each pixel.
The way the chips operate, is that they have divided their 16x8 area into 32 8-bit areas. 16 for green and 16 for red.
Now, here comes the part where I'm stuck.
In this piece of code:
"j" is the definition of a column of LEDs, while SPI_DataSend() defines the pattern the LEDs light up in that column.
unsigned char i,j;
SystemInit(); //System Initialization
SetHT1632C_As3208(); //Set all HT1632s to work in 32*8 master mode
for(i=1; i<=CHIP_MAX; i++)
ChipSelect(i); //Chip select the corresponding HT1632C
AddressWriteHT1632C(0x00); //Get the selected start address of the chip
SPI_ModelConfigure(); //Open SPI mode, continuously send data to HT1632C
for(j=0; j<16; j++) //Take "0x00" as the start address, continuously write data
SPI_DataSend(0x55); //Write data as 2-digit hex number. The corresponding LEDs will light in binary code.
for(j=16; j<32; j++)
SSPCON = 0x11; //Clode SPI mode
Now, what I want to do, is to i.e. only light up the LEDs in column 5 in a "aaHex" pattern.
The problem is that no matter what i try to put in the first part of the for-loop (j=0 or j=16 etc.) it always assumes that the number i entered is the first column.
Thus, I can only light up the first column and out. I can't get it to light up only a column in the middle of the board.
Can anyone see what I'm doing wrong here, or how i can possibly solve this?
Thanks for any help :)