| Electronic Components Datasheet Search |
|
STC12LE5616AD Datasheet(PDF) 291 Page - STCmicro Technology Co,.Ltd |
|
|
|||||||||||||||||||||||||||||
STC12LE5616AD Datasheet(HTML) 291 Page - STCmicro Technology Co,.Ltd |
|
291 / 377 page ![]() MAIN: #ifdef MASTE //for master (receive UART data from PC and send it to slave, in the meantime LCALL RECV_UART ; receive SPI data from slave and send it to PC) LCALL SPI_SWAP LCALL SEND_UART #else //for salve (receive SPI data from master and LCALL SPI_SWAP ; send previous SPI data to master) #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 ;////////////////////////////////////////////////////////// INIT_SPI: MOV SPDAT, #0 ;initial SPI data MOV SPSTAT, #SPIF | WCOL ;clear SPI status #ifdef MASTER MOV SPCTL, #SPEN | MSTR ;master mode #else MOV SPCTL, #SPEN ;slave mode #endif RET ;////////////////////////////////////////////////////////// SEND_UART: JNB TI, $ ;wait pre-data sent CLR TI ;clear TI flag MOV SBUF, A ;send current data RET ;////////////////////////////////////////////////////////// 291 |
|
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 |