cancel
Showing results for 
Search instead for 
Did you mean: 

Detect I2C device has stopped working

Hp.14
Associate II

Using STM32L4 with DS3231. Using LL interrupts to communicate with device.

Is there any way using interrupts to detect the device has stopped working. stopped working in the sense that that device is not ACK ng or has lost Vcc. not as in device functionality.

was unable to get NACK interrupt .. it was being enabled though.

4 REPLIES 4
TDK
Guru

Well there's no real way to detect if a remote IC has lost power unless you're tied into that power rail somehow. If you are, you could use an ADC threshold.

Seems like you answered your own question. The NACKIE bit and corresponding NVIC interrupt will enable interrupts when a NACK happens.

If you feel a post has answered your question, please click "Accept as Solution".

Use a time out, and propagate errors in your I2C driver stack and usages so you can identify when a device stops responding.

As most lack an async-reset you might have to attempt clocking devices out of errant states.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

thank you,

Please elaborate

"async-reset you might have to attempt clocking devices out of errant state"

how is this process carried out

Hp.14
Associate II

had enabled the NACKIE bit interrupt. my understanding is if the device doesnt respond it is considered a NACK.

however was unable to catch interrupt. tested this removing Vcc to device

LL_I2C_HandleTransfer(device_instance->ds3231_i2c,
					device_instance->device_address, LL_I2C_ADDRSLAVE_7BIT, 1,
					LL_I2C_MODE_SOFTEND, LL_I2C_GENERATE_START_WRITE);