CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Dallas 1wire using the DS2482 I2C to 1-wire chip

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
MikeW



Joined: 15 Sep 2003
Posts: 184
Location: Warrington UK

View user's profile Send private message

Dallas 1wire using the DS2482 I2C to 1-wire chip
PostPosted: Tue Feb 03, 2009 7:05 am     Reply with quote

Has anyone got this device to work ?
I am tearing my hair out on this.
I know my I2C bus is working, since I have other devices on the bus.
I have had to go back to software I2C to use it ( the hardware I2C works fine with other devices).
I am using the Dallas AN3684 software routines, and cant get the OWSearch to find any 1wire devices.


my 1wire DS18B20's work fine using the 1 wire bit-banged routines.

maybe I am trying to be too clever in off-loading the DOW protocol

Mike
herselmann



Joined: 31 May 2008
Posts: 7

View user's profile Send private message

PostPosted: Tue Feb 03, 2009 7:44 am     Reply with quote

Which one? There are two different ones. I have sampled some just last week but don't know when i will have a chance to play with them and thus be able to give you advice.

I would start by testing the search code with a bit-bang interface. From what I have read from the datasheet, you should be able to replace the bottom 'layer' with the i2c bridge master chip at a latter stage leaving all the other functions the same.

That being said, from what I can remember from the command table in the datasheet, it seemed like the chip has some commands specific to the search function.

Did you remember your Pull-ups?

I recall something about two's compliment when writing to some registers, but might be confusing this with other datasheets...

If the manufacturer has to dedicate a whole app note to a device then it must mean that it is more difficult that expected...

Here is a link for AVR code:
http://www.koders.com/c/fid9F966AF5A29CD2065933ED960EF0CEDC16DE5A96.aspx

EDIT: This might also help: http://www.ccsinfo.com/forum/viewtopic.php?p=64807
_________________
There are only 10 kinds of people, those who understand binary and those who don't.
MikeW



Joined: 15 Sep 2003
Posts: 184
Location: Warrington UK

View user's profile Send private message

PostPosted: Tue Feb 03, 2009 9:00 am     Reply with quote

DS2482-100, the single channel device.

I can talk to the I2C part of the DS2482.
I have all necessary pullups.

I am having problems with the find devices routines,.... it cant find any.

re two's complement, I think you mean that the config register only uses the bottom 4 bits, but the top 4 bits must be written as the complement., ie 0x0F, or 0x1E
seems very strange.

my 1wire bit banging routines work a treat.
since I dont have a pic io pin connected to the 1wire bus, it is not simple to do a search rom using bit banging.
time for wire and a soldering iron methinks.

the AVR routines dont have a find rom function implemented

Mike
MikeW



Joined: 15 Sep 2003
Posts: 184
Location: Warrington UK

View user's profile Send private message

progress, and things to try
PostPosted: Tue Feb 03, 2009 9:11 am     Reply with quote

the AVR routines look promising, I will keep you updated

Mike
MikeW



Joined: 15 Sep 2003
Posts: 184
Location: Warrington UK

View user's profile Send private message

further info to help me
PostPosted: Tue Feb 03, 2009 9:28 am     Reply with quote

this looks useful also

www.scu.edu/engineering/cse/ugrad/upload/COEN-2007-PROJECT-07.pdf
herselmann



Joined: 31 May 2008
Posts: 7

View user's profile Send private message

PostPosted: Wed Feb 04, 2009 12:29 am     Reply with quote

Indeed, very interesting, just need more time to read...

Here is the other half of the AVR code, no more functions - just usefull defines: http://www.koders.com/c/fid5F08D29A19BB041FCD6E144C5374144AAAACF927.aspx

This is a debug output of some sort, could also be of some help: http://www.mail-archive.com/[email protected]/msg01542.html

I had a second look at the datasheet, and it contains the complete search function, can't see why this code would not want to work. Have you tried tech support? Post or PM me some code and I will see if I can have a look at it.
_________________
There are only 10 kinds of people, those who understand binary and those who don't.
MikeW



Joined: 15 Sep 2003
Posts: 184
Location: Warrington UK

View user's profile Send private message

Succes thanks to Kenny
PostPosted: Wed Feb 04, 2009 6:12 am     Reply with quote

I sent a pm to Kenny, after searching the forum on DS2482.

He sent me complete code.

I just started a new project, loaded his code, and away it went, detected my DS18B20.

Wonderful !!!

Many thanks Kenny.

I wont post his code without his consent.

Mike
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group