I am trying to simulate using an iButton with VSM. Have put together the attached program and schematic. It appears that nothing happens when I run the code. I'm expecting to have the iButton return data. Can't see that there is any activity on the scope attached to C.0 9pin 10) of the PICAXE 20m2. Nothing going out or coming in.
Have successfully run a similar setup with a DS18B20 temp sensor and using the "readtemp" command and there is a good communication between the 20m2 and the DS18B20 sensor. I understand that this is a different setup with a different sensor. BUT!!!
It would sure help me if someone could look at my attached schematic and code.
Thanks in advance,
Jims
[ '#########################################################
'# Code to read a 1 wire device on PICAXE 20M2.
'# Read the device and show "family" code on OLED display.
'#########################################################
symbol device1=C.0 'Read iButton on C.0 (pin 10).
symbol oled= B.7 'OLED display is on B.7 (pin 11).
symbol family=b6 'b6 will contain iButton "family" code
symbol sw1=pinC.1 'C.1 (pin 9).
#picaxe 20m2
'setfreq m4
pause 30
main:
do
loop until sw1 is on
pause 100
readowsn C.0 ; Read the iButton serial number, etc. NOTE: "family" code will be in b6.
serout oled,N2400,(254,128," ") 'Clear OLED line 1
pause 30 'Mandatory pause
serout oled,N2400,(254,128,"FAMILY ",#family) 'Send data to OLED
pause 30 'Mandatory pause
pause 2000 ; Wait a while
goto main ; Repeat ]
Have successfully run a similar setup with a DS18B20 temp sensor and using the "readtemp" command and there is a good communication between the 20m2 and the DS18B20 sensor. I understand that this is a different setup with a different sensor. BUT!!!
It would sure help me if someone could look at my attached schematic and code.
Thanks in advance,
Jims
[ '#########################################################
'# Code to read a 1 wire device on PICAXE 20M2.
'# Read the device and show "family" code on OLED display.
'#########################################################
symbol device1=C.0 'Read iButton on C.0 (pin 10).
symbol oled= B.7 'OLED display is on B.7 (pin 11).
symbol family=b6 'b6 will contain iButton "family" code
symbol sw1=pinC.1 'C.1 (pin 9).
#picaxe 20m2
'setfreq m4
pause 30
main:
do
loop until sw1 is on
pause 100
readowsn C.0 ; Read the iButton serial number, etc. NOTE: "family" code will be in b6.
serout oled,N2400,(254,128," ") 'Clear OLED line 1
pause 30 'Mandatory pause
serout oled,N2400,(254,128,"FAMILY ",#family) 'Send data to OLED
pause 30 'Mandatory pause
pause 2000 ; Wait a while
goto main ; Repeat ]
Attachments
-
205.3 KB Views: 13