mpc82g516a Megawin Technology, mpc82g516a Datasheet - Page 63

no-image

mpc82g516a

Manufacturer Part Number
mpc82g516a
Description
8-bit Microcontroller
Manufacturer
Megawin Technology
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
mpc82g516aE
Manufacturer:
MEGAWIN
Quantity:
1 200
Part Number:
mpc82g516aF
Manufacturer:
MEGAWIN
Quantity:
20 000
13 Secondary UART (UART2)
The MPC82G516A is equipped with a secondary UART (hereafter, called UART2), which also has four operation
modes the same as the first UART except the following differences:
(1) The UART2 has no enhanced functions: Framing Error Detection and Auto Address Recognition.
(2) The UART2 use the dedicated Baud Rate Timer as its Baud Rate Generator.
(3) The UART2 uses port pin P1.3 (S2TXD) and P1.2 (S2RXD) for transmit and receive, respectively.
These two UARTs can be operated simultaneously in identical or different modes and communication speeds.
13.1 UART2 Related Registers
The following special function registers are related to the operation of the UART2:
S2CON (Address=AAH, UART2 Control Register, Reset Value=0000,0000B)
S2SM0: UART2 Mode Select Bit 0.
S2SM1: UART2 Mode Select Bit 1.
Where,
S2SM2: Enables the multiprocessor communication feature in Modes 2 or 3. If SM2=1 then Rl will not be set
unless the received 9th data bit (RB8) is ‘1’, indicating an address, and the received byte is a Given or Broadcast
Address. In Mode 1, if SM2=1 then Rl will not be activated unless a valid stop bit was received, and the received
byte is a Given or Broadcast Address. In Mode 0, SM2 should be ‘0’.
S2REN: Enables serial reception. Set by software to enable reception. Cleared by software to disable reception.
S2TB8: The 9th data bit that will be transmitted in Modes 2 and 3. Set or cleared by software as desired.
S2RB8: In modes 2 and 3, the 9th data bit that was received. In Mode 1, if SM2=0, RB8 is the stop bit that was
received. In Mode 0, RB8 is not used.
S2Tl: Transmit interrupt flag. Set by hardware at the end of the 8th bit time in Mode 0, or at the beginning of the
stop bit in the other modes, in any serial transmission. Must be cleared by software.
S2Rl: Receive interrupt flag. Set by hardware at the end of the 8th bit time in Mode 0, or halfway through the stop
bit time in the other modes, in any serial reception (except see SM2). Must be cleared by software.
S2BUF (Address=9AH, UART2 Serial Data Buffer, Reset Value=xxH)
S2BRT (Address=BAH, UART2 Baud Rate Timer Reload Register, Reset Value=00H)
AUXR2 (Address=A6H, Auxiliary Register 2, Reset Value=0000,0000B)
S2TR: UART2 Baud Rate Timer control bit. Set/clear to turn on/off, respectively.
S2SMOD: UART2 double baud rate enable bit. When set, the baud rate is doubled.
S2TX12: UART2 Baud Rate Timer clock source select. Set to select Fosc, and clear to select Fosc/12.
S2CKOE: Set to enable the clock output of UART2 Baud Rate Timer on P3.5.
63
S2SM0
S2SM0 S2SM1
T0X12
(D7)
7
7
7
7
0
0
1
1
Fosc
S2SM1
T1X12
0
1
0
1
is the system clock frequency.
(D6)
6
6
6
6
URM0X6
S2SM2
Mode
(D5)
0
1
2
3
5
5
5
5
(Baud Rate Timer Reload Value)
Description
Shift Register
8-bit UART
9-bit UART
9-bit UART
S2REN
S2TR
(D4)
4
4
4
4
MPC82G516A Data Sheet
S2SMOD S2TX12 S2CKOE
S2TB8
(D3)
3
3
3
3
Baud Rate
Fosc/12
Variable
Fosc/64 or Fosc/32
Variable
S2RB8
(D2)
2
2
2
2
S2TI
(D1)
1
1
1
1
T0CKOE
S2RI
(D0)
0
0
0
0
MEGAWIN

Related parts for mpc82g516a