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

PIC18F24J10-I/SO 参数 Datasheet PDF下载

PIC18F24J10-I/SO图片预览
型号: PIC18F24J10-I/SO
PDF下载: 下载PDF文件 查看货源
内容描述: 28 /40/ 44引脚高性能, RISC微控制器 [28/40/44-Pin High-Performance, RISC Microcontrollers]
分类和应用: 微控制器
文件页数/大小: 368 页 / 5652 K
品牌: MICROCHIP [ MICROCHIP ]
 浏览型号PIC18F24J10-I/SO的Datasheet PDF文件第180页浏览型号PIC18F24J10-I/SO的Datasheet PDF文件第181页浏览型号PIC18F24J10-I/SO的Datasheet PDF文件第182页浏览型号PIC18F24J10-I/SO的Datasheet PDF文件第183页浏览型号PIC18F24J10-I/SO的Datasheet PDF文件第185页浏览型号PIC18F24J10-I/SO的Datasheet PDF文件第186页浏览型号PIC18F24J10-I/SO的Datasheet PDF文件第187页浏览型号PIC18F24J10-I/SO的Datasheet PDF文件第188页  
PIC18F45J10 FAMILY  
16.4.10 I2C MASTER MODE  
TRANSMISSION  
The user should verify that the WCOL is clear after  
each write to SSPxBUF to ensure the transfer is  
correct. In all cases, WCOL must be cleared in  
software.  
Transmission of a data byte, a 7-bit address or the  
other half of a 10-bit address is accomplished by simply  
writing a value to the SSPxBUF register. This action will  
set the Buffer Full flag bit, BF, and allow the Baud Rate  
Generator to begin counting and start the next trans-  
mission. Each bit of address/data will be shifted out  
onto the SDAx pin after the falling edge of SCLx is  
asserted (see data hold time specification  
parameter 106). SCLx is held low for one Baud Rate  
Generator rollover count (TBRG). Data should be valid  
before SCLx is released high (see data setup time  
specification parameter 107). When the SCLx pin is  
released high, it is held that way for TBRG. The data on  
the SDAx pin must remain stable for that duration and  
some hold time after the next falling edge of SCLx.  
After the eighth bit is shifted out (the falling edge of the  
eighth clock), the BF flag is cleared and the master  
releases SDAx. This allows the slave device being  
addressed to respond with an ACK bit during the ninth  
bit time if an address match occurred, or if data was  
received properly. The status of ACK is written into the  
ACKDT bit on the falling edge of the ninth clock. If the  
master receives an Acknowledge, the Acknowledge  
Status bit, ACKSTAT, is cleared; if not, the bit is set.  
After the ninth clock, the SSPxIF bit is set and the  
master clock (Baud Rate Generator) is suspended until  
the next data byte is loaded into the SSPxBUF, leaving  
SCLx low and SDAx unchanged (Figure 16-21).  
16.4.10.3 ACKSTAT Status Flag  
In Transmit mode, the ACKSTAT bit (SSPxCON2<6>)  
is cleared when the slave has sent an Acknowledge  
(ACK = 0) and is set when the slave does not Acknowl-  
edge (ACK = 1). A slave sends an Acknowledge when  
it has recognized its address (including a general call),  
or when the slave has properly received its data.  
16.4.11 I2C MASTER MODE RECEPTION  
Master mode reception is enabled by programming the  
Receive Enable bit, RCEN (SSPxCON2<3>).  
Note:  
The MSSP module must be in an Idle state  
before the RCEN bit is set or the RCEN bit  
will be disregarded.  
The Baud Rate Generator begins counting, and on  
each rollover, the state of the SCLx pin changes  
(high-to-low/low-to-high) and data is shifted into the  
SSPxSR. After the falling edge of the eighth clock, the  
receive enable flag is automatically cleared, the con-  
tents of the SSPxSR are loaded into the SSPxBUF, the  
BF flag bit is set, the SSPxIF flag bit is set and the Baud  
Rate Generator is suspended from counting, holding  
SCLx 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 bit,  
ACKEN (SSPxCON2<4>).  
After the write to the SSPxBUF, each bit of the address  
will be shifted out on the falling edge of SCLx until all  
seven address bits and the R/W bit are completed. On  
the falling edge of the eighth clock, the master will  
deassert the SDAx pin, allowing the slave to respond  
with an Acknowledge. On the falling edge of the ninth  
clock, the master will sample the SDAx pin to see if the  
address was recognized by a slave. The status of the  
ACK bit is loaded into the ACKSTAT status bit  
(SSPxCON2<6>). Following the falling edge of the  
ninth clock transmission of the address, the SSPxIF is  
set, the BF flag is cleared and the Baud Rate Generator  
is turned off until another write to the SSPxBUF takes  
place, holding SCLx low and allowing SDAx to float.  
16.4.11.1 BF Status Flag  
In receive operation, the BF bit is set when an address  
or data byte is loaded into SSPxBUF from SSPxSR. It  
is cleared when the SSPxBUF register is read.  
16.4.11.2 SSPOV Status Flag  
In receive operation, the SSPOV bit is set when 8 bits  
are received into the SSPxSR and the BF flag bit is  
already set from a previous reception.  
16.4.10.1 BF Status Flag  
16.4.11.3 WCOL Status Flag  
In Transmit mode, the BF bit (SSPxSTAT<0>) is set  
when the CPU writes to SSPxBUF and is cleared when  
all 8 bits are shifted out.  
If the user writes the SSPxBUF when a receive is  
already in progress (i.e., SSPxSR is still shifting in a  
data byte), the WCOL bit is set and the contents of the  
buffer are unchanged (the write doesn’t occur).  
16.4.10.2 WCOL Status Flag  
If the user writes to the SSPxBUF when a transmit is  
already in progress (i.e., SSPxSR is still shifting out a  
data byte), the WCOL is set and the contents of the buf-  
fer are unchanged (the write doesn’t occur) after 2 TCY  
after the SSPxBUF write. If SSPxBUF is rewritten  
within 2 TCY, the WCOL bit is set and SSPxBUF is  
updated. This may result in a corrupted transfer.  
DS39682E-page 182  
© 2009 Microchip Technology Inc.  
 复制成功!