20.3.4 Hardware ACK Multimaster and Multislave Behavior
In some system management bus (SMBus) configurations, the hardware ACK mechanism of the SMBus peripheral can cause incorrect
or undesired behavior. The hardware ACK mechanism is enabled when the EHACK bit in the SMB0ADM register is set to logic 1. The
configurations to which this behavior does not apply are as follows:
1. All SMBus configurations when hardware ACK is disabled.
2. All single-master / single-slave SMBus configurations when hardware ACK is enabled and the MCU is operating as a master or
slave.
3. All multi-master / single-slave SMBus configurations when hardware ACK is enabled and the MCU is operating as a slave.
4. All single-master / multi-slave SMBus configurations when hardware ACK is enabled and the MCU is operating as a master.
This behavior only applies to the following configurations:
1. All multi-slave SMBus configurations when hardware ACK is enabled and the MCU is operating as a slave.
2. All multi-master SMBus configurations when hardware ACK is enabled and the MCU is operating as a master.
Multi-Slave Behavior
The following issues are present when operating as a slave in a multi-slave SMBus configuration:
1. When hardware ACK is enabled and SDA setup and hold times are not extended (EXTHOLD = 0 in the SMB0CF register), the
SMBus hardware will always generate an SMBus interrupt following the ACK/NACK cycle of any slave address transmission on the
bus, whether or not the address matches the conditions of SMB0ADR and SMB0ADM. The expected behavior is that an interrupt is
only generated when the address matches.
2. When hardware ACK is enabled and SDA setup and hold times are extended (EXTHOLD = 1 in the SMB0CF register), the SMBus
hardware will only generate an SMBus interrupt as expected when the slave address transmission on the bus matches the condi-
tions of SMB0ADR and SMB0ADM. However, in this mode, the start bit (STA) will be incorrectly cleared on reception of a slave
address before firmware vectors to the interrupt service routine.
3. When hardware ACK is enabled and the ACK bit in the SMB0CN0 register is set to 1, an unaddressed slave may cause interfer-
ence on the SMBus by driving SDA low during an ACK cycle. The ACK bit of the unaddressed slave may be set to 1 if any device
on the bus generates an ACK.
Once the CPU enters the interrupt service routine, SCL will be asserted low until SI is cleared, causing the clock to be stretched when
the MCU is not being addressed. This may limit the maximum speed of the SMBus if the master supports SCL clock stretching. Incom-
pliant SMBus masters that do not support SCL clock stretching will not recognize that the clock is being stretched. If the CPU issues a
write to SMB0DAT, it will have no effect on the bus. No data collisions will occur. To work around this issue, the SMBus interrupt serv-
ice routine should verify an address when it is received and clear SI as soon as possible if the address does not match to minimize
clock stretching. To prevent clock stretching when not being addressed, enable setup and hold time extensions (EXTHOLD = 1).
Once the hardware has matched an address and entered the interrupt service routine, the firmware will not be able to use the start bit
to distinguish between the reception of an address byte versus the reception of a data byte. However, the hardware will still correctly
acknowledge the address byte (SLA+R/W). During an initial start sequence, to distinguish between the reception of an address byte at
the beginning of a transfer versus the reception of a data byte when setup and hold time extensions are enabled (EXTHOLD = 1), firm-
ware should maintain a status bit to determine whether it is currently inside or outside a transfer. Once hardware detects a matching
slave address and interrupts the MCU, firmware should assume a start condition and set the firmware bit to indicate that it is currently
inside a transfer. A transfer ends any time the STO bit is set or on an error condition (e.g., SCL Low Timeout). During a repeated start
sequence, to detect the reception of an address byte in the middle of a transfer when setup and hold time extensions are enabled
(EXTHOLD = 1), disable setup and hold time extensions (EXTHOLD = 0) upon entry into a transfer and re-enable setup and hold time
extensions (EXHOLD = 1) at the end of a transfer.
The SMBus master and the addressed slave are prevented from generating a NACK by the unaddressed slave because it is holding
SDA low during the ACK cycle. There is a potential for the SMBus to lock up in this situation. To prevent this, schedule a timer interrupt
to clear the ACK bit at an interval shorter than 7 bit periods when the slave is not being addressed. For example, on a 400 kHz SMBus,
the ACK bit should be cleared every 17.5 μs (or at 1/7 the bus frequency, 57 kHz). As soon as a matching slave address is detected (a
transfer is started), the timer which clears the ACK bit should be stopped and its interrupt flag cleared. The timer should be re-started
once a stop or error condition is detected (the transfer has ended).
Multi-Master Behavior
When operating as a master in a multi-master SMBus configuration, if the SMBus master loses arbitration, it may cause interference on
the SMBus by driving SDA low during the ACK cycle of transfers in which it is not participating. This will occur regardless of the state of
the ACK bit in the SMB0CN0 register. In this case, the SMBus master and slave participating in the transfer are prevented from gener-
ating a NACK by the MCU because it is holding SDA low during the ACK cycle. There is a potential for the SMBus to lock up.
To work around this behavior, firmware should disable hardware ACK (EHACK = 0) when the MCU is operating as a master in a multi-
master SMBus configuration.
EFM8SB2 Reference Manual
System Management Bus / I2C (SMB0)
silabs.com
| Smart. Connected. Energy-friendly.
Rev. 0.1 | 231