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.

LAUNCHXL-F28379D: ADC Continu Mode

Part Number: LAUNCHXL-F28379D
Other Parts Discussed in Thread: SYSCONFIG

Hello,

I use the ADCA on the 379D:

- Tsample=75ns

- Tconversion=285ns

I only use the SOC0 module. 

The trigger is sofware only, but I define INT1 pulse as trigger:

So, after a first software request, I expect that the ADC is in a free run mode.

Every thing is OK till the content of the interruption is less than Tsample+Tconversion.

But if it is not the case, I thought that I could use the continue mode:

- the interrupt pulse is generated before I clear the Flag

- the flag is cleared at the end of the interrupt

- the flag is set in the same time as the next interrupt pulse

By this way, I hoped that there would be a "free" time, between 2 interrupts.

But It seems not.

When debugging the project, it seem that, in the continue mode, my demand of clearing the flag is rejected.

Does anybody know if the continue mode consists of not never reseting the Flag ?

If yes, what is the purpose of this mode ? (I will never get out of the interrupt)

Thank you for your help ?

  • Hi,

    Please allow me a day to get back to you about this.

    Best Regards,

    Ben Collier

  • Thank you for letting me know about the delay of your investigation. I do appreciate. This issue is critical for me because I have to use the ADC in a free run mode

  • Vincent,

    Could you take a look at the F2837xD example called adc_ex5_soc_continuous? It doesn't use SysConfig, but it does show how to set up the ADC to work in continuous mode. In the example, all 16 SOCs are used, as well as 4 ADC interrupts. This way, the device can do multiple conversions without an interrupt being triggered, which would hopefully give you the time between interrupts that you desired. 

    Best Regards,

    Ben Collier

  • Hello, Thank you for answering me. But it is not the answer I was expecting. I don t want to do an acquisition for my project, but to be sure to understand how the ADC works.

    Maybe I can reformulate my question: it is normal that the demand of clearing Flag is not take,n into acount in the continous mode ? (whatever sysconfig is used or not)

  • Hi Vincent,

    Are you able to share your project code? It is not normal that you cannot clear the flag, and I am not able to replicate your problem.

    Best Regards,

    Ben Collier

  • Hello, that's the good way of working I think.

    I made a project specifically for our conversation. I don t find how to attach the archive to this post. 

    In this example, without any optimization, the contents of the ADC interrupt is above 2µs (orange curve, with a delay before and after)

    In a first run, I configured the sample time to 2560ns. The conversion time is 210ns.

    Since I am in the continue mode, each time I enter in the interrupt, an interrupt pulse is generated, and a new sample begins. The duration of the interrupt (orange curve) is less than the duration of the sample duration. So we leave the interrupt subroutine before the next pulse. 

    Even if this subroutine is quite long, we enter periodically in the main loop, and every thing seems to work. But if I take a look at the register in the debug mode, I can see that the Flag is not cleared after I ask for it:

    Actually, the ADC_ClearInterruptStatus has no effect

    Ti compare, I tried to use the non continuous mode:

    Even if I cannot see that the bit ADCINTFLGCLR.INT1 is set, I can see that the flag is clear.

    So, come back to the continuous mode, but with a smaller sample time (75ns).

    A pulse is generated befor the flag is cleared. That is normal. But since it is never cleared, it looks like a new pulse is generated at the end of the interrupt, not because a new conversion is done, but because we leaved the interrupt, and the Flag is set. So we enter again in the interrupt subroutine. We never enter in the main loop

    20231003_Export4TI.zip

  • Hi,

    Thank you for providing code that demonstrates this problem. I was able to replicate what you are seeing, but I will need another day to find a suitable explanation for this. 

    Best Regards,

    Ben Collier

  • Hi,

    I'm gonna need another day to provide a full explanation, but it actually seems like it is not possible to clear the ADCINT1 flag when continuous mode is enabled and the interrupt is enabled.

    Best Regards,

    Ben Collier

  • Vincent,

    If I am understanding your situation correctly, you have two issues that you want explained: 

    1. You cannot clear the ADCINT1 flag when continuous mode is enabled

    2. You cannot execute code in the while loop when continuous mode is enabled

    For the first issue, it is not possible to clear the ADCINT1 flag when the interrupt is enabled and the interrupt has continuous mode enabled. I was able to clear ADCINT1 flag earlier because I was disabling the interrupt, then I cleared the ADCINT1 flag, then I enabled the interrupt again outside of the ISR. I am reaching out to someone on our design team to ask about why this was implemented this way.

    For the second problem, I do not think that the issue of never making it to the main while loop code has to do with the ADCINT1 flag not being cleared. When continuous interrupt mode is enabled, the value of ADCINT1 flag should not matter. Instead, there is always a pending interrupt, so the the main code is never reached. If you disable continuous interrupt mode with this shorter sample time, then you will eventually stop triggering ADC conversions because the interrupts will be triggered too fast, and there will be overflow with the interrupts. Of course when an interrupt is missed, then no more ADC conversions or interrupts will be triggered.

    Best Regards,

    Ben Collier

  • Hello,

    You did understand my issue.

    Since the flag cannot be cleared, I already had the answer to the second point.

    But there is still the third point, mentioned in my first post: what is the continuous mode made for ? Since we cannot use the interrupts in this mode, how do people   use the ADC in the continuous mode ? for what purpose ? Do you have any typical example ?

    Thank you

  • Hi Vincent,

    I will have to look for a typical example, but I believe the main purpose of continuous mode is to minimize the interrupts that are missed due to interrupt overflow. 

    Best Regards,

    Ben Collier