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

DS2411 1-Wire

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








DS2411 1-Wire
PostPosted: Wed Mar 23, 2005 7:41 am     Reply with quote

Hi !

I'd like to use the DS2411 1-Wire for a project.
Could anybody provide me some C code?

Many thanks.
jds-pic



Joined: 17 Sep 2003
Posts: 205

View user's profile Send private message

Re: DS2411 1-Wire
PostPosted: Fri Mar 25, 2005 10:42 am     Reply with quote

Anonymous wrote:
Hi !
I'd like to use the DS2411 1-Wire for a project.
Could anybody provide me some C code?
Many thanks.

start here, with some onewire functions from the code library forum:
http://www.ccsinfo.com/forum/viewtopic.php?t=19520

then download and read the ds2411 datasheet:
http://pdfserv.maxim-ic.com/en/ds/DS2411.pdf

and 15 minutes later you have a working program.

jds-pic
Guest








PostPosted: Tue Mar 29, 2005 9:28 am     Reply with quote

I found how it works more or less but i just wondered why the CRC does not match with the last 8 bit.

Anyway, i find a serial number with hexadecimal numbers which seems to be correct.

Thanks.
Guest








PostPosted: Tue Mar 29, 2005 9:30 am     Reply with quote

ok thanks not that easy :(
jds-pic



Joined: 17 Sep 2003
Posts: 205

View user's profile Send private message

PostPosted: Tue Mar 29, 2005 9:51 am     Reply with quote

Anonymous wrote:
Anyway, i find a serial number with hexadecimal numbers which seems to be correct.

when i was starting out with 1wire, i had the same concern -- "how do i know my crc routine is working?"
it was very frustrating since my code for the 1wire device on the prototype board i was using kept returning "0x00" as the crc byte.
i debugged and recompiled my code about 87 times, looking for the error i had obviously made.
finally, i sat down and *BY HAND* calculated the crc for the device bytes.








turns out the crc *was* 0x00. i had a 1/255 chance of getting a part like this, and i did!

jds-pic

ps
if you have the rom space, you can use the lookup table method rather than the computation method. it's the std time-vs-space tradeoff. but quicly implementing the lookup table (even by hand as i did) will allow you to verify that the computational method is indeed correct.
see
http://pdfserv.maxim-ic.com/arpdf/AppNotes/app27.pdf
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