Intel 8XC196NT User Manual page 133

Table of Contents

Advertisement

8XC196NT USER'S MANUAL
PTS A/D Scan Mode Control Block (Continued)
PTSCOUNT
PTSCB + 0
Figure 5-14. PTS Control Block – A/D Scan Mode (Continued)
To use the A/D scan mode, you must first set up a command/data table in memory (Table 5-7).
The command/data table contains A/D commands that are interleaved with blank memory loca-
tions. The PTS stores the conversion results in these blank locations. Only the amount of available
memory limits the table size; it can reside in internal or external RAM.
XXXX + AH
XXXX + 8H
XXXX + 6H
XXXX + 4H
XXXX + 2H
Write 0000H to prevent a new conversion at the end of the
routine.
††
Result of the A/D conversion that initiated the PTS routine.
To initiate A/D scan mode, enable the A/D conversion complete interrupt and assign it to the PTS.
Software must initiate the first conversion. When the A/D finishes the first conversion and gen-
erates an A/D conversion complete interrupt, the interrupt vectors to the PTSCB and initiates the
A/D scan routine. The PTS stores the conversion results, loads a new command into
AD_COMMAND, and then decrements the number in PTSCOUNT. As each additional conver-
sion complete interrupt occurs, the PTS repeats the A/D scan cycle; it stores the conversion re-
sults, loads the next conversion command into the AD_COMMAND register, and decrements
PTSCOUNT. The routine continues until PTSCOUNT decrements to zero. When this occurs,
hardware clears the enable bit in the PTSSEL register, which disables PTS service, and sets the
PTSSRV bit, which requests an end-of-PTS interrupt. The interrupt service routine could process
the conversion results and then re-enable PTS service for the A/D conversion complete interrupt.
Because the lower six bits of the AD_RESULT register contain status information, the end-of-
PTS interrupt service routine could shift the results data to the right six times to leave only the
conversion results in the memory locations. See AP-445, 8XC196KR Peripherals: A User's Point
of View, for application examples with code.
5-28
Consecutive A/D Conversions
Defines the number of A/D conversions that will be completed during the
A/D scan routine. Each cycle consists of the PTS transferring the A/D
conversion results into the command/data table, and then loading a new
command into the AD_COMMAND register. Maximum number is 255.
Table 5-7. A/D Scan Mode Command/Data Table
Address
Unused
Unused
XXXX
Unused
Contents
A/D Result 2
A/D Command 3
A/D Result 1
A/D Command 2
††
A/D Result 0
A/D Command 1

Advertisement

Table of Contents
loading

Table of Contents