syntax error


Closed Thread
Results 1 to 3 of 3

Thread: syntax error

  1. #1
    Join Date
    Jun 2008
    Location
    Chicago suburb
    Posts
    5

    Question syntax error

    Could somebody point out to me what is wrong with my code?
    I don't know where I went wrong.

    __________________________________________________ __________________________
    TRISB = %11111111 'PORT B ALL INPUTS
    TRISA = %00000000 'PORT A ALL OUTPUTS

    WAIT IF PORTB.3 = 1 THEN TIMEON 'WAIT UNTIL INPUT PULSE ARRIVES
    ENDIF
    GOTO WAIT 'LOOP BACK TO WAIT

    TIMEON HIGH PORTA.1 'PULSE ARRIVED AT PIN 4 SET PIN 9
    'HIGH
    PAUSE 10 'PAUSE FOR 10 msec

    LOW PORTA.1 'SET PORT A BACK TO LOW

    GOTO WAIT 'RETURN BACK TO WAIT
    __________________________________________________ _________________________

    All this programm does it takes a pulse in on port b pin 3 and sets an output
    port a pin 1 high for an extended time of 10mS (the input is only 50uS wide)
    The syntax error starts at the lable 'WAIT' and goes all the way down to the end.
    I have not worked with PBP for a while and in the past I used the DOS version and
    I had no problems with it.

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    WAIT is a reserved word. It belong to some Serial communication command such as SERIN2, DEBUGIN and HSERIN.

    There's a list of reserved word in your manual.

    Usually, wen you define LAbel, you should add a colon after it.
    Code:
            TRISB = %11111111           'PORT B ALL INPUTS
            TRISA = %00000000           'PORT A ALL OUTPUTS
    
    WaitingForSomething:
            IF PORTB.3 = 1 THEN TIMEON  'WAIT UNTIL INPUT PULSE ARRIVES
        
            GOTO WaitingForSomething    'LOOP BACK TO WAIT
    
    TIMEON:
            HIGH PORTA.1                'PULSE ARRIVED AT PIN 4 SET PIN 9
            PAUSE 10                    'PAUSE FOR 10 msec
            LOW PORTA.1                 'SET PORT A BACK TO LOW
            GOTO WaitingForSomething    'RETURN BACK TO WAIT
    HTH
    Last edited by mister_e; - 7th June 2008 at 23:52.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    Join Date
    Jun 2008
    Location
    Chicago suburb
    Posts
    5


    Did you find this post helpful? Yes | No

    Smile mister e

    Thank you very much. I knew it had to be something like that.
    It is compiling ok now.
    Thank you again

    Gerd

Similar Threads

  1. Compile error & syntax error on the word "loop:" as a label?
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 7th March 2010, 04:14
  2. Loop with two motor and 2 sensors
    By MrRoboto in forum mel PIC BASIC
    Replies: 4
    Last Post: - 8th December 2008, 23:40
  3. Optimizing DIV
    By skimask in forum mel PIC BASIC Pro
    Replies: 41
    Last Post: - 22nd September 2008, 04:58
  4. 16F88 Compile error
    By Toley00 in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 2nd November 2005, 00:22
  5. Syntax error PIC16F684
    By milestag in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 21st September 2005, 18:54

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts