3216 Bicolor LED 3mm (5mm) Dot Matrix Display Information Board
2004-2009 Sure Electronics Inc.
DE-DP14112&DE-DP14211_Ver1.1_Page 17
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<32; j++) //Take “0x00” as the start address, continuously
write data
{
SPI_DataSend(0xaa); //Write data as 0xaa
}
SSPCON = 0x11; //Close SPI mode
}
while(1);
}
//**************************************************************************************************
//Function Name: system initialization
//Function Feature: set corresponding data reading and writing of PORTB and PORTC
//Input Argument: void
//Output Argument: void
//**************************************************************************************************
void SystemInit(void)
{
IRCF1 = 1;
IRCF0 = 0; //Set the frequency of the internal oscillator as 8MHz
OSCTUNE = 0x1f; //Oscillator at the maximum frequency
ANSELB = 0x00; //PORTB as a digital I/O port
TRISB = 0x00; //PORTB as an output port
PORTB = 0x00; //Clear PORTB output (PORTB’s status is uncertain after
power-on reset)
TRISC0 = 1; //PORTC0 (SW1 port) as an input port
TRISC1 = 1; //PORTC1 (SW2 port) as an input port
TRISC3 = 0; //PORTC3 (CLK signal) as an output port
TRISC5 = 0; //PORTC5 (DATA signal) as an output port
T0IE = 0; //Turn off interruption of timer0
}
//**************************************************************************************************
//Function Name: SetHT1632C_As3208
//Function Feature: write basic configuration to HT1632C in command words
//Input Argument: void
//Output Argument: void
//**************************************************************************************************
void SetHT1632C_As3208(void)