if(!interrupt_mode)
outportb(0x21,inportb(0x21) | IRQ_MASK);
else
{
outportb(0x21,inportb(0x21) & ~IRQ_MASK);
outportb(1,channel_number); /* Jump start the background task
*/
}
/* This loop runs until we exit or until we change modes */
while(1)
{
if(kbhit())
{
/* If a kestroke detected, see what is is and handle it
accordingly.
The keys recognized are :
r - reset deviation values.
t - toggle voltage mode.
m - toggle betweent interrupt and polled mode.
*/
c = getch();
if(c == 'r')
{
for(channel = 0; channel < max_channel; +)
flag[channel] = 0;
}
else if(c == 't')
{
mode++;
mode = mode & 3;
if(mode == 0)
/* 0-5V Single-Ended */
{
max_channel = 16;
offset_val = 0.0;
full_scale = 5.0;
goto restart;
}
if(mode == 1)
/* +-10V Single Ended */
{
max_channel = 16;
offset_val = 10.0;
full_scale = 20.0;
goto restart;
}
if(mode == 2) /* 0-5V Differential */
{
max_channel = 8;
offset_val = 0.0;
full_scale = 5.0;
goto restart;
}
if(mode == 3) /* +-10V differential */
Содержание 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...