Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- init:
- clrf PORTB
- bsf STATUS, RP0
- movlw b'11111111'
- movwf TRISA
- movlw b'00000000'
- movwf TRISB
- bcf STATUS, RP0
- 'B,0 is the heater'
- 'B,1 is the fan'
- 'B,2 is the motor'
- 'B,4 is the LED'
- 'A,2 is the thermistor'
- 'A,3 is the button'
- Start:
- btfsc PORTA,2 'Is the temperature hot enough?'
- goto Hot 'If the temp is hot enough go to hot subroutine'
- nop 'Do nothing'
- btfss PORTA,2 'Is the temperature hot enough'
- goto Cold 'If the temp is too cold (pin is off) go to cold
- nop
- Main:
- call wait1000ms 'Wait 15 seconds'
- call wait1000ms
- call wait1000ms
- call wait1000ms
- call wait1000ms
- call wait1000ms
- call wait1000ms
- call wait1000ms
- call wait1000ms
- call wait1000ms
- call wait1000ms
- call wait1000ms
- call wait1000ms
- call wait1000ms
- call wait1000ms
- call wait1000ms
- movf Counter,W
- addlw 1
- addlw d'240'
- goto kill2
- goto kill 'Go to kill subroutine
- Hot:
- bcf PORTB,0 'Turn the heater off'
- bsf PORTB,1 'Turn the fan on'
- bsf PORTB,2 'Turn the motor on'
- goto Main
- Cold:
- bsf PORTB,0 'Turn the heater on'
- bsf PORTB,1 'Turn the fan on'
- bsf PORTB,2 'Turn the motor on'
- goto Main
- Kill:
- btfss PORTA,3 'If the kill switch is off go to decision
- goto Main
- btfsc PORTA,3 'If the kill switch is on then end the program
- nop
- bcf PORTB, 0 'Shut down the active pins'
- bcf PORTB, 1
- bcf PORTB, 2
- Kill2:
- nop
- bcf PORTB, 0 'Shut down the active pins'
- bcf PORTB, 1
- bcf PORTB, 2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement