| 数据搜索系统,热门电子元器件搜索 |
|
APFCON 数据表(PDF) 172 Page - Microchip Technology |
|
|
|||||||||||||||||||||||||||||
APFCON 数据表(HTML) 172 Page - Microchip Technology |
|
172 / 222 page ![]() MCP19111 DS22331A-page 172 2013 Microchip Technology Inc. 27.5.7 I2C MASTER MODE RECEPTION Master mode reception is enabled by programming the Receive Enable bit, RCEN bit of the SSPCON2 register. The Baud Rate Generator begins counting and on each rollover, the state of the SCL pin changes (high-to- low/low-to-high) and data is shifted into the SSPSR. After the falling edge of the eighth clock, the receive enable flag is automatically cleared, the contents of the SSPSR are loaded into the SSPBUF, the BF flag bit is set, the SSPIF flag bit is set and the Baud Rate Gener- ator is suspended from counting, holding SCL low. The MSSP is now in Idle state awaiting the next command. When the buffer is read by the CPU, the BF flag bit is automatically cleared. The user can then send an Acknowledge bit at the end of reception by setting the Acknowledge Sequence Enable, ACKEN bit of the SSPCON2 register. 27.5.7.1 BF Status Flag In receive operation, the BF bit is set when an address or data byte is loaded into SSPBUF from SSPSR. It is cleared when the SSPBUF register is read. 27.5.7.2 SSPOV Status Flag In receive operation, the SSPOV bit is set when 8 bits are received into the SSPSR and the BF flag bit is already set from a previous reception. 27.5.7.3 WCOL Status Flag If the user writes the SSPBUF when a receive is already in progress (i.e., SSPSR is still shifting in a data byte), the WCOL bit is set and the contents of the buffer are unchanged (the write does not occur). 27.5.7.4 Typical Receive Sequence: 1. The user generates a Start condition by setting the SEN bit of the SSPCON2 register. 2. SSPIF is set by hardware on completion of the Start. 3. SSPIF is cleared by software. 4. The user writes SSPBUF with the slave address to transmit and the R/W bit set. 5. Address is shifted out the SDA pin until all 8 bits are transmitted. Transmission begins as soon as SSPBUF is written to. 6. The MSSP module shifts in the ACK bit from the slave device and writes its value into the ACKSTAT bit of the SSPCON2 register. 7. The MSSP module generates an interrupt at the end of the 9th clock cycle by setting the SSPIF bit. 8. User sets the RCEN bit of the SSPCON2 register and the Master clocks in a byte from the slave. 9. After the 8th falling edge of SCL, SSPIF and BF are set. 10. Master clears SSPIF and reads the received byte from SSPUF, clears BF. 11. Master sets ACK value sent to slave in ACKDT bit of the SSPCON2 register and initiates the ACK by setting the ACKEN bit. 12. Masters ACK is clocked out to the Slave and SSPIF is set. 13. The user clears SSPIF. 14. Steps 8–13 are repeated for each received byte from the slave. 15. Master sends a not ACK or Stop to end communication. Note: The MSSP module must be in an Idle state before the RCEN bit is set, or the RCEN bit will be disregarded. |
|
链接网址 |
| ALLDATASHEET是否为您带来帮助? [ DONATE ] |
关于 Alldatasheet | 广告服务 | 联系我们 | 隐私政策 | 数据表链接 | 链接交换 | 制造商名单 All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |