One wire blues

jmumby

Senior Member
Hello,

Im trying to write to a DS2431 1-wire eeprom. I can read from it no problem but Im always getting FF when getting a status from a copy from scratch pad. I am using the following, following the example in the datasheet http://datasheets.maxim-ic.com/en/ds/DS2431.pdf

Code:
;-----------------------------------------------------------------------------------------------
OWOUT 1,1,(0xCC,0x0F,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00); write scratchpad
OWIN 1,0,(b6,B7) ;Read crc
;-----------------------------------------------------------------------------------------------
OWOUT 1,1,(0xCC,0xAA) ;Read scratchpad ROM
OWIN 1,0,(B19,B20,B21,B8,B9,B10,B11,B12,B13,B14,B15,B16,B17)
;-----------------------------------------------------------------------------------------------
OWOUT 1,1,(0xCC,0x55,B19,B20,B21);Copy scratchpad
PAUSE 1000
;-----------------------------------------------------------------------------------------------
OWIN 1,0,(B18)  ; copy status
;-----------------------------------------------------------------------------------------------
OWOUT 1,1,(0xCC,0xF0,0x00,0x00) ;read memory
FOR B3 = 0 TO 7
OWIN  1,0,(b0)  ; Read byte
SERTXD(#B3,"-",b0)
SERTXD(CR,LF)
NEXT B3
;----------------------------------------------------------------------------------------------- 
SERTXD("TA1-",#B19," TA2-",#B20," E/S-",#B21," CRC-",#B16,#B17)
SERTXD(CR,LF)
SERTXD("DATA-",B8,B9,B10,B11,B12,B13,B14,B15)
SERTXD(CR,LF)
SERTXD("STATUS-",B18)
SERTXD(CR,LF)
;--------------------------------------------------------------------------------------------------------
I see on the datasheet example has a RX of a presence pulse but I can't see anything that relates to that in the picaxe manual for OWOUT or OWIN so I guess it is an option for some masters.
 
Last edited:

Technical

Technical Support
Staff member
Have you checked that b19,20,21 are actually beeing read back correctly after the read scratchpad command?
 

pha555

Senior Member
I have not used this device.

However when you copy scratchpad to memory, I think you need to provide strong pullup on the DQ lead.

OWOUT 1,1,(0xCC,0x55,B19,B20,B21);Copy scratchpad
PAUSE 1000

change to;

OWOUT 1,9,(0xCC,0x55,B19,B20,B21);Copy scratchpad
PAUSE 1000

The 9 is 1001 which is the reset plus strong pullup after the data.

Good luck.

Peter Anderson, http://www.phanderson.com/picaxe/
 

jmumby

Senior Member
Thanks for the replys

The SERTXD result for this is....

Code:
TA1-32 TA2-0 E/S-95 CRC-11421
95 Doesn't seem to relate to anything. It is possible I have accidentally write protected this part of the memory.

Thanks for the pull-up tip Peter, I was wondering how to do that!

I have few more chips on the way so I will try again with a new one.
 
Top