Problem with compilation
Moderator: Benj
-
- Posts: 79
- Joined: Mon Aug 03, 2009 12:14 pm
Problem with compilation
Hello! I am doing now 3.2.6 Lab 3 "Higher Resolution Sensor Readings Using a Single
Comparator" http://ww1.microchip.com/downloads/en/D ... 41381A.pdf (page 79) replacing the controller PIC16F690 to PIC16F877. The project does not compile to HEX file in Flowcode 4. Where I made a mistake?
Comparator" http://ww1.microchip.com/downloads/en/D ... 41381A.pdf (page 79) replacing the controller PIC16F690 to PIC16F877. The project does not compile to HEX file in Flowcode 4. Where I made a mistake?
- Attachments
-
- 3.fcf
- flowcode project
- (12 KiB) Downloaded 343 times
Respectfully, Alexander
-
- Posts: 79
- Joined: Mon Aug 03, 2009 12:14 pm
Re: Problem with compilation
Thanks, but I do not see the button "new topic" in this forum. Do you think the problem is in the program Flowcode4? I thought that maybe I was wrong somewhere. On Monday, I'll do this algorithm in the program Flowcode3, will see how to compile it.
Respectfully, Alexander
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Problem with compilation
Hello Alexander
The very first topic in the Flowcode V4 forum explains how you can sign up to create posts.
http://www.matrixmultimedia.com/mmforum ... =29&t=6524
The very first topic in the Flowcode V4 forum explains how you can sign up to create posts.
http://www.matrixmultimedia.com/mmforum ... =29&t=6524
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 79
- Joined: Mon Aug 03, 2009 12:14 pm
-
- Posts: 79
- Joined: Mon Aug 03, 2009 12:14 pm
Re: Problem with compilation
Now I attached two flowcode 3 projects.
The original project for the 16F690 is compiled without problems.
Another project is a conversion for the 16F887 does not compile, probably somewhere an error in C code:
F:\Microcintrollers\Flowcode projects\labs-flowecode3\6\3\16F887\16F887.c(76:8): error: unknown identifier 'TRISA5'
F:\Microcintrollers\Flowcode projects\labs-flowecode3\6\3\16F887\16F887.c(76:8): error: unexpected '.' operator
F:\Microcintrollers\Flowcode projects\labs-flowecode3\6\3\16F887\16F887.c(76:2): error: failed to generate expression
F:\Microcintrollers\Flowcode projects\labs-flowecode3\6\3\16F887\16F887.c(76:2): error: invalid operand 'trisa.TRISA5'
F:\Microcintrollers\Flowcode projects\labs-flowecode3\6\3\16F887\16F887.c(76:15): error: failed to generate expression
F:\Microcintrollers\Flowcode projects\labs-flowecode3\6\3\16F887\16F887.c(78:8): error: unknown identifier 'TRISA4'
F:\Microcintrollers\Flowcode projects\labs-flowecode3\6\3\16F887\16F887.c(78:8): error: unexpected '.' operator
F:\Microcintrollers\Flowcode projects\labs-flowecode3\6\3\16F887\16F887.c(78:2): error: failed to generate expression
F:\Microcintrollers\Flowcode projects\labs-flowecode3\6\3\16F887\16F887.c(78:2): error: invalid operand 'trisa.TRISA4'
F:\Microcintrollers\Flowcode projects\labs-flowecode3\6\3\16F887\16F887.c(78:15): error: failed to generate expression
16F887.c success
failure
Return code = 1
Flowcode was unable to compile the flowchart's C code due to the following errors:
If your flowchart contains C code, please review this carefully. If your flowchart contains no C-code or you have thoroughly reviewed the code, contact Technical Support.
FINISHED
Where I made a mistake?
The original project for the 16F690 is compiled without problems.
Another project is a conversion for the 16F887 does not compile, probably somewhere an error in C code:
F:\Microcintrollers\Flowcode projects\labs-flowecode3\6\3\16F887\16F887.c(76:8): error: unknown identifier 'TRISA5'
F:\Microcintrollers\Flowcode projects\labs-flowecode3\6\3\16F887\16F887.c(76:8): error: unexpected '.' operator
F:\Microcintrollers\Flowcode projects\labs-flowecode3\6\3\16F887\16F887.c(76:2): error: failed to generate expression
F:\Microcintrollers\Flowcode projects\labs-flowecode3\6\3\16F887\16F887.c(76:2): error: invalid operand 'trisa.TRISA5'
F:\Microcintrollers\Flowcode projects\labs-flowecode3\6\3\16F887\16F887.c(76:15): error: failed to generate expression
F:\Microcintrollers\Flowcode projects\labs-flowecode3\6\3\16F887\16F887.c(78:8): error: unknown identifier 'TRISA4'
F:\Microcintrollers\Flowcode projects\labs-flowecode3\6\3\16F887\16F887.c(78:8): error: unexpected '.' operator
F:\Microcintrollers\Flowcode projects\labs-flowecode3\6\3\16F887\16F887.c(78:2): error: failed to generate expression
F:\Microcintrollers\Flowcode projects\labs-flowecode3\6\3\16F887\16F887.c(78:2): error: invalid operand 'trisa.TRISA4'
F:\Microcintrollers\Flowcode projects\labs-flowecode3\6\3\16F887\16F887.c(78:15): error: failed to generate expression
16F887.c success
failure
Return code = 1
Flowcode was unable to compile the flowchart's C code due to the following errors:
If your flowchart contains C code, please review this carefully. If your flowchart contains no C-code or you have thoroughly reviewed the code, contact Technical Support.
FINISHED
Where I made a mistake?
- Attachments
-
- 16F887.fcf
- (5 KiB) Downloaded 295 times
-
- 16F690.fcf
- (5 KiB) Downloaded 311 times
Respectfully, Alexander
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Problem with compilation
Hello
To fix the compilation error try replacing the lines.
trisa.TRISA5 = 0;
with this.
trisa.5 = 0;
or
clear_bit(trisa, 5);
or
trisa = trisa & 0xDF;
Similarily
trisa.TRISA4 = 0;
can be replaced with any of these.
trisa.4 = 0;
or
clear_bit(trisa, 4);
or
trisa = trisa & 0xEF;
Alternativly you could replace both lines of code with this single line.
trisa = trisa & 0xCF;
The error messages are telling you that the problem is on lines 76 and 78 of your C code file. To see which lines of code are causing problems simply compile to C and then lookup the appropriate line in the C code file using a text editor such as textpad or context.Another project is a conversion for the 16F887 does not compile, probably somewhere an error in C code:
F:\Microcintrollers\Flowcode projects\labs-flowecode3\6\3\16F887\16F887.c(76:8): error: unknown identifier 'TRISA5'
F:\Microcintrollers\Flowcode projects\labs-flowecode3\6\3\16F887\16F887.c(76:8): error: unexpected '.' operator
F:\Microcintrollers\Flowcode projects\labs-flowecode3\6\3\16F887\16F887.c(76:2): error: failed to generate expression
F:\Microcintrollers\Flowcode projects\labs-flowecode3\6\3\16F887\16F887.c(76:2): error: invalid operand 'trisa.TRISA5'
F:\Microcintrollers\Flowcode projects\labs-flowecode3\6\3\16F887\16F887.c(76:15): error: failed to generate expression
F:\Microcintrollers\Flowcode projects\labs-flowecode3\6\3\16F887\16F887.c(78:8): error: unknown identifier 'TRISA4'
F:\Microcintrollers\Flowcode projects\labs-flowecode3\6\3\16F887\16F887.c(78:8): error: unexpected '.' operator
F:\Microcintrollers\Flowcode projects\labs-flowecode3\6\3\16F887\16F887.c(78:2): error: failed to generate expression
F:\Microcintrollers\Flowcode projects\labs-flowecode3\6\3\16F887\16F887.c(78:2): error: invalid operand 'trisa.TRISA4'
F:\Microcintrollers\Flowcode projects\labs-flowecode3\6\3\16F887\16F887.c(78:15): error: failed to generate expression
To fix the compilation error try replacing the lines.
trisa.TRISA5 = 0;
with this.
trisa.5 = 0;
or
clear_bit(trisa, 5);
or
trisa = trisa & 0xDF;
Similarily
trisa.TRISA4 = 0;
can be replaced with any of these.
trisa.4 = 0;
or
clear_bit(trisa, 4);
or
trisa = trisa & 0xEF;
Alternativly you could replace both lines of code with this single line.
trisa = trisa & 0xCF;
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 79
- Joined: Mon Aug 03, 2009 12:14 pm
Re: Problem with compilation
Thank you, now it compiles, but the program still does not fully working. Although, the oscilloscope shows the presence of pulses on RA5 (C2OUT) 16F887, display does not work. Perhaps I am somewhere else was wrong, I will seek. It is necessary to verify C code for 16F887, not only the syntax
- Attachments
-
- 16F887.fcf
- (5 KiB) Downloaded 313 times
Respectfully, Alexander
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Problem with compilation
Hello
Your timer interrupt seems to be configured to accept the external clock "T0CKI" rather then the "CLKO" internal clock. This could be why your program is not running as expected.
Your timer interrupt seems to be configured to accept the external clock "T0CKI" rather then the "CLKO" internal clock. This could be why your program is not running as expected.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 79
- Joined: Mon Aug 03, 2009 12:14 pm
Re: Problem with compilation
So in the manual about this program stated: T0CKI pin a digital input (external) (page 81 http://ww1.microchip.com/downloads/en/D ... 41381A.pdf )
Respectfully, Alexander
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Problem with compilation
Hello
Ok you are driving the input for the T0CKI via a diode so this setting is correct. It could be that the comparitor pins have moved in the 887 device and you have to change the tris and data pins appropriatly in your program. Without sitting down and going through the tutorial it is hard for me to say.
Ok you are driving the input for the T0CKI via a diode so this setting is correct. It could be that the comparitor pins have moved in the 887 device and you have to change the tris and data pins appropriatly in your program. Without sitting down and going through the tutorial it is hard for me to say.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 79
- Joined: Mon Aug 03, 2009 12:14 pm
-
- Posts: 79
- Joined: Mon Aug 03, 2009 12:14 pm
Re: Problem with compilation
Hi! I want to ask, is possible to initialize TMR0 by Flowcode software, without inserting C code?
Respectfully, Alexander
-
- Posts: 79
- Joined: Mon Aug 03, 2009 12:14 pm
Re: Problem with compilation
How to set the initial value for TMR0 (TMR1)? Conversely, how to transfer the accumulated value of TMR0 (TMR1) in another variable? This can be done in the program Flowcode?
Respectfully, Alexander
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Problem with compilation
Hello
If you want direct access to the onboard peripheral registers via Flowcode then unfortunatley you must use C.
You simply have to use a capitalized version of the flowcode variable you wish to assign or you can use a constant.
Flowcode variable "out1" Becomes "FCV_OUT1" in C code.
Writing values to registers.
tmr0 = FCV_OUT1;
tmr0 = 24;
Reading registers into variables
FCV_IN1 = tmr0;
To get the correct register name for your device (eg tmr0, tmr0l) you can lookup the name in the device datasheet. Just keep the name lowercase and it should work in Flowcode.
If you want direct access to the onboard peripheral registers via Flowcode then unfortunatley you must use C.
You simply have to use a capitalized version of the flowcode variable you wish to assign or you can use a constant.
Flowcode variable "out1" Becomes "FCV_OUT1" in C code.
Writing values to registers.
tmr0 = FCV_OUT1;
tmr0 = 24;
Reading registers into variables
FCV_IN1 = tmr0;
To get the correct register name for your device (eg tmr0, tmr0l) you can lookup the name in the device datasheet. Just keep the name lowercase and it should work in Flowcode.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel