View previous topic :: View next topic |
Author |
Message |
tEaM
Joined: 29 Nov 2013 Posts: 26
|
DS1982 iButton - Add-Only Problem |
Posted: Tue Apr 17, 2018 4:16 pm |
|
|
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: 9246 Location: Greensville,Ontario
|
|
Posted: Tue Apr 17, 2018 4:33 pm |
|
|
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: 19553
|
|
Posted: Wed Apr 18, 2018 1:05 am |
|
|
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: 9246 Location: Greensville,Ontario
|
|
Posted: Wed Apr 18, 2018 4:59 am |
|
|
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 |
|
|
|