![VersaLogic VL-12CT96 Скачать руководство пользователя страница 46](http://html.mh-extra.com/html/versalogic/vl-12ct96/vl-12ct96_reference-manual_1006747046.webp)
5-2
VL-12CT96/7 Analog & Digital I/O Card
Interrupt Mode Analog Input
Interrupt mode eliminates the need to repeatedly poll the STATUS register for Done status. This frees
up the CPU to execute unrelated code while the VL-12CT96/7 is busy with an A/D conversion. This
is especially useful when using long settling delays. Another use for interrupts is for handling auto
triggered applications.
Interrupt Mode Steps
• Interrupt Service Routine
• Initialize VL-12CT96/7 for interrupt mode
• Initialize VL-12CT96/7 for Auto-trigger (if desired)
• Initialize interrupt controller
• Initialize CPU to receive interrupt
• Channel selection
• Initialize VL-12CT96/7 for Auto-increment (if desired)
• Trigger A/D conversion
Interrupt Service Routine
The interrupt service routine reads A/D conversion results from the VL-12CT96/7 and stores the data
somewhere. Data is input from the ADCLO register first, followed by the ADCHI register. A word-
wide input instruction from the ADCLO register (in ax,dx) will fetch data from both registers in the
proper sequence. Reading the ADCHI register clears the interrupt request.
The interrupt service routine can be written to select a different channel or trigger a new conversion.
Initialize VL-12CT96/7 for interrupt mode
Set bit D0 in the CONTROL register. See page 4-2 for further information.
Initialize VL-12CT96/7 for Auto-trigger (if desired)
Set bit D3 in the CONTROL register. See page 4-2 for further information.
Auto-trigger mode is optional when using interrupts. Use it when you want to perform a continuous
stream of analog input conversions. Auto-trigger mode eliminates the CPU overhead of writing to the
CONVERT register.
Initialize interrupt controller
This involves setting up interrupt vector registers, priority, and unmasking. See your interrupt
controller instruction manual for further information.
Initialize CPU to receive interrupts
This involves preparing the interrupt vector table, and enabling interrupts. See your CPU instruction
manual for further information.
Channel selection
Output the desired channel number to the SELECT register. See page 4-4 for further information.
Operation — Analog Input
Содержание VL-12CT96
Страница 2: ...ii VL 12CT96 7 Analog Digital I O Card ...
Страница 26: ...2 20 VL 12CT96 7 Analog Digital I O Card ...
Страница 32: ...3 6 VL 12CT96 7 Analog Digital I O Card ...
Страница 62: ...7 4 VL 12CT96 7 Analog Digital I O Card ...
Страница 65: ...VL 12CT96 7 Analog Digital I O Card 8 3 VL 12CT96 7 Parts Placement Reference ...