Strictly necessary cookies are on by default and cannot be turned off. Functional, Performance and Tracking/targeting/sharing cookies can be turned on below based on your preferences (this banner will remain available for you to accept cookies). You may change your cookie settings by deleting cookies from your browser. Then this banner will appear again. You can learn more details about cookies HERE.
Strictly necessary (always on)
Functional, Performance and Tracking/targeting/sharing (default off)
I need to take an ADC reading at a specific point in received data stream from a wireless system.
First I dropped an SAR_ADC on the project and tested it worked using this code.
result = ADC_IsEndConversion(ADC_WAIT_FOR_RESULT);
RSSI_Val = ADC_GetResult16();
Next, I set a flag at the point in data reception I wanted to start sample and when I read the flag in main code I do an ADC sample. Trouble is that I do not have control over the point a packet arrives and therfore the sampling of the ADC is not always occurring when I need it.
Would someone have an example how I could start and ADC conversion within the Uart Interrupt routine so that when I get back in main loop the conversion would have been doen at the right time and I can read the value at that point?