Jump to content
43oh

Console with One-Wire Temperature on MSP430F5529 LP


Recommended Posts

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.

 

post-112-0-87595500-1411426557_thumb.png

post-112-0-42113300-1411426564_thumb.png

RE_OneWireOnF5529LP.zip

Link to post
Share on other sites
  • 8 months later...
  • 2 weeks later...

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....

Link to post
Share on other sites

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)
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...