Jump to content
OzGrant

OneWire Energia Library

Recommended Posts

G'Day Alexander,

Will have a play with the files you pointed me too over the weekend.

With a bit of luck may have it all going by Monday.

Tks again, as at least I'm on the right track now.

Grant

Share this post


Link to post
Share on other sites

G'day,

Fixed all but one error now (had to substitute noInterrupts() for cli(), and interrupts() for sei())

 

The following is the error from the energia IDE

-----

C:\ti\Arduino\energia-0101E0008\hardware\msp430\libraries\OneWire\OneWire.cpp: In constructor 'OneWire::OneWire(uint8_t)':

C:\ti\Arduino\energia-0101E0008\hardware\msp430\libraries\OneWire\OneWire.cpp:96:12: error: cannot convert 'volatile uint16_t* {aka volatile unsigned int*}' to 'volatile uint8_t* {aka volatile unsigned char*}' in assignment

------

Have to idea what my next step is. Unable to find volatile uint16_t in OneWire.cpp

Have attached the latest edited files.

 

Grant

OneWireVer2.zip

Share this post


Link to post
Share on other sites

Hi,

I hope attached library may help.

i've used http://sourceforge.net/projects/msp430-ds18b20/ as a starting point.

Br

Alexander

zip.gif  DS18B20.zip   1.83K   

 

Thank you!  result <3k !!!

 

who will use the correct "DS18B20.h" in  "DS18B20.zip" :

class DS18B20{
  private:
volatile uint8_t * _OWPORTDIR;
volatile uint8_t * _OWPORTREN;
volatile uint8_t * _OWPORTIN;
volatile uint8_t * _OWPORTOUT;

how important it is to use noInterrupts()/Interrupts() in library?

Share this post


Link to post
Share on other sites

Tks for all the help.

I got the one wire working  ok. I am now trying to get it to work on the stellaris so the same library can be used on this platform.

There's a better following on this 430 forum when it comes to help, possible due to the time 430 has been around. From what I've experienced one has to be more C++ proficient when playing around with the stellaris, and not be reliant on Energia. My last note on this subject is energia  libraries. Without them we can only do basic stuff. So if your a arduino convert like my self, stay with the 430 and the help this forum provides.

Grant

Share this post


Link to post
Share on other sites

Thank you!  result <3k !!!

 

who will use the correct "DS18B20.h" in  "DS18B20.zip" :

class DS18B20{
  private:
volatile uint8_t * _OWPORTDIR;
volatile uint8_t * _OWPORTREN;
volatile uint8_t * _OWPORTIN;
volatile uint8_t * _OWPORTOUT;

 

You are right, these need to be changed to be compartible with the latest version of Energia

 

how important it is to use noInterrupts()/Interrupts() in library?

 

Borrowed it from other implementations. I guess needed to follow the exact timings for bit-banging.

 

Btw, I've posted a port of Arduino OneWire lib in the Energia Libraries section. This one is much more flexible, however for the price of the footprint

Share this post


Link to post
Share on other sites

@OzGrant and others:

 

The OneWire library you are talking about is probably the one from Paul Stoffregen. I've made a port for Energia, and have sent him the changes to see if he is willing to incorporate them to his source. So fingers crossed on that one :-).

 

I'll update here if I have more news.

Share this post


Link to post
Share on other sites

G'day once again.

I now have a working Dallas Library that works on both 430 and Stellaris using Energia IDE.

It would be nice if someone could check and test it.

Grant

 

Share this post


Link to post
Share on other sites

Unfortunately I haven't heard from Paul Stoffregen yet, so I decided to release the modified source here.

 

I still hope he'll respond, and include the changes in his own library, but at least you guys have a chance to play with it now :smile:

 

So, attached is the UNOFFICIAL OneWire library, that is compatible with Energia.

 

Regards,

Michel.

 

OneWire Energia Compatible.zip

Share this post


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