Maker Pro
Maker Pro

PIC18F8720 problem proteus and mplab

Microeus

Mar 16, 2011
1
Joined
Mar 16, 2011
Messages
1
Hi. I'm new to assembly language.I'm doing running light using 25 leds and pic18f8720. Testing on proteus. I'm unable to make it work.

Kindly see the attached source code and proteus dsn file. Hope some one can correct my mistakes here.

Source asm, hex and dsn files here:
http://www.4shared.com/file/mXSlyfpo/Project_mplab.html

Thank you.

circuit.jpg


#include<p18F8720.inc>

org 0X00
goto start
org 0X08
goto ISR_timer
org 0X18
goto ISR_reset
retfie

start setf TRISB;
clrf TRISD;
clrf TRISE;
clrf TRISF;
clrf TRISH;
clrf TRISJ;
BCF RCON,IPEN, A;
BSF INTCON,GIEH,A;
BSF INTCON,INT0IE;
goto patt1;

patt1 movlw B'00010101';
movwf PORTD,A;
movwf PORTE,A;
movwf PORTF,A;
movwf PORTH,A;
movwf PORTJ,A;
CALL ISR_timer;
CALL ISR_reset;
clrf WREG;
movlw B'00001010';
movwf PORTD,A;
movwf PORTE,A;
movwf PORTF,A;
movwf PORTH,A;
movwf PORTJ,A;
CALL ISR_timer;
CALL ISR_reset;
BTFSS PORTB,2,A;
goto patt1;
goto patt2;
patt2 movlw B'00011001';
movwf PORTD,A;
movwf PORTE,A;
movwf PORTF,A;
movwf PORTH,A;
movwf PORTJ,A;
CALL ISR_timer;
CALL ISR_reset;
clrf WREG;
movlw B'00000110';
movwf PORTD,A;
movwf PORTE,A;
movwf PORTF,A;
movwf PORTH,A;
movwf PORTJ,A;
CALL ISR_timer;
CALL ISR_reset;
BTFSS PORTB,2,A;
goto patt2;
goto patt3;
patt3 movlw B'00000111';
movwf PORTD,A;
movwf PORTE,A;
movwf PORTF,A;
movwf PORTH,A;
movwf PORTJ,A;
CALL ISR_timer;
CALL ISR_reset;
clrf WREG;
movlw B'00011000';
movwf PORTD,A;
movwf PORTE,A;
movwf PORTF,A;
movwf PORTH,A;
movwf PORTJ,A;
CALL ISR_timer;
CALL ISR_reset;
BTFSS PORTB,2,A;
goto patt3;
goto patt4;
patt4 movlw B'00000111';
movwf PORTD,A;
movwf PORTE,A;
movwf PORTF,A;
movwf PORTH,A;
movwf PORTJ,A;
CALL ISR_timer;
CALL ISR_reset;
clrf WREG;
movlw B'00011000';
movwf PORTD,A;
movwf PORTE,A;
movwf PORTF,A;
movwf PORTH,A;
movwf PORTJ,A;
CALL ISR_timer;
CALL ISR_reset;
BTFSS PORTB,2,A;
goto patt4;
goto patt5;
patt5 movlw B'00000111';
movwf PORTD,A;
movwf PORTE,A;
movwf PORTF,A;
movwf PORTH,A;
movwf PORTJ,A;
CALL ISR_timer;
CALL ISR_reset;
clrf WREG;
movlw B'00011000';
movwf PORTD,A;
movwf PORTE,A;
movwf PORTF,A;
movwf PORTH,A;
movwf PORTJ,A;
CALL ISR_timer;
CALL ISR_reset;
BTFSS PORTB,2,A;
goto patt5;
goto patt1;

ISR_reset BTFSS PORTB,1,A;
goto patt1;
return;


ISR_timer BCF T0CON,PSA;
BSF T0CON, 0;
BSF T0CON, 1;
BSF T0CON, 2;
MOVLW 0XB3;
MOVWF TMR0H;
MOVLW 0XB4;
MOVWF TMR0L;
BCF INTCON, TMR0IF;
BSF T0CON, TMR0ON;
BTFSS INTCON,TMR0IF;
RETURN;
END
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,505
Joined
Jan 21, 2010
Messages
25,505
I doubt that anyone is going to replicate your layout and attempt to debug it.

Perhaps you can tell us what it is supposed to do, what it does do, and what it doesn't do.
 
Top