| Electronic Components Datasheet Search |
|
STC12LE5616AD Datasheet(PDF) 282 Page - STCmicro Technology Co,.Ltd |
|
|
|||||||||||||||||||||||||||||
STC12LE5616AD Datasheet(HTML) 282 Page - STCmicro Technology Co,.Ltd |
|
282 / 377 page ![]() void InitUart(); void InitSPI(); void SendUart(BYTE dat); //send data to PC BYTE RecvUart(); //receive data from PC /////////////////////////////////////////////////////////// void main() { InitUart(); //initial UART InitSPI(); //initial SPI AUXR |= ESPI; EADC_SPI = 1; EA = 1; while (1) { #ifdef MASTER //for master (receive UART data from PC and send it to slave, //in the meantime receive SPI data from slave and send it to PC) ACC = RecvUart(); SPISS = 0; //pull low slave SS SPDAT = ACC; //trigger SPI send #endif } } /////////////////////////////////////////////////////////// void spi_isr() interrupt 5 using 1 //SPI interrupt routine 5 (002BH) { SPSTAT = SPIF | WCOL; //clear SPI status #ifdef MASTER SPISS = 1; //push high slave SS SendUart(SPDAT); //return received SPI data #else //for salve (receive SPI data from master and SPDAT = SPDAT; // send previous SPI data to master) #endif } /////////////////////////////////////////////////////////// 282 |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |