zeke 693 Posted September 22, 2014 Share Posted September 22, 2014 Hi Guys, This has been on my bucket list for a while. I've put together a CCS6 project that gives the user a serial console to the MSP430 with the ability to read a DS18B20 sensor by issuing a serial command. Here's a copy-paste of some of my interactions on the console: ************************************************************************************* * CommandConsole Ver:0.1 Released by:RandomElectrons.com Built:Sep 22 2014 16:33:28 * ************************************************************************************* h ******************************************************************************* B,b: Banner command C,c: Clear screen command H,h: Help command M,m: Memory command R,r: Reset command S,s: Sensitivity command T,t: Temperature command V,v: Version command ******************************************************************************* OK t? T=254 raw decimal counts T=15.87'C OK t? T=213 raw decimal counts T=-13.31'C OK T? T=29 raw decimal counts T=-1.81'C OK T? T=9 raw decimal counts T=-0.56'C OK T? T=6 raw decimal counts T=0.37'C OK T? T=242 raw decimal counts T=15.12'C OK B? T=440 raw decimal counts T=27.50'C OK I have also uploaded my CCS6 project as a zip file. As the pictures suggest, I have created this on an F5529 LaunchPad board. The DS18B20 is wired up in 3-Wire mode and is connected to P1.4 of the LP and read with the typical bit-banging method. I have wired in an adafruit ftdi friend onto P3.3 and P3.4 for USART to the PC operation. I use the Terminal inside of CCS6 to interact with the system. -->View-->Other-->Terminal-->OK The console portion of this project was inspired by and adapted from http://www.adnbr.co.uk/articles/parsing-simple-usart-commands Comments are welcomed. RE_OneWireOnF5529LP.zip BlackAngel and bluehash 2 Quote Link to post Share on other sites
bluehash 1,581 Posted September 23, 2014 Share Posted September 23, 2014 Thanks for sharing @@zeke. Quote Link to post Share on other sites
acesh 0 Posted June 12, 2015 Share Posted June 12, 2015 I am using baud rate 115200 but I am getting different characters. The code seems to be working, I can read the temperature values but I am not getting correct characters in the COM port. What might I be doing wrong? Quote Link to post Share on other sites
zeke 693 Posted June 12, 2015 Author Share Posted June 12, 2015 @@acesh Have you made any alterations to the original code? Make sure to set your serial port to 115200, 8N1. Can you show us what you see? Please copy-paste your console output here. Quote Link to post Share on other sites
acesh 0 Posted June 22, 2015 Share Posted June 22, 2015 I can see: #Q Quote Link to post Share on other sites
zeke 693 Posted June 23, 2015 Author Share Posted June 23, 2015 @@acesh, There's something not quite right with the communication parameters. If the communication parameters are truely 115200,8N1 then try changing the encoding to ASCII. Quote Link to post Share on other sites
acesh 0 Posted June 24, 2015 Share Posted June 24, 2015 The encoding options are ISO-8859-1, UTF-8 and Cp1252. What should I use? Can you walk me through the connection of the FTDI Friend? Thanks Quote Link to post Share on other sites
veryalive 49 Posted June 24, 2015 Share Posted June 24, 2015 Hi guys. I used Zeke's sw a long time ago, so maybe my recollection is correct / useful: .... Check your bit times with a scope ....? I recall changing baud rate down to 9600 and also got bit errors. The logic analyser showed faster bit times than 104 uSec (9600), it was around 95 or 97 ? When I adjusted dividers in the async uart setup routine, it worked. Maybe this helps? Cheers.... oPossum 1 Quote Link to post Share on other sites
oPossum 1,083 Posted June 24, 2015 Share Posted June 24, 2015 This is obviously wrong: UCSCTL2 |= 499; // Set DCO Multiplier for 16MHz // (N + 1) * FLLRef = Fdco // (499 + 1) * 32768 = 16MHz change to... UCSCTL2 |= 499; // Set DCO Multiplier for 16MHz // (N + 1) * FLLRef = Fdco // (499 + 1) * 32768 = 16.384 MHz and also change... const unsigned long smclk_freq = 16384000UL; // SMCLK frequency in hertz and delete (or fix and make use of)... /******************************************************************************* * ******************************************************************************/ #define F_CPU 16000000UL #define BAUD 19200 #define BAUD_PRESCALE (((F_CPU / (BAUD * 16UL))) - 1) veryalive and zeke 2 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.