Hello everyone,
I am having some issues building this code and understanding whats wrong. I am using the PIC16F84A in MPLAB in absolute compile. The bottom is my code and the attachment is my error messages which i don't understand what to change. Essentially i am trying to build a code that has three switches and six LED's. Three LED's are suppose to be the complements of the other three LED's. Please help me!
I am having some issues building this code and understanding whats wrong. I am using the PIC16F84A in MPLAB in absolute compile. The bottom is my code and the attachment is my error messages which i don't understand what to change. Essentially i am trying to build a code that has three switches and six LED's. Three LED's are suppose to be the complements of the other three LED's. Please help me!
Rich (BB code):
;Flashing Lights Project 1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Define Labels
status equ 03; status changes from bank 1 to 0 and vice versa
porta equ 05; 05h file address
portb equ 06;
trisa equ 85;
trisb equ 85;
mem1 equ 0 ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Macro Setup
;
START bsf status,5 ;
movlw b'00011111' ;
movwf trisa;
movlw b'00000000'
movwf trisb;
bcf status,5;
clrf portb;
mend
CLRF PORTB;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Start of Program
movlw b'00000101'; must double check
movwf mem1
movf portb;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Complements
btfss portb,0
bsf portb,3
btfss portb,1
bsf portb,4
btfss portb,2
bsf portb,5
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;I/O
begin bsf portb,0;
bsf portb,1;
bsf portb,2;
bsf portb,3;
bsf portb,4;
bsf portb,5;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;reset portb
bcf portb,0;
bcf portb,1;
bcf portb,2;
bcf portb,3;
bcf portb,4;
bcf portb,5;
end
Attachments
-
105.6 KB Views: 27
Last edited by a moderator: