?? pe51fx.rd1
字號:
#Serial 80C52 600#
#Serial 80C54 600#
#Serial 80C58 600#
#Serial 80C51FA 600#
#Serial 80C51FB 600#
#Serial 80C51FC 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 80C52 601#
#Serial 80C54 601#
#Serial 80C58 601#
#Serial 80C51FA 601#
#Serial 80C51FB 601#
#Serial 80C51FC 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 80C52 602#
#Serial 80C54 602#
#Serial 80C58 602#
#Serial 80C51FA 602#
#Serial 80C51FB 602#
#Serial 80C51FC 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 80C52 603#
#Serial 80C54 603#
#Serial 80C58 603#
#Serial 80C51FA 603#
#Serial 80C51FB 603#
#Serial 80C51FC 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 80C52 703#
#Serial 80C54 703#
#Serial 80C58 703#
#Serial 80C51FA 703#
#Serial 80C51FB 703#
#Serial 80C51FC 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 80C52 700#
#Serial 80C54 700#
#Serial 80C58 700#
#Serial 80C51FA 700#
#Serial 80C51FB 700#
#Serial 80C51FC 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 80C52 701#
#Serial 80C54 701#
#Serial 80C58 701#
#Serial 80C51FA 701#
#Serial 80C51FB 701#
#Serial 80C51FC 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 80C52 202#
#Serial 80C52 203#
#Serial 80C54 202#
#Serial 80C54 203#
#Serial 80C58 202#
#Serial 80C58 203#
#Serial 80C51FA 202#
#Serial 80C51FA 203#
#Serial 80C51FB 202#
#Serial 80C51FB 203#
#Serial 80C51FC 202#
#Serial 80C51FC 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 80C52 502#
#Serial 80C54 502#
#Serial 80C58 502#
#Serial 80C51FA 502#
#Serial 80C51FB 502#
#Serial 80C51FC 502#
Enable Transmitt by clearing REN bit in SCON.4.
#Serial 80C52 503#
#Serial 80C54 503#
#Serial 80C58 503#
#Serial 80C51FA 503#
#Serial 80C51FB 503#
#Serial 80C51FC 503#
Enable Reception by setting the REN bit in SCON.4.
#Serial 80C52 300#
#Serial 80C54 300#
#Serial 80C58 300#
#Serial 80C51FA 300#
#Serial 80C51FB 300#
#Serial 80C51FC 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 80C52 301#
#Serial 80C54 301#
#Serial 80C58 301#
#Serial 80C51FA 301#
#Serial 80C51FB 301#
#Serial 80C51FC 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 80C52 104#
#Serial 80C54 104#
#Serial 80C58 104#
#Serial 80C51FA 104#
#Serial 80C51FB 104#
#Serial 80C51FC 104#
#Serial 80C52 110#
#Serial 80C54 110#
#Serial 80C58 110#
#Serial 80C51FA 110#
#Serial 80C51FB 110#
#Serial 80C51FC 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 + -