- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi.
Is it possible to change ADC limit interrupt compare mode during runtime?
I don't see anything in component's datasheet (BTW, the datasheet doesn't mention the ADC_IRQ_StartEx() function. I wonder if there are more things missing in it).
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Michael,
I don't think any API's readily available for the purpose. One thing you can do is use the register ADC_SAR_RANGE_COND_REG . The bits 31:30 of the register control the range of the register.
Values corresponding to each mode are:
0x0: BELOW
result RANGE_LOW
0x1: INSIDE
RANGE_LOW = result RANGE_HIGH
0x2: ABOVE
RANGE_HIGH = result
0x3: OUTSIDE
result RANGE_LOW || RANGE_HIGH = result
You may change these values dynamically to change the compare mode. It is better to stop the ADC before the register write operation and start it again. Use masking technique so that you won't disturb other bits in the register.
Happy Designing !
Regards,
VSRS