Menu

Sorry.. not really an error with delay.

Santiago
2009-01-24
2013-05-30
  • Santiago

    Santiago - 2009-01-24

    Is really not an error but something that doesn't work as expected...

    The same code in my last post :
    _______________________________________________________________________

    do while true

        set LED1 ON

        rebote = ReadAD(AN0)
        set LED1 OFF

        set LED2 ON
        wait (rebote - ReadAD(AN0)) ms  ' THIS DELAY
        set LED2 OFF
       

    loop

    _______________________________________________________________________

    In generated .asm there is only the 10us routine, but the ms one is missing:

    ;********************************************************************************
    ;Subroutines included in program
    ;********************************************************************************

    Delay_10US
    D10US_START
        movlw    16
        movwf    DELAYTEMP
    D10US_LOOP
        decfsz    DELAYTEMP, F
        goto    D10US_LOOP
        decfsz    SysWaitTemp10US, F
        goto    D10US_START
        return

    ;********************************************************************************

    FN_READAD
        banksel    ADCON1
            ..............
            .............
    ;********************************************************************************

    When assembling  i have the error: Symbol not previously defined (Delay_MS)

    This code works ok:
    ______________________________________________________________________________

    do while true

        set LED1 ON

        rebote = ReadAD(AN0)
        set LED1 OFF

        set LED2 ON
        tiempo = rebote - ReadAD(AN0)
        wait tiempo ms
        set LED2 OFF

    loop

    _____________________________________________________________________________

    Just to report this behavior....

    greatings.

     
    • Hugh Considine

      Hugh Considine - 2009-01-24

      The update should solve this as well, the compiler wasn't dealing with spaces in the Wait command properly. Thanks for reporting the bug!

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.