Menu

Timing issue

Help
2009-10-05
2013-05-30
  • Nobody/Anonymous

    Hey,
    I bet its something really stupid, but i just cant get it:
    but for some reason my 1sec takes exactly 4sec…

        #chip 16F84A, 20
        #osc HS
        dir PORTA.1 out
        do while true
        SET PORTA.1 ON
        wait 1 sec
        set porta.1 off
        wait 1 sec
        loop

    So for some reason, my LED blinks for 4 sec, and I bet it's the same reason that prevents me from getting my LCD to work.
    Thx Mexx

     
  • Nobody/Anonymous

    Yes… i think there is a bug in the compiler… look to this:
    http://sourceforge.net/projects/gcbasic/forums/forum/596084/topic/3419737

    Have a look to the asm, you have this:

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

    ;Set aside memory locations for variables

    DELAYTEMP EQU 112

    DELAYTEMP2 EQU 113

    SysWaitTempMS EQU 114

    SysWaitTempMS_H EQU 115

    SysWaitTempS EQU 116

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

    But 16f84a has no registers>79
    . You can edit your asm and assemble it with this values:

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

    ;Set aside memory locations for variables

    DELAYTEMP EQU 20

    DELAYTEMP2 EQU 21

    SysWaitTempMS EQU 22

    SysWaitTempMS_H EQU 23

    SysWaitTempS EQU 23

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

    It should work if no other errors.

     

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.