| Electronic Components Datasheet Search |
|
AN1816 Datasheet(PDF) 21 Page - Freescale Semiconductor, Inc |
|
|
|||||||||||||||||||||||||||||
AN1816 Datasheet(HTML) 21 Page - Freescale Semiconductor, Inc |
|
21 / 24 page ![]() AN1816 21 Appendix 1 - Source Code SpiBurst(2); while ((RBytes[1] & 0x01) == 0) { SpiBurst(2); } } /* This function programs the address into the first slave node (no response is expected ) */ void PgmAddr(int Addr) { TFFlag(Addr); /* Check TFNF0 flag is set */ TBytes[0] = 0x80; /* send 80 (write cmd to DSI0H) receive 00 */ TBytes[1] = Addr; /* Pgm Addr cmd into DSI0H then TBytes[2] is DSI0L */ TBytes[2] = 0x00; SpiBurst(3); RFFlag(); } /* This function programs the addresses into slave nodes 2 through to 15 and checks the responses from slave nodes 1 to 14 */ void PgmChk(int Addr, int LastAddr) { unsigned short DsiDat; unsigned short DsiChk; int dummy=0; TFFlag(Addr); /* Check TFNF0 flag is set */ TBytes[0] = 0x80; /* send 80 (write cmd to DSI0H) */ TBytes[1] = Addr; /* Pgm Addr cmd written into DSI0H & DSI0L */ TBytes[2] = 0x00; SpiBurst(3); RFFlag(); /* CRC Check */ if (RBytes[1] & 0x08) { FlagError(4,LastAddr); for (;;); /* error - loop until device is reset */ } TBytes[0] = 0x00; /* Read DSI0H and DSI0L */ SpiBurst(3); DsiDat = RBytes[1] | 0x0000; /* Now shift DsiDat 8 times */ DsiDat <<= 8; DsiDat = DsiDat+RBytes[2]; /* Now need to check the response ie that bits[15:12] = Prev. Slave Addr */ DsiDat >>= 12; DsiChk = LastAddr | 0x0000; if (DsiDat != DsiChk) { Freescale Semiconductor, Inc. For More Information On This Product, Go to: www.freescale.com |
|
|
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 |