Quantcast
Channel: Microcontrollers
Viewing all articles
Browse latest Browse all 216583

Forum Post: RE: CCS/MSP430FR2355: Read data through ADC and display on CCS serial terminal through UART

$
0
0
> UCA0TXBUF = ADC_Result; 1) UCA0TXBUF is only 8 bits wide, so this will only send the low order byte of the result ((2097 & 0xFF)=49). You'll need to serialize these two bytes (but see also (2) below) but as a first step, send only the most significant 8 bits ((2097 >> 4)=131), which is at least somewhat interesting: > UCA0TXBUF = ADC_Result >> (12-8); // Most significant 8 of 12 bits, as a byte 2) This transmits the raw bit value, not a printable (ASCII) representation; you won't be able to read it on the screen since it will look like what you posted. Eventually you'll want to use something like snprintf(), but as a first step capture the serial stream in a log file on the PC and hex-ify it with something like "/bin/od -X", [Edit: Added some emphasis]

Viewing all articles
Browse latest Browse all 216583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>