2 Replies Latest reply on Aug 24, 2016 7:30 AM by user_418894472

    ADC simultaneous read/write

    user_418894472

      What happens if the CPU tries to read ADC data while the ADC is writing the results to the channel register? Is there a possibility of error that needs to be handled by the programmer or does the ADC_GetResult16() function handle it itself?

         

      Thank you

        • 1. Re: ADC simultaneous read/write
          user_1377889

          There is an API for checking for a conversion ready ADC_IsEndConversion() which you should use. The ADC results are buffered, so there is no interference when reading them.

             

          Alternatively you can connect an interrupt to the eoc (End Of Conversion) pin and read the results in the interrupt handler.

             

           

             

          Bob

          • 2. Re: ADC simultaneous read/write
            user_418894472

            Thanks for the reply!

               

            Although I am using the EOC interrupt to read the results, I just wanted to confirm whether there is a possibility of  data crash in case of NOT using the EOC interrupt. But as you said, the ADC output is buffered which eliminates any such possibility. Solves my question perfectly.

               

            Thanks again.