Menu

Syntax error with pulseout command?

lhatch
2011-10-23
2013-05-30
  • lhatch

    lhatch - 2011-10-23

    I loaded all the GCB programs.  Have this sample program.  Like 27 with the error is a pulseout.  I re-typed it and it is from the manual or a sample, just change the chips to 16F88 and internal osc.

    #chip 16F88, 8
    #config osc = int

    #define BUTTON PORTB.0
    #define SPEAKER PORTB.1
    #define LIGHT PORTB.2
    Dir BUTTON In
    Dir SPEAKER Out
    Dir LIGHT Out

    'Assumes Button switches on when pressed
    Wait Until BUTTON = 1
    Wait Until BUTTON = 0

    Do
        'Flash the light
        Set LIGHT On
        Wait 500 ms
        Set LIGHT Off

        'Produce the tone
        '440 Hz = 880 changes = tone on for 1.14 ms
        Repeat 440
            PulseOut SPEAKER, 1140 us
            Wait 114 10us 'Wait for 114 x 10 us (1.14 ms)
        End Repeat
    Loop


    Get a syntax error and no details?

    Could not find localised message file C:\PROGRA~1\GCBASIC/messages-en.dat
    Great Cow BASIC (0.9 19/7/2011)

    Compiling test.bas …

         Finding source files:
              test.bas: found
              C:\PROGRA~1\GCBASIC\INCLUDE\LOWLEVEL\a-d.h: found
              C:\PROGRA~1\GCBASIC\INCLUDE\LOWLEVEL\pwm.h: found
              C:\PROGRA~1\GCBASIC\INCLUDE\LOWLEVEL\rs232.h: found
              C:\PROGRA~1\GCBASIC\INCLUDE\LOWLEVEL\eeprom.h: found
              C:\PROGRA~1\GCBASIC\INCLUDE\LOWLEVEL\sound.h: found
              C:\PROGRA~1\GCBASIC\INCLUDE\LOWLEVEL\stdbasic.h: found
              C:\PROGRA~1\GCBASIC\INCLUDE\LOWLEVEL\7segment.h: found
              C:\PROGRA~1\GCBASIC\INCLUDE\LOWLEVEL\lcd.h: found
              C:\PROGRA~1\GCBASIC\INCLUDE\LOWLEVEL\ps2.h: found
              C:\PROGRA~1\GCBASIC\INCLUDE\LOWLEVEL\timer.h: found
              C:\PROGRA~1\GCBASIC\INCLUDE\LOWLEVEL\system.h: found
              C:\PROGRA~1\GCBASIC\INCLUDE\LOWLEVEL\hwspi.h: NOT FOUND!
              C:\PROGRA~1\GCBASIC\INCLUDE\LOWLEVEL\keypad.h: found
              C:\PROGRA~1\GCBASIC\INCLUDE\LOWLEVEL\random.h: NOT FOUND!
              C:\PROGRA~1\GCBASIC\INCLUDE\LOWLEVEL\string.h: NOT FOUND!
              C:\PROGRA~1\GCBASIC\INCLUDE\LOWLEVEL\usart.h: found
              C:\PROGRA~1\GCBASIC\INCLUDE\LOWLEVEL\i2c.h: NOT FOUND!
              C:\PROGRA~1\GCBASIC\INCLUDE\LOWLEVEL\hwi2c.h: NOT FOUND!
         Loading source files …                               74%
         Reading compiler directives …
         Reading chip data …
              C:\PROGRA~1\GCBASIC\chipdata\16F88.dat

              Chip Settings:
                   Chip Model: 16F88
                   Chip Family: PIC (14)
                   Clock MHz: 8
                   RAM: 368
         Running compiler scripts …

         Building memory map …

         Finding and compiling #IFDEF directives …
         Replacing defines with values …                      100%
         Compiling subroutines/functions:
              Main
              INITSYS
              Delay_10US
              Delay_MS

         Allocating RAM to variables …

         Tidying Code …

         Locating subroutines in program memory …
         Calculating CONFIG …

         Writing output to test.asm …

    An error has been found:

    test.bas (27): Error: Syntax Error

    The message has been logged to the file Errors.txt.

    Press any key to continue

     
  • gcha44

    gcha44 - 2011-10-23

    Hi, I tried your program and it compiles fine with 16F88 with GCBasic compiler  and Mpasm with no error !
    Pulseout subroutine  is in stdbasic.h . When you download GCBasic You'll not find messages-en.dat but only messages.dat !
    Try again to download GCBasic update .
    GC

     
  • lhatch

    lhatch - 2011-10-24

    Well, I loaded it at work and it works fine.  ZIP the whole \Program Files\GCBASIC and put it back on the home PC.  Still the same problem.  Only thing, the work machine says found when it loads .h files and you are right some where missing.

    i copied them over and all is good.  looking forward to gcbasic.

    i have bought melabs pb (junk with no endif and bought it like 10-15 years ago). bought mbasic (bloat still on the shelf too)  use mikrobasic for a bit, got back into pics and found mikebasic is too complicated when you want to write a program, compile and program.  not spend all days trying to get a project started from an old one.

    i found i can do interrupts in gcbiasc and on interrupts from old sample programs from the past.  so excited.  would be nice to see usb down the road, but not need by me right now.

    i know gcbasic will not have all the hand holding (some bumps in the road for sure; eg no answer without minutes), but will go for it since it is lean and mean.  just have to know what the chips will do and best prick for a project and convince gcb i got it all right.

    thanks again.

     

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.