iButton

StigOfTheDump

Senior Member
Hi

I bought an iButton lock kit but am building it on my AXE091 development board with an 18M rather than the 08M and pcb supplied.

I've read a few threads on the subject and realise now that I will need to remove the pull down on the input.

Does anyone know how to read the serial number? It appears to be read from the right but do you need to reverse the numbers in the individual bytes?

ie 98.............01
...000013908B4F

Would this be 01,4F,8B,90,13,00,00,98 or 10,F4,B8,09,31,00,00,89

Also which is the 0v lead of the button? The diagram in the manual has the D & G the opposite way round than the pcb.
 

westaust55

Moderator
The face qwith the text on is the signal/supply contact.
The face with the rib/lip on the outer periphery is the ground/0V contact.

To read the serial number, you use the readowsn command

See PICAXE manual 2 (V7.1) page 181

wrt the serial number, the 98 is the crc value and the 01 is the ibutton type/class.
the number in the middle are as read from the face in hexadecimal.

EDIT: have a read of the tutorial in this thread: http://www.picaxeforum.co.uk/showthread.php?t=15306
 
Last edited:

StigOfTheDump

Senior Member
Sorry, perhaps I wasn't very clear in my question.

I was wanting to know which wire green/blue was the ground contact, but I can now see that the blue wire is connected to the casing so must be ground.

I was wanting to know how to manually read the serial number. The example in the manual shows it is read from the right, but in that example all the bytes have the most significant and least significant bits the same.

ie $FF,$00,$11,$22,$33,$44,$55,$CC

The example code tests if the iButton being checked matches the code programmed but I am not sure what this code should be.
 

Andrew Cowan

Senior Member
To find out, just use the redowsn command to read it, then the debug command to output that data. Much easier than reading it off the chip.

Andrew
 

westaust55

Moderator
To find out, just use the redowsn command to read it, then the debug command to output that data. Much easier than reading it off the chip.
yes, the readowsn command was indicated in post 2.
It is the only "direct 1-wire" command that will work with the "M" parts.
(other than READTEMP which is a special and specific command)

Only the X1 and X2 parts have further 1-wire commands to separately read in the serial number or perform other 1-wire funcitons.

@StigOfTheDump
Not quite sure (in the context of the above) what you mean by
"how to manually read the serial number".

From your original post 1,
01,4F,8B,90,13,00,00,98

where $01 is the device type, $98 is the cyclic redundancy code part and the rest forms the rest of unique part of the serial number.
 
Top