欢迎访问ic37.com |
会员登录 免费注册
发布采购

PIC18LF4320-I/ML 参数 Datasheet PDF下载

PIC18LF4320-I/ML图片预览
型号: PIC18LF4320-I/ML
PDF下载: 下载PDF文件 查看货源
内容描述: 28 /40/ 44引脚高性能,增强型闪存微控制器与10位A / D和纳瓦技术 [28/40/44-Pin High-Performance, Enhanced Flash Microcontrollers with 10-Bit A/D and nanoWatt Technology]
分类和应用: 闪存微控制器和处理器外围集成电路时钟
文件页数/大小: 388 页 / 6899 K
品牌: MICROCHIP [ MICROCHIP ]
 浏览型号PIC18LF4320-I/ML的Datasheet PDF文件第202页浏览型号PIC18LF4320-I/ML的Datasheet PDF文件第203页浏览型号PIC18LF4320-I/ML的Datasheet PDF文件第204页浏览型号PIC18LF4320-I/ML的Datasheet PDF文件第205页浏览型号PIC18LF4320-I/ML的Datasheet PDF文件第207页浏览型号PIC18LF4320-I/ML的Datasheet PDF文件第208页浏览型号PIC18LF4320-I/ML的Datasheet PDF文件第209页浏览型号PIC18LF4320-I/ML的Datasheet PDF文件第210页  
PIC18F2220/2320/4220/4320  
18.3.2  
USART ASYNCHRONOUS  
RECEIVER  
18.3.3  
SETTING UP 9-BIT MODE WITH  
ADDRESS DETECT  
The receiver block diagram is shown in Figure 18-4.  
The data is received on the RC7/RX/DT pin and drives  
the data recovery block. The data recovery block is  
actually a high-speed shifter, operating at x16 times the  
baud rate, whereas the main receive serial shifter oper-  
ates at the bit rate or at FOSC. This mode would  
typically be used in RS-232 systems.  
This mode would typically be used in RS-485 systems.  
To set up an Asynchronous Reception with address  
detect enable:  
1. Initialize the SPBRG register for the appropriate  
baud rate. If a high-speed baud rate is required,  
set the BRGH bit.  
2. Enable the asynchronous serial port by clearing  
the SYNC bit and setting the SPEN bit.  
To set up an Asynchronous Reception:  
1. Initialize the SPBRG register for the appropriate  
baud rate. If a high-speed baud rate is desired,  
set bit BRGH (Section 18.2 “USART Baud  
Rate Generator (BRG)”).  
3. If interrupts are required, set the RCEN bit and  
select the desired priority level with the RCIP bit.  
4. Set the RX9 bit to enable 9-bit reception.  
5. Set the ADDEN bit to enable address detect.  
6. Enable reception by setting the CREN bit.  
2. Enable the asynchronous serial port by clearing  
bit SYNC and setting bit SPEN.  
7. The RCIF bit will be set when reception is  
complete. The interrupt will be Acknowledged if  
the RCIE and GIE bits are set.  
3. If interrupts are desired, set enable bit RCIE.  
4. If 9-bit reception is desired, set bit RX9.  
5. Enable the reception by setting bit CREN.  
8. Read the RCSTA register to determine if any  
error occurred during reception, as well as read  
bit 9 of data (if applicable).  
6. Flag bit RCIF will be set when reception is com-  
plete and an interrupt will be generated if enable  
bit RCIE was set.  
9. Read RCREG to determine if the device is being  
addressed.  
7. Read the RCSTA register to get the ninth bit (if  
enabled) and determine if any error occurred  
during reception.  
10. If any error occurred, clear the CREN bit.  
11. If the device has been addressed, clear the  
ADDEN bit to allow all received data into the  
receive buffer and interrupt the CPU.  
8. Read the 8-bit received data by reading the  
RCREG register.  
9. If any error occurred, clear the error by clearing  
enable bit CREN.  
10. If using interrupts, ensure that the GIE and PEIE  
bits in the INTCON register (INTCON<7:6>) are  
set.  
FIGURE 18-4:  
USART RECEIVE BLOCK DIAGRAM  
CREN  
FERR  
OERR  
x64 Baud Rate CLK  
÷ 64  
or  
÷ 16  
RSR Register  
MSb  
Stop  
LSb  
SPBRG  
0
7
1
Start  
(8)  
• • •  
Baud Rate Generator  
RX9  
Pin Buffer  
and Control  
Data  
Recovery  
RC7/RX/DT  
RX9D  
RCREG Register  
FIFO  
SPEN  
8
Interrupt  
RCIF  
RCIE  
Data Bus  
DS39599C-page 204  
2003 Microchip Technology Inc.  
 复制成功!