I have a Nucleo STM32L476RG board. I am using it to read time varying ADC values from 3 channels of ADC1 (PC_0,PC_1,PC_2) and print them as a single comma separated string. Eg. 100,134,130.
Here are a few details:
- STM Cube was used to initialize system clock, ADC and UART.
- The System Clock runs on HCI crystal at 16MHz.
- The ADC also runs on HCI Crystal at 16MHz.
- The USART2 is used which has a baud rate of 115200bps.
The issue is that while printing the ADC values on UART, the data gets disorganized/shabby.
- The waveforms have a lot of noise on them.
2. The noise reduces at higher voltages.
The ADC uses interrupts to add data into the UART. => Specifications given below. (Query_Docs.docx)
I have attached the ADC,UART and System clock settings along with the HAL_ADC_ConvCplt() function.
Arduino UNO on the other hand provides very smooth waveforms of the same time varying signals
PS. I have tried introducing delays as well as tried to store the ADC Values first and then send the data seperately.