PDA

View Full Version : syntax error



Gerd
- 7th June 2008, 23:44
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.

mister_e
- 7th June 2008, 23:47
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.

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

Gerd
- 8th June 2008, 01:49
Thank you very much. I knew it had to be something like that.
It is compiling ok now.
Thank you again

Gerd