You are here

How to change ADC limit interrupt compare mode during runtime? | Cypress Semiconductor

How to change ADC limit interrupt compare mode during runtime?

Summary: 1 Reply, Latest post by vsrs on 18 Nov 2016 12:55 AM PST
Verified Answers: 1
Last post
Log in to post new comments.
michael_1534646's picture
User
15 posts

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.

vsrs's picture
Cypress Employee
23 posts

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

Log in to post new comments.