SBOU024C august 2004 – july 2023 PGA309
Whenever the PGA309 is called upon to communicate to the external EEPROM, the PGA309 must become the master on the Two-Wire interface bus. In order to do this in a reliable and orderly fashion, the PGA309 contains fault diagnostics to attempt to free a stuck bus. Several monitors and algorithms check for bus availability, prevent bus contention in case other devices are connected in parallel with the External EEPROM.
If the PGA309 is ever addressed on its Two-Wire or One-Wire interface, with the PGA309 providing a successful acknowledge, the PGA309 will cease all transactions as a master on the Two-Wire bus and give up control for 1.3 seconds. Each time the PGA309 is addressed on the Two-Wire bus, the 1.3 second timeout is reset, as shown in Figure 4-13.
Figure 4-14 details the algorithms used by the PGA309 when it must become master on the Two-Wire bus. A 33ms timer is started. Now SCL is monitored for being low. If SCL is not low, the PGA309 checks to see if communication on the Two-Wire bus is between a START and a STOP. If the bus communication is between a START and a STOP, the PGA309 waits for the 33ms timer to time out, and then checks if SDA is low. If SDA is not low and SCL is high, the PGA309 becomes bus master. If there is any SCL activity during the 33ms interval, the 33ms timer will restart.
If SCL remains low for the entire 33ms timer countdown, the PGA309 waits 33ms before starting the 33ms timer again to begin to check the bus for an idle state (SDA = SCL = ‘1’).
If SDA is low after the 33ms timer counts down, the PGA309 interprets this as a stuck-bus condition. The PGA309 attempts to free the stuck bus by sending up to ten clocks down SCL to free up SDA. If it is successful in causing SDA to go high, the PGA309 sends a START and then STOP sequence to ensure a complete reset of whichever device was causing the stuck bus. Now the bus should be in an idle state (SDA = SCL = ‘1’) and the PGA309 can become the master on the bus.
If the PGA309 is communicating on the bus as a master and it sees contention, the PGA309 will release the bus and retry in 33ms. Contention is defined as the PGA309 wanting SCL high and SCL is low, or wanting SDA high and SDA is low.