MPLab animate problem

Discussion in 'Programmer's Corner' started by jpanhalt, Dec 8, 2008.

  1. jpanhalt

    Thread Starter AAC Fanatic!

    Jan 18, 2008
    5,676
    899
    I have been experimenting with using some simulator functions of MPLab, namely the stopwatch and stimulus. Part of my program is this simple code for a delay. I put breakpoints at the second decfsz and nop. Using "animate," only the breakpoint at decfsz is found. If I inactivate that breakpoint, it loops continuously. However, when I use "run", it stops at the NOP and gives an accurate time with the stopwatch.

    Why doesn't it stop at the NOP breakpoint with animate, but does with run?

    Thanks.

    John
    (I have not cleaned up the Microchip template)

    Code ( (Unknown Language)):
    1.  
    2. ;***** VARIABLE DEFINITIONS
    3.     d1  equ d'9'
    4.     d2  equ d'14'
    5.  
    6. ;**********************************************************************
    7.     ORG     0x3FF             ; processor reset vector
    8.     movlw   0x50
    9. ; Internal RC calibration value is placed at location 0x3FF by Microchip
    10. ; as a movlw k, where the k is a literal value.
    11.  
    12.     ORG     0x000             ; coding begins here
    13.     movwf   OSCCAL            ; update register with factory cal value
    14.     movlw   b'11011011'
    15.     tris    GPIO
    16.     movlw   b'00000000'
    17.     option
    18.  
    19.  
    20.  
    21. start  
    22.     movlw   0x06
    23.     movwf   d1
    24.     movlw   0x08
    25.     movwf   d2
    26. Delay_0
    27.     decfsz  d1,f
    28.     goto    $+2
    29.     decfsz  d2,f
    30.     goto    Delay_0
    31.     goto    $+1
    32.     nop
    33.  
    34.     END    
    35.  
     
Loading...