Page 1 of 1

expression syntax error

Posted: Fri Sep 16, 2022 5:10 am
by Roy
I am having an issue compiling to HEX for pic chip 16f1615.
The system returns a syntax error
test_16f1615.c: main()
480: FCV_VOLTS_IN = 0;
^ (195) expression syntax
(908) exit status = 1
(908) exit status = 1
The failure is always on the first line of the program after a C code box defining frequency.
I also note the frequency option for 16MHz is not offered in the build setup when using internal oscillator.
I have a similar project using 16f1709 , in both cases using a C code block to define speed and using both ADC and DAC within the chip and all is OK with the 16F1709 but not the 16F1615.
All programs run in the simulator OK.
What am I doing wrong? :?
I have attached test file with error log and the main program PIC_vaccum guage interface_v1.fcfx :?

Re: expression syntax error

Posted: Fri Sep 16, 2022 6:05 am
by QMESAR
Hi
you have to end the code in the C code block with a semicolon :D
When using the C code call you must comply to the C Code standards
adding the semicolon your code compile fine for me
P1.JPG
P1.JPG (58.22 KiB) Viewed 3941 times

Re: expression syntax error

Posted: Fri Sep 16, 2022 7:19 am
by Roy
Hi QMESAR
Thank you my friend. I feel such a fool.
It works now
Thank you :oops:

Re: expression syntax error

Posted: Fri Sep 16, 2022 7:33 am
by QMESAR
Hi Roy.

No that is a normal mistakes even experience C programmers make it so easy to get distracted and forget to add the semicolon :D
Happy you are ok now