Electronic Components Datasheet Search
  New Zealand  ▼
ALLDATASHEET.CO.NZ

X  

AN1816 Datasheet(PDF) 21 Page - Freescale Semiconductor, Inc

Part # AN1816
Description  USING THE HC912B32 TO IMPLEMENT THE DISTRIBUTED SYSTEMS INTERFACE (DSI) PROTOCOL
PDF  24 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  FREESCALE [Freescale Semiconductor, Inc]
Direct Link  http://www.freescale.com
Logo FREESCALE - Freescale Semiconductor, Inc

AN1816 Datasheet(HTML) 21 Page - Freescale Semiconductor, Inc

Back Button AN1816 Datasheet HTML 16Page - Freescale Semiconductor, Inc AN1816 Datasheet HTML 17Page - Freescale Semiconductor, Inc AN1816 Datasheet HTML 18Page - Freescale Semiconductor, Inc AN1816 Datasheet HTML 19Page - Freescale Semiconductor, Inc AN1816 Datasheet HTML 20Page - Freescale Semiconductor, Inc AN1816 Datasheet HTML 21Page - Freescale Semiconductor, Inc AN1816 Datasheet HTML 22Page - Freescale Semiconductor, Inc AN1816 Datasheet HTML 23Page - Freescale Semiconductor, Inc AN1816 Datasheet HTML 24Page - Freescale Semiconductor, Inc  
Zoom Inzoom in Zoom Outzoom out
 21 / 24 page
background image
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



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24


Datasheet Download

Go To PDF Page


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


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
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