Send ADC measurement to PC through USART
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-10-05 10:42 AM
Posted on October 05, 2015 at 19:42
Hello,
my name is Carlo. I'm a student new to STM32 and MCUs in general.What I'm trying to do is to send a 16-bit ADC value through USART to PC, using stm32f0. I found some troubles doing this since USART takes one byte each time whilst ADC1ConvertedValue is 16-bit. I've tried to split a 16-bit value into two bytes but i don't know how to rejoin them to show the actual 16-bit result in the PC.Does anyone have any suggestions ?Thank you very much in advance.Regards,Carlo. #adc #usart #stm32f0
Labels:
- Labels:
-
ADC
-
STM32F0 Series
-
UART-USART
This discussion is locked. Please start a new topic to ask your question.
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-10-05 11:07 AM
Posted on October 05, 2015 at 20:07
So further presuming little/no PC or C programing experience.
Why then not just output the values in ASCII, with sprintf(), or itoa() type functions, and sending the string of bytes to the PC Terminal application in a human readable form?{ char String[16]; sprintf(String, ''%d\n'', ADCValue); USART_SendString(USARTX, String);}
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Up vote any posts that you find helpful, it shows what's working..
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-10-06 2:47 AM
Posted on October 06, 2015 at 11:47
Thank you very much Clive1. Your help has been really useful !
