Intel 8XC196MC User Manual page 143

Table of Contents

Advertisement

8XC196MC, MD, MH USER'S MANUAL
2.
Set-up the stack pointer.
3.
Reset all interrupt mask registers.
— Clear INT_MASK, INT_MASK1and PI_MASK.
4.
Initialize P2.0 to function as the RXD signal.
— Set P2_DIR.0 (selects input).
— Clear P2_MODE.0 (selects LSIO function).
— Set P2_REG.0 (initializes RXD input to "1").
5.
Initialize and enable the timer; select up counting, internal clock, and prescaler disabled.
— Set T1CONTROL bits 6 and 7 (Figure 11-8 on page 11-16).
6.
Initialize the PTSCB as shown in Table 5-16.
PTSCB1
PTSVEC (H) = pointer to PTSCB2
PTSVEC (L) = pointer to PTSCB2
BAUD (H) = 01H
BAUD (L) = ) A0H
EPAREG (H) = 1FH (EPA0_TIME)
EPAREG (L) = 42H (EPA0_TIME)
PTSCON = 21H (SSIO receive mode, majority
sampling)
PTSCOUNT = 0AH (receive 8 data bits, 1 parity bit)
7.
Enable EPA0 interrupt.
— Set INT_MASK.2.
8.
Load the number of bytes to transmit into the user_defined transmit count register
(R_COUNT) and clear the user-defined reception-done flag (RXDDONE).
— LD R_COUNT, #16
— CLRB RXDDONE
9.
Select PTS service for EPA0.
— Set PTSSEL.2.
10. Set-up EPA0 to capture on falling edges.
— Set EPA0_CON.4 (Figure 11-10 on page 11-19).
5-56
Table 5-16. ASIO Receive Mode PTSCBs
Get other manuals https://www.bkmanuals.com
PTSCB2
Unused
SAMPTIME = 01H
DATA (H) = 00H (clear register to receive data)
DATA (L) = 00H (clear register to receive data)
PTSCON1 = 60H (enable odd parity)
PORTMASK = 01H (P2.0 = RXD)
PORTREG (H) = 1FH (P2_PIN)
PORTREG (L) = D6H (P2_PIn)

Advertisement

Table of Contents
loading

This manual is also suitable for:

8xc196md8xc196mh

Table of Contents