serial peripheral interface
Serial peripheral interface #include <LPC21xx.H> void spi_data(int data) { IOCLR0 = (1 << 7); // CLEARING GPIO PIN S0SPDR = data ; while(!(S0SPSR & (1 << 7))); //CHECK STATUS , MONITOR FLAG (AFTER DATA TRANSFER THE 7TH BIT SET) IOSET0 = (1 << 7); } int main() { PINSEL0 |= (1 << 8)|(1<<10)|(1 << 12); //MISO,MOSI,SCK PINSEL0 &= ~(1 << 9)|(1<<11)|(1 << 13); //MISO,MOSI,SCK IODIR0 |= (1 << 7); //SS we are taking GPIO S0SPCR = (1 << 2)|(1 << 5); //enabling the SPI and 5 bit for master mode S0SPCCR = 8; //8,10,12,14 we can give given by manufacture (refer notes formula) while(1) { //7 SEGMENT DISPLAY CMDS spi_data(0x0C01); // 0XC00-OFF,0XC01-...