summaryrefslogtreecommitdiff
path: root/electronics/asm/temp.ba~
blob: d9a68892bced15f67e36019209f19e1325d69026 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
start: 
init: 
	clrf    PORTA          	; make sure port A output latches are low 
	clrf    PORTB          	; make sure port B output latches are low 
	bsf     STATUS,RP0     	; select memory bank 1 
	movlw 	b'11111111'    	; set port A data direction to inputs 
	movwf   TRISA         
	movlw   b'00000000'    	; set port B data direction to outputs 
	movwf   TRISB          
	bcf     STATUS,RP0     	; select memory bank 0 

	;bsf	INTCON, INT0IE
	;bsf	INTCON, GIE

	rawtemp EQU B6

	goto    main 
showme:
	movlw 	255
	movwf 	PORTB
	goto 	main
main: 
	call 	readadc1 	; read the thermistor (at room tem its 73)
	movf	B1, W
	movwf	rawtemp

	call	readadc0
	movf	B0, W

	subwf	rawtemp, w
	btfsc	STATUS, 0
	goto 	showme 

	movlw	0 
	movwf 	PORTB

	goto 	main

	END		       	; ends the program