?? pe251.rd1
字號:
#Serial 80C251S? 600#
Serial Port Mode 0.
Serial data enters and exits through RXD. TXD outputs the shift clock.
8 bits are transmited/received: 8 data bits (LSB first).
The baud rate is fixed at 1/12 the oscillator frequency.
The mode is set in SCON.6 - SCON.7
#Serial 80C251S? 601#
#Serial 80C151S? 601#
Serial Port Mode 1.
10 bits are transmited (through TXD) or received (through RXD); a
start bit (0), 8 data bits(LSB first), and a stop bit (1).
On receive, the stop bit goes into RB8 in SFR SCON.
The baud rate is variable
The mode is set in SCON.6 - SCON.7
#Serial 80C251S? 602#
#Serial 80C151S? 602#
Serial Port Mode 2.
11 bits are transmited (through TXD) or received (through RXD); a
start bit (0), 8 data bits(LSB first),a programmable 9th data bit,
and a stop bit (1).
On Transmit, the 9th data bit(TB8 IN SCON) can be assigned the value of 0
or 1. On receive, the 9th data bit goes into RB8 in SCON, while the stop bit
is ignored. (The validity of the stop bit can be checked with Framing
Error Detection.) Similar to Mode 3 except baud rate.
The baud rate is programmable to either 1/32 or 1/64 the oscillator frequency.
The mode is set in SCON.6 - SCON.7
#Serial 80C251S? 603#
#Serial 80C151S? 603#
Serial Port Mode 3.
11 bits are transmited (through TXD) or received (through RXD); a
start bit (0), 8 data bits(LSB first),a programmable 9th data bit,
and a stop bit (1).
On Transmit, the 9th data bit(TB8 IN SCON) can be assigned the value of 0
or 1. On receive, the 9th data bit goes into RB8 in SCON, while the stop bit
is ignored. (The validity of the stop bit can be checked with Framing
Error Detection.) Similar to Mode 2 except baud rate.
The baud rate is variable.
The mode is set in SCON.6 - SCON.7
#Serial 80C251S? 703#
#Serial 80C151S? 703#
Serial Port Interrupt.
The serial port interrupt is generated by the logical OR of bits
RI and TI in register SCON. Neither of these flags are cleared
by hardware when the service rountine is vectored to. The service
rountine will normally have to determine whether it was RI or TI that
generated the interrupt, and the bit will have to be cleared in software.
The Serial Port Interrupt enables ES in the IE register.
#Serial 80C251S? 700#
#Serial 80C151S? 700#
Framing Error Dtection.
Allows the serial port to check for valid stop bits in modes 1, 2, or 3.
A missing stop bit can be caused, for example, by noise on the serial lines,
or transmission by two CPUs simultaneously. Once set the FE bit miust be cleared by software.
A valid stop bit will not clear FE. The FE is located in SCON and shares the same bit
as SMO. Control bit (SMOD) in the PCON register determines whether SMO or FE is accessed.
#Serial 80C251S? 701#
#Serial 80C151S? 701#
Automatic Address Recognition.
Reduces the CPU time required to service the serial port. With
this feature enabled in one of the 9-bit modes, the Receive
Interrupt flag will only get set when the received byte corresponds to
either a Given or Broadcast address.
#Serial 80C251S? 202#
#Serial 80C151S? 202#
#Serial 80C251S? 203#
#Serial 80C151S? 203#
The 9th data bit allows the controller to distinguish between address and data bytes.
The 9th data byte is set to 1 for address bytes and set to 0 for
data bytes. When receiving, the 9th data bit goes into RB8 in SCON.
When transmitting, TB8 is set or cleared in software.
#Serial 80C251S? 502#
#Serial 80C151S? 502#
Enable Transmitt by clearing REN bit in SCON.4.
#Serial 80C251S? 503#
#Serial 80C151S? 503#
Enable Reception by setting the REN bit in SCON.4.
#Serial 80C251S? 300#
#Serial 80C151S? 300#
Internal Clock Source.
This option selects an internal clock source for the baud-rate generator.
When an internal clock source is selected, the XTAL1 input signal (Fosc)
becomes the clock input to the baud-rate generator.
#Serial 80C251S? 301#
#Serial 80C151S? 301#
External Clock.
This option selects an external clock source for the baud-rate generator.
When an external clock source is selected, the external signal on the T1CLK pin
or T2CLK pin becomes the clock input into the baud-rate generator.
#Serial 80C251S? 104#
#Serial 80C151S? 104#
#Serial 80C251S? 110#
#Serial 80C151S? 110#
Serial Port Baud Rate
When Timer 1 is used as the baud rate generator, the baud rates in Modes 1 and 3
are determined by the Timer 1 overflow rate and the value of SMOD1 in Special
Function Register PCON. as follows:
Baud Rate = 2^SMOD1
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -