Connect with us

PIC18F8720 problem proteus and mplab

Discussion in 'Microcontrollers, Programming and IoT' started by Microeus, Mar 16, 2011.

Scroll to continue with content
  1. Microeus

    Microeus

    1
    0
    Mar 16, 2011
    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.

    [​IMG]

    #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
     
  2. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,500
    2,840
    Jan 21, 2010
    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.
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-