 NOLIST
;*******************************************************
;*                 Code Produced by the                *
;*           PROTON+ LITE Compiler. Version 3.0        *
;* Copyright Rosetta Technologies/Crownhill Associates *
;*              Written by Les Johnson. 2004           *
;*******************************************************
	LIST
;{
;FILE F1 = D:\PROTEUS\MYFILES\LABCENTER\1WIRE\DS1822_DESIGN\IDENTIF.BAS
;}
;[Variable Listing]
;SN,0035,DT_BYTE,8
;DQ,0006.7,DT_BIT
;[End Listing]
 LIST  P = 16F628A,f = INHX8M ,w = 2, x = on, r = DEC, mm = ON, n = 0, c = 255
 #include "c:\PROGRA~1\CROWNH~1\pdslite\INC\P16F628A.lpb"
 #define XTAL 4
 #define _CORE 14
 #define _MAXRAM 224
 #define _RAM_END 335
 #define _MAXMEM 2048
 #define _ADC 0
 #define _ADC_RES 0
 #define _EEPROM 128
 #define _PAGES 1
 #define _BANKS 3
 #define RAM_BANKS 3
 #define _USART 1
 #define _USB 0
 #define _FLASH 0
 #define BANK0_START 32
 #define BANK0_END 127
 #define BANK1_START 160
 #define BANK1_END 239
 #define BANK2_START 288
 #define BANK2_END 335
 #define _SYSTEM_VARIABLE_COUNT 21
ram_bank = 0
 #define LCD#TYPE 0
 #define CF_ADPORT_MASK#REQ 1
f@call macro dest
	if (dest < 1)
	else
	if (dest > $)
	else
	endif
	endif
	call dest
	endm
f@jump macro dest
	if (dest < 1)
	else
	if (dest > $)
	else
	endif
	endif
	goto dest
	endm
set@page macro dest
	endm
s@b	macro varin
	if((varin & 384) == 0)
	if(ram_bank == 1)
	bcf 3,5
	endif
	if(ram_bank == 2)
	bcf 3,6
	endif
	if(ram_bank == 3)
	bcf 3,5
	bcf 3,6
	endif
ram_bank = 0
	endif
	if((varin & 384) == 128)
	if(ram_bank == 0)
	bsf 3,5
	endif
	if(ram_bank == 2)
	bsf 3,5
	bcf 3,6
	endif
	if(ram_bank == 3)
	bcf 3,6
	endif
ram_bank = 1
	endif
	if((varin & 384) == 256)
	if(ram_bank == 0)
	bsf 3,6
	endif
	if(ram_bank == 1)
	bcf 3,5
	bsf 3,6
	endif
	if(ram_bank == 3)
	bcf 3,5
	endif
ram_bank = 2
	endif
	if((varin & 384) == 384)
	if(ram_bank == 0)
	bsf 3,5
	bsf 3,6
	endif
	if(ram_bank == 1)
	bsf 3,6
	endif
	if(ram_bank == 2)
	bsf 3,5
	endif
ram_bank = 3
	endif
	endm
r@b	macro
	if((ram_bank & 1) != 0)
	bcf 3,5
	endif
	if((ram_bank & 2) != 0)
	bcf 3,6
	endif
ram_bank = 0
	endm
 #include "c:\PROGRA~1\CROWNH~1\pdslite\INC\REG_LD14.INC"
BPF = 32
BPFH = 33
GEN = 34
GEN4 = 35
GEN4H = 36
GENH = 37
GPR = 38
PBP#VAR0 = 39
PP0 = 40
PP0H = 41
PP1 = 42
PP1H = 43
PP2 = 44
PP2H = 45
PP3 = 46
PP3H = 47
PP4 = 48
PP5 = 49
PP6 = 50
PP6H = 51
SP#P9 = 52
	org 0
	goto Start@
lcd@cls movlw 128
	movwf 33
cls movlw 254
	call ch@snd
	movlw 1
	call ch@snd
	movlw 117
	movwf 41
	movlw 48
	goto dlus@w
lcd@crs clrf 33
	bsf 33,7
curs@ movwf 49
	movlw 254
	call ch@snd
	movfw 49
	goto ch@snd
out@hexb
	clrf 36
out@hexc
	movwf 44
	clrf 45
out@hex
	bcf 32,3
	movfw 36
	skpnz
	bsf 32,3
	movlw 4
	movwf 35
	swapf 45,w
	call h@dig
	movfw 45
	call h@dig
	swapf 44,w
	call h@dig
	movfw 44
h@dig andlw 15
	addlw 246
	skpnc
	addlw 7
	addlw 10
send@it movwf 40
	decf 35,f
	skpnz
	bcf 32,3
	movfw 36
	skpnz
	goto $ + 4
	subwf 35,w
	skpnc
	goto ex@send@it
	movfw 40
	skpz
	bcf 32,3
	btfsc 32,3
	goto ex@send@it
	addlw '0'
	goto ch@snd
ex@send@it
	return
RSOUT_PORT = PORTA
RSOUT_PIN = 0
RSOUT_MODE = 0
SERIAL_BAUD = 9600
rsout movwf 38
	movwf PP1
	bsf 3,5
	bcf PORTA,0
	bcf 3,5
	movlw 9
	movwf 43
	clrc
	call rso@bit
	rrf 42,f
	decfsz 43,f
	goto $ - 3
	setc
	call rso@bit
	movfw 38
	goto i@nt
rso@bit skpnc
	goto $ + 4
	nop
	bcf PORTA,0
	goto Sr@dly
	bsf PORTA,0
	goto Sr@dly
sr@dly movlw 0
	movwf 41
	movlw 91
	goto dlus@w
ch@snd
	btfsc 33,6
	goto rsout
ow@out movwf 42
	movlw 8
	btfsc 38,2
	movlw 1
	movwf 43
ow@otlp rrf 42,f
	movfw 34
	movwf 4
	movfw 37
	xorlw 255
	andwf 0,f
	bsf 4,7
	andwf 0,f
	movfw 37
	skpnc
	iorwf 0,f
	movlw 60
	call dl@us
	movfw 37
	iorwf 0,f
	decfsz 43,f
	goto ow@otlp
	setc
	goto i@nt
ow@in movlw 8
	btfsc 38,2
	movlw 1
	movwf 43
	clrf 42
	movfw 34
	movwf 4
ow@inlp movfw 37
	xorlw 255
	andwf 0,f
	bsf 4,7
	andwf 0,f
	movfw 37
	iorwf 0,f
	bcf 4,7
	andwf 0,w
	addlw 255
	btfss 38,2
	rrf 42,f
	btfsc 38,2
	rlf 42,f
	movlw 50
	call dl@us
	decfsz 43,f
	goto ow@inlp
	movfw 42
	setc
	goto i@nt
ow@rst2 movwf 38
	btfss 38,0
	goto i@nt
ow@rst movfw 34
	movwf 4
	movfw 37
	xorlw 255
	andwf 0,f
	bsf 4,7
	andwf 0,f
	movlw 1
	movwf 41
	movlw 244
	call dlus@w
	movfw 37
	iorwf 0,f
	movlw 1
	movwf 41
	movlw 244
	goto dlus@w
dl@ms clrf 43
dly@w movwf 42
dly@p movlw 255
	addwf 42,f
	skpc
	addwf 43,f
	skpc
	goto i@nt
	movlw 3
	movwf 41
	movlw 223
	call dlus@w
	goto $ - 10
dl@us clrf 41
dlus@w addlw 232
	movwf 40
	comf 41,f
	movlw 252
	skpc
	goto $ + 4
	addwf 40,f
	skpnc
	goto $ - 2
	addwf 40,f
	nop
	incfsz 41,f
	goto $ - 6
	btfsc 40,0
	goto $ + 1
	btfss 40,1
	goto $ + 3
	nop
	goto $ + 1
	return
i@nt bcf 3,7
i@nt2 bcf 3,5
	bcf 3,6
	nop
	return
Start@
	clrf 32
