cancel
Showing results for 
Search instead for 
Did you mean: 

verification scenario to assure that data from adc is transmitted correctly through uart

salss_emb
Associate

so my project consists of : exploiting the serial communication to send the conversion data from ADC1 Channel 1 in ASCII format and considering a verification scenario for the program's functionality.

about the verification scenario i visualize it in "putty" and it is right (i'm using a potentiometer like an analog input to my ADC ) (i also used a multimeter to know that adc is reading the input correctly)  and i get logique outputs is there any other thing i need to check that UART communication is set perfectly any verification scenario i should also implement??? 

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

The UART protocol has an optional parity bit with you can use to detect single bit errors. That should be more than enough. If you see parity errors, you should fix whatever is causing them, but they should no occur in normal scenarios.

If it was very critical data, you could send a CRC of the data along with the data but that is overkill in most applications.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

2 REPLIES 2
TDK
Guru

The UART protocol has an optional parity bit with you can use to detect single bit errors. That should be more than enough. If you see parity errors, you should fix whatever is causing them, but they should no occur in normal scenarios.

If it was very critical data, you could send a CRC of the data along with the data but that is overkill in most applications.

If you feel a post has answered your question, please click "Accept as Solution".

Considering the amount of dither you get on an ADC, the amount of noise you get on a potentiometer, and the lack of speed on a multimeter, I can't see that this method of verification would be particularly accurate or valuable, especially when the final determination will be done by a human.

If you want to check an ADC to UART, end to end, you would need a precision input, the ADC, convert the ADC counts into a number, sprintf into a string, sscanf into a number, compare the original and the sprintf+sscanf value, send it out the UART, wrap the UART back into another UART, read the second UART value, sscanf into another numeric, compare this with the original, then compare this value with the number that you'd expect from the application of a precision input.

Now, run the system through all 4096 possible ADC values (assuming you are using an STM32 internal 12-bit ADC).

Or plan and justify your verification setup, validate that it is cromulent, run the test according to your V&V plan, correct any anomalies, update the V&V plan, start again, repeat until your system passes verification.