Hi,
I am using the ADC on a LM3S9B81/Rev C5 on a board that we developed. Here is what I want to achieve:
- set up the adc to measure voltages and send it out on CAN-bus (works)
- set up the digital comparator on these adc channels and get notified by interrupt if a certain value is exceeded (having trouble here)
I do have a couple of questions, hope someone can help me.
1) I am not sure if I can even achieve my goal. The driver library provides two Functions [GPIOPinTypeComparator() and GPIOPinTypeADC()]. I want to trigger the ADC in a fixed rate, let's say 200ms but also want to get interrupts on the comparator if certain levels are exceeded.? The functions above make me wonder if that is even doable.
2) Datasheet says there are 8 digital comparators available in the adc. The vector table has 3 entries (Analog Comparator 0, Analog Comparator 1, Analog Comparator 2). I can't find a mapping which vector belongs to which comparator. 8 comparators, and 3 vectors?
I attached simplified sample code. A call to AdcInit() initializes the ADC and starts a sampling task in an OS. The task AppTaskADCSampling() triggers the ADC every 500ms and waits for the conversion to be finished, which is signaled through the interrupt handler ADC0SS0IntHandler(); Interrupt-Handler for the Comparator is never called, even though reading the interrupt status flags an interrupt.
Just for information: I read the Errata sheet and I am aware of the erros in the comparator module.
Juergen