Parallax, Inc. • BS2p “Plus Pack” (#45184) • 10/2001
Page 34
Display_Device_Type:
addr = devType * 2 + $600 ' calulate string pointer addr
STORE NamesPgm ' point to names EEPROM
READ addr,strPtr.LowByte ' get the string location
READ addr+1,strPtr.HighByte
Read_Char:
READ strPtr,char ' read character from string
IF (char = 0) THEN Dev_Type_Done ' at end? (0 = Yes)
DEBUG char ' no, print the char
strPtr = 1 ' point to next char
GOTO Read_Char
Dev_Type_Done:
STORE 0 ' point to main pgm slot
RETURN
' -----[ Title ]-----------------------------------------------------------
'
' BS2p Plus Pack
'
' File...... PP_OWNAMES.BSP
' Purpose... Device names for Dallas 1-Wire components
' Author.... Parallax
' E-mail.... [email protected]
' Started...
' Updated... 26 SEP 2001
' {$STAMP BS2p}
' -----[ Program Description ]---------------------------------------------
'
' There is no actual code in this module. This program stores the names
' of various Dallas Semiconductor 1-Wire devices. The device family code
' is used to map the strings in EEPROM. The pointer to a device's string
' discription is stored at the location determined by this formula:
'
' pointer = device_id * 2 + $600
'
' "pointer" is actually the low -byte of the address location. The high
' byte is at 1.
' -----[ Constants ]-------------------------------------------------------
'
PntrBase CON $600
' -----[ EEPROM Data ]-----------------------------------------------------
'
' Store strings first so labels can be used in address pointer table
'
Unknown DATA "Unknown device",0
' shared family codes
FCode01 DATA "DS1990/DS2401",0
FCode04 DATA "DS1994/DS2404",0
FCode10 DATA "DS1920/DS18S20",0
FCode14 DATA "DS1971/DS2430",0
FCode23 DATA "DS1973/DS2433",0
' iButtons