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 support@ccsinfo.com

DS1982 iButton - Add-Only Problem

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



Joined: 29 Nov 2013
Posts: 26

View user's profile Send private message

DS1982 iButton - Add-Only Problem
PostPosted: Tue Apr 17, 2018 4:16 pm     Reply with quote

Hello people,
I have a problem with the write function of DS1982 (Add-Only iButton).
I use the PIC18LF46K22 (by 1-Wire) to write a DS1982.
My project uses the Dallas Touch Driver (touch.c).
When the ibutton is new, I write 10 bytes (or more) successfully. But then I can not write anything else.
This iButton is add-only, the first 10 bytes are written (not allowed to delete), but I should be able to write the remaining bytes. Example, at address 0x0011.

Anyone have experience writing DS1982 iButton?

Regards
tEaM
temtronic



Joined: 01 Jul 2010
Posts: 9081
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Tue Apr 17, 2018 4:33 pm     Reply with quote

While I don't use that peripheral or it's driver...
1) do you have the correct pullup resistor ,based upon VDD, speed and other requirements?
2) Can you read the device's 'unique 64 lasered ROM' data ?
3) Can you confirm the driver's timing is correct for that device? My version of the driver is dated 2003. Perhaps the newer device needs a newer driver?
4) can you read/write to other addresses /registers of the device?
Ttelmah



Joined: 11 Mar 2010
Posts: 19195

View user's profile Send private message

PostPosted: Wed Apr 18, 2018 1:05 am     Reply with quote

I have to ask first how you are generating the 12v programming pulse for the chip?.
Is the data you write successfully verifying?.
Obvious question would be do you write to the first byte of the status memory?. This contains the write protect bits and if these were set, then writes would fail.
temtronic



Joined: 01 Jul 2010
Posts: 9081
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Wed Apr 18, 2018 4:59 am     Reply with quote

In following up on Mr. Ts comments, I read the datasheet, specifically the Write Memory [0Fh] section. The CCS touch.c driver will NOT program the EPROM of the device. There's no mention of code to switch 12volt at 10ma to the 1-wire bus, no code to check the CRC from the device either.
I suspect you'll have to go to the Dallas website and download an 'ap-note' or two, perhaps some code, and make your own DS1982 driver. Maybe use Google to check what others have done, even if on another microcomputer.
As with all of the '1-wire' devices timing is critical,so be sure to read and confirm what is required. If, say it needs a 'pulse of 30-50us', code for 40us, to be sure you're within the specified range. If it needs say '24us', code for 25us. Depending on the PIC, clock speed, compiler... the actual delay generated may be 'off' a little. It's a good idea to check with a scope.

Jay
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