Parallax, Inc. • BS2p “Plus Pack” (#45184) • 10/2001
Page 32
PP_OWID.BSP
' -----[ Title ]-----------------------------------------------------------
'
' BS2p Plus Pack
'
' File...... PP_OWID.BSP
' Purpose... Reads ROM data from 1-Wire device
' Author.... Parallax
' E-mail.... [email protected]
' Started...
' Updated... 26 SEP 2001
' {$STAMP BS2p, PP_OWNAMES.BSP}
' -----[ Program Description ]---------------------------------------------
'
' Reads 1-Wire device ROM pattern. Data is displayed in DEBUG window
'
' If using the iButton socket on the BS2p demo board, install Jumper iB1.
'
' If using a "Blue Dot Receptor" (RJ -11 connection) with the BS2p Demo
' Board, install Jumper iB2
'
' Do not connect more than one device.
' -----[ I/O Definitions ] -------------------------------------------------
'
OWpin CON 15 ' 1 -wire device pin
' -----[ Constants ]-------------------------------------------------------
'
' 1-Wire Support
'
OW_FERst CON %0001 ' Front-End Reset
OW_BERst CON %0010 ' Back-End Reset
OW_BitMode CON %0100
OW_HighSpd CON %1000
ReadROM CON $33 ' read ID, serial num, CRC
SearchROM CON $F0 ' search
NoDevice CON %11 ' no device present
NamesPgm CON 1 ' names are stored in slot 1
' -----[ Variables ]-------------------------------------------------------
'
idx VAR Byte ' loop counter
romData VAR Byte(8) ' ROM data from device
devType VAR romData
devCheck VAR Nib ' device check return ocde
addr VAR Word ' address of string pointer
strPtr VAR Word ' string pointer (device address)
char VAR Byte ' character for LCD