
NOTE:
In Dif fer en tial mode, valid chan nels are still 0-7, how ever,
the chan nels are paired, evens with odds. (I.E. 0 with 1, 2 with 3,
etc.) The chan nel read be comes the “+” leg for the read ing.
Ex am ple:
Chan nel 0 is 1.500 Volts lower than chan nel 1.
Mode is 2.
Chan nel read is 1.
Re sult: 1228(d) = 4CC(h).
If chan nel 0 had been read, the re sult would be zero.
*/
int get conv(int ch,int mode)
{
un signed int a,b,c;
convi=0;
mode &= 3;
outp(0x100,ch|(mode<< 3));
ticks[0] = 2;
while(ticks[0] && (inp(0x104) & 0x80));
if(ticks[0] == 0)
{
_set text po si tion(22,1);
printf(“Busy is stuck.\n”);
}
if(convi == 0)
{
_set text po si tion(23,1);
printf(“In ter rupt Failed\n”);
}
a = inp(0x100) & 255;
b = inp(0x101) & 15;
c = (b<8) | a;
re turn(c);
}
/* Timer Tick In ter rupt */
void in ter rupt Int1c(void)
{
int a;
for(a=0; a; a++)
{
if(ticks[a] 0)
ticks[a]—;
}
}
/* A2D In ter rupt from PC/104 */
void in ter rupt Int0d(void)
{
convi++;
/* Used by test. */
980723
OPERATIONS MANUAL PCM-AIO
Page 2-9
WinSystems - "The Embedded Systems Authority"
Summary of Contents for PCM-AIO
Page 21: ...5 APPENDIX A MAX180 DATASHEET REPRINT ...
Page 22: ......
Page 23: ......
Page 24: ......
Page 25: ......
Page 26: ......
Page 27: ......
Page 28: ......
Page 29: ......
Page 30: ......
Page 31: ......
Page 32: ......
Page 33: ......
Page 34: ......
Page 35: ......
Page 36: ......
Page 37: ......
Page 38: ......
Page 39: ......
Page 40: ......
Page 41: ......