
{
max_channel = 8;
offset_val = 10.0;
full_scale = 20.0;
goto restart;
}
}
else if(c == 'm')
{
interru+;
interrupt_mode = interrupt_mode & 1;
goto restart;
}
else if(c == 'b')
{
full_count = full_count ^ 0x000f;
goto restart;
}
else
break;
}
/* Go through channel by channel displaying the current value */
for(channel = 0; channel < max_channel; +)
{
/* If we're not in interrupt mode. We must poll the channel
before displaying it's value.
*/
if(!interrupt_mode)
{
outportb(1,channel); /* Start the
conversion */
wait_complete();
/* wait for the channel to
complete */
lsb = inportb(1);
/* assemble the word result
*/
msb = inportb(2);
/* from the two byte values
read */
current_val[channel] = (msb << 8) | lsb;
if(!flag[channel])
/* If this is the first time for
this channel */
{
high_val[channel] = current_val[channel];
low_val[channel] = current_val[channel];
flag[c+;
/* Set the flag, we've don this
channel */
}
if(mode & 1)
/* If a signed mode, do the compare
correctly */
{
if((current_val[channel] ^ 0x8000) < (low_val
[channel] ^ 0x8000))
low_val[channel] = current_val[channel];
Содержание PCM-A/D-12
Страница 22: ...4 APPENDIX A PCM A D Parts Placement Guide...
Страница 23: ...5 APPENDIX B PCM A D Parts List...
Страница 26: ...6 APPENDIX C BURR BROWN ADS7806 ADS7807 Datasheet Reprint...
Страница 64: ...7 APPENDIX D PCM A D Demo Software Source Listing...
Страница 73: ...8 APPENDIX E PCM A D Schematic Diagrams...