Hi there!
I have a problem with the LDC1612 that I would greatly appreciate some help understanding.
I am using an LDC1612 in continuous mode with hardware interrupts to inform my microcontroller of new conversions. I have two inductive coils and am using channel0 and channel1.
The issue I am facing is that I cannot get "data ready" interrupts to trigger consistently unless I use a delay of 8 milliseconds. That is, for each interrupt I delay once, for 8 milliseconds, immediately after the interrupt, but just before data is read.
My code flows like this:
1. Register ISR to trigger on falling edge of INTB on microcontroller
2. Set LDC registers (see code attachment)
3. Clear LDC by reading data channels and status register
4. Wait for interrupt
5. On interrupt, read from data channels 0&1 and status register
Steps 4 & 5 should repeat forever... but they don't. Instead, the ISR gets triggered once and INTB remains asserted.
Does anyone know why I cannot seem to get consistent interrupt behaviour without an arbitrary delay? What am I doing wrong here?
Thanks!
const uint16_t DRIVE_CURRENT = 0xFFC0; const uint16_t REF_COUNT = 0x2500; const uint16_t SETTLING_TIME = 0x0030; const uint16_t CLOCK_DIVISION = 0x1001; const uint16_t ERROR_CONFIG = 0x0001; const uint16_t CONFIG = 0x1E01; const uint16_t MUX_CONFIG = 0x820C;