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
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.
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)
;--------------------------------------------------------------------------------------------------------
Last edited: