STANDARD AND PTS INTERRUPTS

5.6.5.3A/D Scan Mode Example 2

Table 5-11 sets up a series of ten PTS cycles, each of which reads a single A/D channel and stores the result in a single location (3002H). The UPDT bit (PTSCON.3) is cleared so that original con- tents of PTSPTR1 are restored after the cycle. The command/data table is shown in Table 5-10.

Table 5-10. Command/Data Table (Example 2)

Address

 

Contents

 

 

 

3002H

 

AD_RESULT for ACHx

 

 

 

 

3000H

Unused

 

AD_COMMAND for ACHx

 

 

 

 

Table 5-11. A/D Scan Mode PTSCB (Example 2)

Unused

Unused

PTSPTR2 (H) = 1FH

PTSPTR2 (L) = AAH

PTSPTR1 (H) = 30H

PTSPTR1 (L) = 00H

PTSCON = C3H (Mode = 110, UPDT = 0)

PTSCOUNT = 0AH

Software starts a conversion on channel x. When the conversion is finished and the A/D conver- sion complete interrupt is generated, the A/D scan mode routine begins. The PTS reads the com- mand in location 3000H and stores it in a temporary location. Then it increments PTSPTR1 twice and stores the value of the AD_RESULT register in location 3002H. The final step is to copy the conversion command from the temporary location to the AD_COMMAND register. The CPU could process or move the conversion results data from the table before the next conversion com- pletes and a new PTS cycle begins. When the next cycle begins, PTSPTR1 again points to 3000H and the repeats the events of the first cycle. The value of the AD_RESULT register is written to location 3002H and the command at location 3000H is re-executed.

5.6.6Serial I/O Modes

The 8XC196MH has a two-channel serial I/O port. The 8XC196MC and MD have no serial I/O ports, but the serial I/O modes of the PTS provide a software serial I/O channel for both synchro- nous and asynchronous transfers and receptions. There are four basic modes of operation: syn- chronous transmit, synchronous receive, asynchronous transmit, and asynchronous receive. A standard I/O port signal is configured to function as either the transmit data (TXD) or receive data (RXD) signal and an EPA channel sets the baud rate. You may configure any port 2 signal (MC and MD) or P7.3:0 (MD) as TXD or RXD. In the synchronous modes, an EPA channel can either generate the serial clock (SCK) signal or input an external clock signal. Up to 16 bits may be

5-37

Page 124
Image 124
Intel 8XC196MH Serial I/O Modes, 5.3 A/D Scan Mode Example, Command/Data Table Example, 11. A/D Scan Mode Ptscb Example