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

PIC17LC42-16I/JW 参数 Datasheet PDF下载

PIC17LC42-16I/JW图片预览
型号: PIC17LC42-16I/JW
PDF下载: 下载PDF文件 查看货源
内容描述: 高性能8位CMOS EPROM / ROM微控制器 [High-Performance 8-Bit CMOS EPROM/ROM Microcontroller]
分类和应用: 微控制器可编程只读存储器电动程控只读存储器
文件页数/大小: 240 页 / 1141 K
品牌: MICROCHIP [ MICROCHIP ]
 浏览型号PIC17LC42-16I/JW的Datasheet PDF文件第93页浏览型号PIC17LC42-16I/JW的Datasheet PDF文件第94页浏览型号PIC17LC42-16I/JW的Datasheet PDF文件第95页浏览型号PIC17LC42-16I/JW的Datasheet PDF文件第96页浏览型号PIC17LC42-16I/JW的Datasheet PDF文件第98页浏览型号PIC17LC42-16I/JW的Datasheet PDF文件第99页浏览型号PIC17LC42-16I/JW的Datasheet PDF文件第100页浏览型号PIC17LC42-16I/JW的Datasheet PDF文件第101页  
PIC17C4X  
13.4.2 USART SYNCHRONOUS SLAVE  
13.4  
USART Synchronous Slave Mode  
RECEPTION  
The synchronous slave mode differs from the master  
mode in the fact that the shift clock is supplied exter-  
nally at the RA5/TX/CK pin (instead of being supplied  
internally in the master mode). This allows the device  
to transfer or receive data in the SLEEP mode. The  
Operation of the synchronous master and slave modes  
are identical except in the case of the SLEEP mode.  
Also, SREN is a don't care in slave mode.  
If receive is enabled (CREN) prior to theSLEEPinstruc-  
tion, then a word may be received during SLEEP. On  
completely receiving the word, the RSR will transfer the  
data to RCREG (setting RCIF) and if the RCIE bit is set,  
the interrupt generated will wake the chip from SLEEP.  
If the global interrupt is enabled, the program will  
branch to the interrupt vector (0020h).  
slave  
mode  
is  
entered  
by  
clearing  
the  
CSRC (TXSTA<7>) bit.  
13.4.1 USART SYNCHRONOUS SLAVE  
TRANSMIT  
The operation of the sync master and slave modes are  
identical except in the case of the SLEEP mode.  
Steps to follow when setting up a Synchronous Slave  
Reception:  
If two words are written to TXREG and then the SLEEP  
instruction executes, the following will occur. The first  
word will immediately transfer to the TSR and will trans-  
mit as the shift clock is supplied. The second word will  
remain in TXREG. TXIF will not be set. When the first  
word has been shifted out of TSR, TXREG will transfer  
the second word to the TSR and the TXIF flag will now  
be set. If TXIE is enabled, the interrupt will wake the  
chip from SLEEP and if the global interrupt is enabled,  
then the program will branch to interrupt vector  
(0020h).  
1. Enable the synchronous master serial port by  
setting the SYNC and SPEN bits and clearing  
the CSRC bit.  
2. If interrupts are desired, then set the RCIE bit.  
3. If 9-bit reception is desired, then set the RX9 bit.  
4. To enable reception, set the CREN bit.  
5. The RCIF bit will be set when reception is com-  
plete and an interrupt will be generated if the  
RCIE bit was set.  
6. Read RCSTA to get the ninth bit (if enabled) and  
determine if any error occurred during reception.  
Steps to follow when setting up a Synchronous Slave  
Transmission:  
7. Read the 8-bit received data by reading  
RCREG.  
1. Enable the synchronous slave serial port by set-  
ting the SYNC and SPEN bits and clearing the  
CSRC bit.  
8. If any error occurred, clear the error by clearing  
the CREN bit.  
2. Clear the CREN bit.  
3. If interrupts are desired, then set the TXIE bit.  
4. If 9-bit transmission is desired, then set the TX9  
bit.  
Note: To abort reception, either clear the SPEN  
bit, the SREN bit (when in single receive  
mode), or the CREN bit (when in continu-  
ous receive mode). This will reset the  
receive logic, so that it will be in the proper  
state when receive is re-enabled.  
5. Start transmission by loading data to TXREG.  
6. If 9-bit transmission is selected, the ninth bit  
should be loaded in TX9D.  
7. Enable the transmission by setting TXEN.  
Writing the transmit data to the TXREG, then enabling  
the transmit (setting TXEN) allows transmission to start  
sooner then doing these two events in the reverse  
order.  
Note: To terminate a transmission, either clear  
the SPEN bit, or the TXEN bit. This will  
reset the transmit logic, so that it will be in  
the proper state when transmit is  
re-enabled.  
1996 Microchip Technology Inc.  
DS30412C-page 97  
 复制成功!