Sunday, 2 June 2013

Sending ADC measurements with UART

Sending ADC measurements with UART

I want to measure signal with ADC and send measurements to PC to generate plots.
My code:
ADC_SoftwareStartConv(ADC3);
while(1)
{
    ADC3ConvertedVoltage = ADC3ConvertedValue * 3300/0xFFF;
    ADCresultsTab[i] = ADC3ConvertedVoltage;
    sprintf(str,"%u",ADC3ConvertedVoltage);
    USART2_SendText(str);
    USART2_SendText(";");
}
The problem is that I want to sample signal as fast as it is possible. Here I'm using baud rate = 256000 (Windows only). What is the possibility to sample signals faster? What is more optimal code for sample and send measurement?
I see that the problem there is UART transmission.
And my additional questions are: Is it real time measurement with this code? How it should be made if I want real time measurement?

No comments:

Post a Comment