This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RM46L852: When do ADC "magnitude threshold" compare and set interrupt flag ?

Part Number: RM46L852

Hi there,

I implemented magnitude threshold interrupt in my application.

A interrupt works when relevant ADC channel below a level I set, but a routine called by the interrupt has big latency I did not suppose.

I believe threshold value and ADC result that specified by ADMAGINTxCR is compared every AD conversion.
For example, even conversion result is not read by CPU, 100us conversion interval leads the comparison interval being 100us.

So interrupt can be triggered by 100us at the minimum.

Is it correct ? (Unfortunately, it did not work so fast. Probably, it could be wrong)

I appreciate any comments or suggestion.

Thanks.

H. Yamai

  • Hi Yamai,

    I believe threshold value and ADC result that specified by ADMAGINTxCR is compared every AD conversion.

    Yes it is. The threshold value mentioned in ADMAGINTxCR will be compared with conversion result on AD conversion.

    For example, even conversion result is not read by CPU, 100us conversion interval leads the comparison interval being 100us.

    That's correct.

    So interrupt can be triggered by 100us at the minimum.

    Is it correct ? (Unfortunately, it did not work so fast. Probably, it could be wrong)

    Yes your understanding correct.

    If you want to compare it fast then you can use this channel in continuous conversion mode. In continuous conversion mode no need to trigger the channel each time, only one trigger at biggening is enough for repeated conversions. So, after each conversion the magnitude of the converted channel will get compared with the threshold value given and it will raise the interrupt if the corresponding condition met.

    --

    Thanks & regards,
    Jagadish.

  • Hello Jagadish,

    Thanks quick reply.

    My setting for magnitude threshold interrupt:

    Initializing:

    1) MAGINTCR1 : Set threshold level and specified one channel in it

    2)MAGTHRINTENASET : Set 1 in it

    Interrupt task (engaged by magnitude threshold interrupt)

    3) MAGTHRINTENACLR : Set 1 in it

    4)MAGTHRINTFLG : Set 1 in it (Corresponding interrupt flag clear)

    Any missing items ?

    I will confirm conversion timing and measure "latency" tomorrow.

    < Unfortunately, my application can not employ 

    continuous conversion (my application needs fixed conversion interval).>

    I will be back with the result if any question remaine.

    Thanks, again.

    Best regards,

    Yamai

  • Hello Jagadish,

    I checked out latency of magnitude interrupt execution.

    Previously, I measured power line voltage to check the latency.

    This voltage is given to micro via  TPS65381A (could force magnitude interrupt).

    Today I measured latency with monitoring TPS65381A output terminal connected to micro. 

    As a result, I confirmed the latency is very short, I excepted.

    Thanks for your help.

    Yamai