| 数据搜索系统,热门电子元器件搜索 |
|
HT83F60 数据表(PDF) 31 Page - Holtek Semiconductor Inc |
|
|
|||||||||||||||||||||||||||||
HT83F60 数据表(HTML) 31 Page - Holtek Semiconductor Inc |
|
31 / 62 page ![]() HT83FXX Rev. 1.30 31 June 7, 2010 S T A R T s i g n a l f r o m M a s t e r S e n d s l a v e a d d r e s s a n d R / W b i t f r o m M a s t e r A c k n o w l e d g e f r o m s l a v e S e n d d a t a b y t e f r o m M a s t e r A c k n o w l e d g e f r o m s l a v e S T O P s i g n a l f r o m M a s t e r I 2C Bus Communication Communication on the I 2C bus requires four separate steps, a START signal, a slave device address transmis- sion, a data transmission and finally a STOP signal. When a START signal is placed on the I 2C bus, all de- vices on the bus will receive this signal and be notified of the imminent arrival of data on the bus. The first seven bits of the data will be the slave address with the first bit being the MSB. If the address of the microcontroller matches that of the transmitted address, the HAAS bit in the SIMC1 register will be set and an I 2C interrupt will be generated. After entering the interrupt service routine, the microcontroller slave device must first check the condition of the HAAS bit to determine whether the inter- rupt source originates from an address match or from the completion of an 8-bit data transfer. During a data transfer, note that after the 7-bit slave address has been transmitted, the following bit, which is the 8th bit, is the read/write bit whose value will be placed in the SRW bit. This bit will be checked by the microcontroller to deter- mine whether to go into transmit or receive mode. Be- fore any transfer of data to or from the I 2C bus, the microcontroller must initialise the bus, the following are steps to achieve this: Step 1 Write the slave address of the microcontroller to the I 2C bus address register SIMAR. Step 2 Set the SIMEN bit in the SIMC0 register to ²1² to enable the I 2C bus. Step 3 Set the EHI bit of the interrupt control register to enable the I 2C bus interrupt. · Start Signal The START signal can only be generated by the mas- ter device connected to the I 2C bus and not by the microcontroller, which is only a slave device. This START signal will be detected by all devices con- nected to the I 2C bus. When detected, this indicates that the I 2C bus is busy and therefore the HBB bit will be set. A START condition occurs when a high to low transition on the SDA line takes place when the SCL line remains high. · Slave Address The transmission of a START signal by the master will be detected by all devices on the I 2C bus. To deter- mine which slave device the master wishes to com- municate with, the address of the slave device will be sent out immediately following the START signal. All slave devices, after receiving this 7-bit address data, will compare it with their own 7-bit slave address. If the address sent out by the master matches the internal address of the microcontroller slave device, then an internal I 2C bus interrupt signal will be generated. The next bit following the address, which is the 8th bit, de- fines the read/write status and will be saved to the SRW bit of the SIMC1 register. The device will then transmit an acknowledge bit, which is a low level, as the 9th bit. The microcontroller slave device will also set the status flag HAAS when the addresses match. As an I 2C bus interrupt can come from two sources, when the program enters the interrupt subroutine, the HAAS bit should be examined to see whether the in- terrupt source has come from a matching slave ad- dress or from the completion of a data byte transfer. When a slave address is matched, the device must be placed in either the transmit mode and then write data to the SIMDR register, or in the receive mode where it must implement a dummy read from the SIMDR regis- ter to release the SCL line. |
|
链接网址 |
| 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 |