| Electronic Components Datasheet Search |
|
STC12LE5616AD Datasheet(PDF) 285 Page - STCmicro Technology Co,.Ltd |
|
|
|||||||||||||||||||||||||||||
STC12LE5616AD Datasheet(HTML) 285 Page - STCmicro Technology Co,.Ltd |
|
285 / 377 page ![]() #ifdef MASTER SETB SPISS ;push high slave SS MOV A, SPDAT ;return received SPI data LCALL SEND_UART #else //for salve (receive SPI data from master and MOV SPDAT, SPDAT ; send previous SPI data to master) #endif POP PSW POP ACC RETI ;////////////////////////////////////////////////////////// ORG 0100H RESET: LCALL INIT_UART ;initial UART LCALL INIT_SPI ;initial SPI ORL AUXR, #ESPI ;enable SPI interrupt SETB EADC_SPI SETB EA MAIN: #ifdef MASTER //for master (receive UART data from PC and send it to slave, LCALL RECV_UART ; in the meantimereceive SPI data from slave and send it to PC) CLR SPISS ;pull low slave SS MOV SPDAT, A ;trigger SPI send #endif SJMP MAIN ;////////////////////////////////////////////////////////// INIT_UART: MOV SCON, #5AH ;set UART mode as 8-bit variable baudrate MOV TMOD, #20H ;timer1 as 8-bit auto reload mode MOV AUXR, #40H ;timer1 work at 1T mode MOV TL1, #0FBH ;115200 bps(256 - 18432000 / 32 / 115200) MOV TH1, #0FBH SETB TR1 RET ;////////////////////////////////////////////////////////// 285 |
|
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 |