Menu

GCGB Problem?

2010-06-30
2013-05-30
  • Nobody/Anonymous

    Today I used GCGB Version 0.9 14/2/2010 to generate the following program to turn an LED connected to GP0 (pin 7) of a PIC12F683 on and off:

    ;Chip Settings
    #chip 12F683,4

    Dir GPIO.0 Out
    main:
    Set GPIO.0 On
    Wait 0.5 s
    Set GPIO.0 Off
    Wait 0.5 s
    Goto main

    The program compiled and assembled without error, and simulated okay in MPLAB SIM, but didn't run correctly.  The LED connected to GP0 came on and stayed on.

    When I changed the 'Wait 0. 5 s' icons to 'Wait 500 ms', the program ran correctly:

    ;Chip Settings
    #chip 12F683,4

    Dir GPIO.0 Out
    main:
    Set GPIO.0 On
    Wait 500 ms
    Set GPIO.0 Off
    Wait 500 ms
    Goto main

    Thanks in advance for using this information to make GCGB better.

     
  • Hugh Considine

    Hugh Considine - 2010-07-04

    GCBASIC doesn't have any ability to deal with floating point numbers, so everything has to be done using whole numbers.

    I will add a bit to the help article to explain that, and a compiler error message so that it's a bit more obvious.

     

Log in to post a comment.