; Mouse Rover MK1
; For uni interviews
;
; Spec:
;
; Ultra Sonic SRF04
; Sharp IR Sensors x2
; Motor Control
; Wireless
; Motor Odomentry
; By MARTYN PITTUCK, Started 07 Nov 04 @ 9:30PM
; Start off by stating the processor and including the directives
Processor 18F452
include "P18F452.INC"
; Start of CUSTOM directives
prog_status Equ 0x00
; End of CUSTOM directives
; Bootloader start, same as interupt vector...
Org 0x0000
GOTO Main
Org 0x0008
GOTO int_server ; Goto the interupt server routine, need a interupt escape...
; Can escape if setup bit is not enabled
; START OF SETUP
setup
; Clear PORTA
BANKSEL PORTA ; Bank 1
MOVLW b'00000000' ; All Outputs low
MOVWF PORTA ; Clear PORTA, All Outputs Low. Bank Previously set
; Configure Analog on PORTA
BANKSEL ADCON1
MOVLW 0x07
MOVWF ADCON1
; Set TRISA
MOVLW b'00000000' ; All Outputs
MOVWF TRISA ; Move W to TRISA
; Set TRISB
MOVLW b'00000100' ; RB2[RX] is input
MOVWF TRISB ; Move W to TRISB
; Set PORTB
MOVLW b'00000000' ; All Outputs low
MOVWF PORTB ; Move W to PORTB
; For now we will use RB3 - but later all LED's will run off i2c bus...
BSF PORTB, 0x04 ; Turn Status LED On (Everything OK)
RETURN
; END OF SETUP ROUTINE
Main
RETURN
int_server
RETFIE
END