I'm at the point of programming the ITG3200's library, setting the "Interrupt configuration" register:
Can someone tell me what does the:
open-drain/push-pull
latch mode (until interrupt cleared)
terms mean and what they do more precise?
And continuing asking when I should enable this 2 bits (I added their names found in the datasheet)?:
ITG_RDY_EN : Enable interrupt when device is ready(PLL ready after changing clock source)
RAW_RDY_EN: Enable interrupt when new data is available
The problem is that the datasheet, at least for me,here,looks a little bit ambiguous what they are saying.
Thank you,
RobertEagle
PS:
Let's say that there are 2 registers to read: (0x1b)TEMP_OUT_H and (0x1C)TEMP_OUT_L.
How should I implement this in the code so to get one variable?I'm more interested in the procedure than in the function to use.
A logic output that drives both HIGH and LOW (but not at the same time!) is a push-pull output - this is the usual case.
An open-drain (or open-collector) output is one that is only pulled LOW - otherwise it floats (so an external pull-up resistor is needed).. Open drain outputs can be connected together without fighting each other - the result is a free AND gate (called a wired-AND) since the line can only be pulled high when all the open-drain outputs are letting it float.
The open-drain configuration can be considered a wired-OR though - if LOW represents the active state (as is common with interrupt lines). This is why the interrupt output is configurable as an open-drain - to let it share the same interrupt line to the processor as other devices, and any of the devices can pull the line low.
A latching interrupt is one that remains active until the interrupt routine has performed the right actions to cancel the condition (such as reading the data that's ready to read). Otherwise the interrupt line will be pulled LOW for a short period and released.
Some processors / microcontrollers will call an interrupt routine when the interrupt line goes low, and also when an interrupt routines returns and the line is still low. The Arduino interrupt lines can be configured to do exactly this or to respond to any change in the pin state (LOW->HIGH or HIGH->LOW).
If the device generates a latching interrupt and the interrupt handler doesn't clear the condition correctly it will be repeatedly called and hang the processor, so take care!