| Electronic Components Datasheet Search |
|
MX844 Datasheet(PDF) 13 Page - IXYS Corporation |
|
|
|||||||||||||||||||||||||||||
MX844 Datasheet(HTML) 13 Page - IXYS Corporation |
|
13 / 21 page ![]() MX844 13 08/25/06 Drawing No. 084423 www.claremicronix.com MX844 IXYS /* setup the com1 port */ outp(0x3fb,0x83); /* 8 bits no parity, DLAB=1 */ outp(0x3f9,0); /* upper divisor = 0 */ /*outp(0x3f8,4);*/ /* lower divisor = 4 (28800 baud) */ outp(0x3f8,3); /* lower divisor = 3 (38400 baud) */ outp(0x3fc,1); /* DTR +V, RTS -V */ outp(0x3fb,3); /* DLAB = 0 */ /* open the output log file */ inf = fopen("meter.log","w"); /* initialize arrays */ for(i=0;i<np;i++) { ad[i] = 0; ad2[i] = 0; n[i] = 0; n2[i] = 0; } for(i=0;i<4*np;i++) d[i] = 0; /* start data acquisition from MX844 */ lost = 1; while(lost == 1) { /* synchronize to MX844 async data stream */ /* find n0,n1 = 00 and n2,n3 = 00 */ twoz = 0; while (twoz == 0) { onez = 0; /* read bytes until n0,n1 = 00 */ while (onez == 0) { w = 0; while ((inp(0x3fd) & 1) == 0) {w=1;} /*wait for data ready*/ d[0] = inp(0x3f8); if((d[0] & 0x00c0) == 0) onez = 1; } /* read the next byte */ w = 0; while ((inp(0x3fd) & 1) == 0) {w=1;} /* wait for data ready */ d[1] = inp(0x3f8); if((d[1] & 0x00c0) == 0) twoz = 1; else /* change "phase" */ { w = 0; while ((inp(0x3fd) & 1) == 0) {w=1;} /*wait for data ready*/ d[0] = inp(0x3f8); } } /* end twoz */ m=0; /* read the actual data */ for(i=2;i<4*np;i++) { w = 0; while ((inp(0x3fd) & 1) == 0) {w=1;} /*wait for data ready */ d[i] = inp(0x3f8); if(w==0) m++; /* printf("\n%02X %1d",d[i],w); */ } /* check for loss of sync in the data */ lost = 0; for(i=0;i<np;i++) { m = ((0xc0 & d[2*i])>>6)+((0xc0 & d[2*i+1])>>4); if(m != i % 8) lost = 1; } if (lost == 1) { printf("lost sync\n"); for(t=0;t<200000;t++); /* wait to try again */ } } /* done with acquisition */ |
|
|
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 |