AnsweredAssumed Answered

ADC values via UART on STM32L011

Question asked by Asim Siddiqui on Apr 24, 2018
Latest reply on Apr 24, 2018 by AvaTar

Hello Friends!

 

I am very new to STM coding and starting with the basics. I am using a STM32L011 uC and IAR compiler.

I am trying to measure voltage from a sensor that is dumping analog data at about 5Khz. The ADC values then need to be transferred to via UART to my laptop for post processing. 

 

The problem is that even though the STM32L011 is sampling with internal clock of 16Mhz and UART is dumping data at 56000 Baud Rate (WHTHOUT hardware flow control). The resulting graph of the ADC plot on my laptop has awful resolution. 

 

I dont understand where the problem is . Is it the transmission bottle neck which i doubt because the resulting graph of the ADC plot on my laptop is more or less the same even if i change the baudrate. Since i am using a simple while loop to pool for conversion for the ADC data and then transmitting to the system, the ADC conversion speed should be limited with the uart transmission rate and change with increasing or decreasing baud rate but this doesnt seem to happen.

Given below is the expected (oscilloscope) and actual plotted graphs (excel graphs which are no where close to expectations)

 

 

 

 

 

Any help in how to get the ADC values on the Laptop in as much real time as possible is appreciated. 

Attachments

Outcomes