iButton serial codes

jopooze

Member
For my electronics project I require the ability to differentiate between two iButtons. I can get the iButton to be detected however I am unable to detect a specific iButton serial code. If someone could tell me where I'm going wrong in my program that would be soooo helpful. Below is my current program.

Start:
let b6 = 0
let b7 = 0
let b8 = 0
let b9 = 0
let b10 = 0
let b11 = 0
let b12 = 0
let b13 = 0

Loop1:
readowsn b.1
if b6 =$37 and b7 =$00 and b8 =$00 and b9 =$17 and b10 =$6A and b11 =$88 and b12 =$74 and b13 =$01 then iButton1
if b6 =$A0 and b7 =$00 and b8 =$00 and b9 =$17 and b10 =$6A and b11 =$75 and b12 =$F5 and b13 =$01 then iButton2
Goto Loop1

iButton1:
high b.4
wait 2
low b.4
goto Start

iButton2:
high b.5
wait 2
low b.5
goto Start

I have two DS1990R#F5 iButtons and a Picaxe 18M2 linked up to the AXE091U. The codes on my iButtons from the top left code to top right code to the middle code (I don't know what each are enough to say) are as followed: iButton 1 - A0, 01, 0000176A75F5 iButton 2 - 37, 01, 0000176A8874.

Any help is greatly appreciated!
 

hippy

Ex-Staff (retired)
It could be that the codes you are testing for are not the actual codes which READOWSN is getting. If you put a DEBUG command after the READOWSN you will be able to see what codes are being read.
 

Alexrowland

New Member
I had this problem with my project too! I feel silly for not realising about the resistor, Also the debugging worked well!
:p
 
Top