Detect I2C device has stopped working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-10-19 4:16 AM
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.
- Labels:
-
I2C
-
STM32L4 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-10-19 6:22 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-10-19 6:26 AM
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.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-10-19 7:05 AM
thank you,
Please elaborate
"async-reset you might have to attempt clocking devices out of errant state"
how is this process carried out
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-10-19 7:09 AM
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);
