Flowcode PIC Student ver4 and Hi TECH
-
- Posts: 157
- Joined: Sat Jan 22, 2011 10:39 pm
- Location: Michigan
- Has thanked: 6 times
- Been thanked: 27 times
- Contact:
Flowcode PIC Student ver4 and Hi TECH
I just upgraded to ver4,
I have read the post about adding the HI TECH C Compiler and when I try to compile a simple "HELLO MOM"
to a PIC16F1827 I get the following errors?
I have been able to compile and program with the PICKIT3 to a 16F88 with no problems.
I know this belongs in the 4.0 forum, but my registration has not been approved yet.
Bob
****************************************************************************************************************************
File name: C:\Program Files\Matrix Multimedia\Flowcode V4\X1827HELLO.c
Generated by: Flowcode v4.2.3.58
Date: Friday, February 04, 2011 09:37:52
Licence: Student
Registered to: Bob Waterfield
NOT FOR COMMERCIAL USE
http://www.matrixmultimedia.com
Launching the compiler...
C:\Program Files\HI-TECH Software\PICC\9.80\bin\picc.exe --CHIP=16F1827 -N48 X1827HELLO.c
X1827HELLO.c: main()
472: OPTION = 0xC0;
^ (192) undefined identifier "OPTION"
508: FCD_LCDDisplay0_PrintString("HI MOM",6);
^ (359) illegal conversion between pointer types (warning)
pointer to const unsigned char -> pointer to unsigned char
Licensed for evaluation purposes only.
This licence will expire on Fri, 25 Feb 2011.
HI-TECH C Compiler for PIC10/12/16 MCUs (PRO Mode) V9.80
Copyright (C) 2010 Microchip Technology Inc.
(908) exit status = 1
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
I have read the post about adding the HI TECH C Compiler and when I try to compile a simple "HELLO MOM"
to a PIC16F1827 I get the following errors?
I have been able to compile and program with the PICKIT3 to a 16F88 with no problems.
I know this belongs in the 4.0 forum, but my registration has not been approved yet.
Bob
****************************************************************************************************************************
File name: C:\Program Files\Matrix Multimedia\Flowcode V4\X1827HELLO.c
Generated by: Flowcode v4.2.3.58
Date: Friday, February 04, 2011 09:37:52
Licence: Student
Registered to: Bob Waterfield
NOT FOR COMMERCIAL USE
http://www.matrixmultimedia.com
Launching the compiler...
C:\Program Files\HI-TECH Software\PICC\9.80\bin\picc.exe --CHIP=16F1827 -N48 X1827HELLO.c
X1827HELLO.c: main()
472: OPTION = 0xC0;
^ (192) undefined identifier "OPTION"
508: FCD_LCDDisplay0_PrintString("HI MOM",6);
^ (359) illegal conversion between pointer types (warning)
pointer to const unsigned char -> pointer to unsigned char
Licensed for evaluation purposes only.
This licence will expire on Fri, 25 Feb 2011.
HI-TECH C Compiler for PIC10/12/16 MCUs (PRO Mode) V9.80
Copyright (C) 2010 Microchip Technology Inc.
(908) exit status = 1
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
- Attachments
-
- X1827HELLO.fcf
- (5 KiB) Downloaded 501 times
- 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: Flowcode PIC Student ver4 and Hi TECH
Hello,
It seems the chip is missing the OPTION define for this device.
If you click on View -> Project options -> Use Supplementary code -> Edit supplementary code
and then pop this line of code into the top window.
#define OPTION OPTION_REG_REG
and then click OK then the program should compile correctly.
Let me know how you get on.
It seems the chip is missing the OPTION define for this device.
If you click on View -> Project options -> Use Supplementary code -> Edit supplementary code
and then pop this line of code into the top window.
#define OPTION OPTION_REG_REG
and then click OK then the program should compile correctly.
Let me know how you get on.
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: 157
- Joined: Sat Jan 22, 2011 10:39 pm
- Location: Michigan
- Has thanked: 6 times
- Been thanked: 27 times
- Contact:
Re: Flowcode PIC Student ver4 and Hi TECH
Ben,
Still no go. I also noticed that when I try to click on the CHIP/CONFIGURE to make sure the watchdog is OFF it does not list the 16F1827 there??
I do not even see it in the list, but it was in the list when I selected new project.
Launching the compiler...
C:\Program Files\HI-TECH Software\PICC\9.80\bin\picc.exe --CHIP=16F1827 -N48 X1827HELLO.c
X1827HELLO.c: main()
478: OPTION_REG_REG = 0xC0;
^ (192) undefined identifier "OPTION_REG_REG"
520: FCD_LCDDisplay0_PrintString("HI MOM",6);
^ (359) illegal conversion between pointer types (warning)
pointer to const unsigned char -> pointer to unsigned char
Licensed for evaluation purposes only.
This licence will expire on Fri, 25 Feb 2011.
HI-TECH C Compiler for PIC10/12/16 MCUs (PRO Mode) V9.80
Copyright (C) 2010 Microchip Technology Inc.
(908) exit status = 1
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
Still no go. I also noticed that when I try to click on the CHIP/CONFIGURE to make sure the watchdog is OFF it does not list the 16F1827 there??
I do not even see it in the list, but it was in the list when I selected new project.
Launching the compiler...
C:\Program Files\HI-TECH Software\PICC\9.80\bin\picc.exe --CHIP=16F1827 -N48 X1827HELLO.c
X1827HELLO.c: main()
478: OPTION_REG_REG = 0xC0;
^ (192) undefined identifier "OPTION_REG_REG"
520: FCD_LCDDisplay0_PrintString("HI MOM",6);
^ (359) illegal conversion between pointer types (warning)
pointer to const unsigned char -> pointer to unsigned char
Licensed for evaluation purposes only.
This licence will expire on Fri, 25 Feb 2011.
HI-TECH C Compiler for PIC10/12/16 MCUs (PRO Mode) V9.80
Copyright (C) 2010 Microchip Technology Inc.
(908) exit status = 1
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
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: Flowcode PIC Student ver4 and Hi TECH
That's odd. If do help,about. what is your version of flowcode?
I had no problems compiling your flowchart to hex
only difference is I'm using pro version of flowcode.
@Ben. using original 16F1827 and HT in trial mode.
When I go into chip Configure, switch to expert config screen, the Chip is there.
I have adjusted osccon your osc speed to 16MHz and as this is the fasted speed without enabling PLL
I have attached hex file so can have a play until problem is sorted.
Not had chance to test on real hardware. I will tonight when get home from work.
I had no problems compiling your flowchart to hex
only difference is I'm using pro version of flowcode.
@Ben. using original 16F1827 and HT in trial mode.
Code: Select all
File name: C:\Documents and Settings\mwhi\My Documents\X1827HELLO.c
Generated by: Flowcode v4.3.7.63
Date: Friday, February 04, 2011 15:37:03
Licence: Professional
Registered to: Martin
http://www.matrixmultimedia.com
Launching the compiler...
C:\Program Files\HI-TECH Software\PICC\9.80\bin\picc.exe --CHIP=16F1827 -N48 X1827HELLO.c
X1827HELLO.c: main()
526: FCD_LCDDisplay0_PrintString("HI MOM",6);
^ (359) illegal conversion between pointer types (warning)
pointer to const unsigned char -> pointer to unsigned char
..........
C:\Program Files\Matrix Multimedia\Flowcode V4\FCD\internals.h: 57: (1090) variable "_FCI_TMP_STR" is not used (warning)
C:\Program Files\Matrix Multimedia\Flowcode V4\FCD\internals.h: 58: (1090) variable "_FCI_TMP_INT" is not used (warning)
..
Licensed for evaluation purposes only.
This licence will expire on Thu, 24 Feb 2011.
HI-TECH C Compiler for PIC10/12/16 MCUs (PRO Mode) V9.80
Copyright (C) 2010 Microchip Technology Inc.
Memory Summary:
Program space used 116h ( 278) of 1000h words ( 6.8%)
Data space used 9h ( 9) of 180h bytes ( 2.3%)
EEPROM space used 0h ( 0) of 100h bytes ( 0.0%)
Configuration bits used 0h ( 0) of 2h words ( 0.0%)
ID Location space used 0h ( 0) of 4h bytes ( 0.0%)
Return code = 0
Launching the linker/assembler...
C:\Program Files\Matrix Multimedia\Flowcode V4\Tools\DoNothing\DoNothing.exe
Return code = 0
FINISHED
I have adjusted osccon your osc speed to 16MHz and as this is the fasted speed without enabling PLL
I have attached hex file so can have a play until problem is sorted.
Not had chance to test on real hardware. I will tonight when get home from work.
- Attachments
-
- X1827HELLO.fcf
- (5.5 KiB) Downloaded 462 times
-
- X1827HELLO.hex
- (1.55 KiB) Downloaded 437 times
Martin
-
- Posts: 157
- Joined: Sat Jan 22, 2011 10:39 pm
- Location: Michigan
- Has thanked: 6 times
- Been thanked: 27 times
- Contact:
Re: Flowcode PIC Student ver4 and Hi TECH
The HEX file you provided did program into the PIC and run.
The flow code you provided still gives me errors?
I am using ver 4.2.3.58
Downloading the 4.2-4.3 patch and will try again.
Launching the compiler...
C:\Program Files\HI-TECH Software\PICC\9.80\bin\picc.exe --CHIP=16F1827 -N48 Xx1827HELLO.c
Xx1827HELLO.c: main()
466: OPTION = 0xC0;
^ (192) undefined identifier "OPTION"
502: FCD_LCDDisplay0_PrintString("HI MOM",6);
^ (359) illegal conversion between pointer types (warning)
pointer to const unsigned char -> pointer to unsigned char
Licensed for evaluation purposes only.
This licence will expire on Fri, 25 Feb 2011.
HI-TECH C Compiler for PIC10/12/16 MCUs (PRO Mode) V9.80
Copyright (C) 2010 Microchip Technology Inc.
(908) exit status = 1
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
The flow code you provided still gives me errors?
I am using ver 4.2.3.58
Downloading the 4.2-4.3 patch and will try again.
Launching the compiler...
C:\Program Files\HI-TECH Software\PICC\9.80\bin\picc.exe --CHIP=16F1827 -N48 Xx1827HELLO.c
Xx1827HELLO.c: main()
466: OPTION = 0xC0;
^ (192) undefined identifier "OPTION"
502: FCD_LCDDisplay0_PrintString("HI MOM",6);
^ (359) illegal conversion between pointer types (warning)
pointer to const unsigned char -> pointer to unsigned char
Licensed for evaluation purposes only.
This licence will expire on Fri, 25 Feb 2011.
HI-TECH C Compiler for PIC10/12/16 MCUs (PRO Mode) V9.80
Copyright (C) 2010 Microchip Technology Inc.
(908) exit status = 1
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
-
- Posts: 157
- Joined: Sat Jan 22, 2011 10:39 pm
- Location: Michigan
- Has thanked: 6 times
- Been thanked: 27 times
- Contact:
Re: Flowcode PIC Student ver4 and Hi TECH
I downloaded the patch, now on VER 4.3.7.63.
The program will compile with out error and attempt to program the PIC (successfully) but the program does not run?
SO far only thing I have been able to load into this PIC is the HEX file you sent me.
Id stick with the 16F88 but the 16F1827 is faster has has a bit more program room.
I know this has to be something stupidly easy I am over looking.
Bob
The program will compile with out error and attempt to program the PIC (successfully) but the program does not run?
SO far only thing I have been able to load into this PIC is the HEX file you sent me.
Id stick with the 16F88 but the 16F1827 is faster has has a bit more program room.
I know this has to be something stupidly easy I am over looking.
Bob
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: Flowcode PIC Student ver4 and Hi TECH
Hiya Bob.
.
With program I posted in above post, just tested on my hardware and the words HI MOM can be seen, but is scrolling too fast. All config. settings that I altered are spot on.
I have altered flowchart just to produce a single HI MOM.
Also added a LED on A0 to test flashing rate. All tested and working 100% on hardware. so if you use these files and you don't get a working display, then you have a hardware issue to resolve.
That's good. It's a step in the right directionBobw wrote:I downloaded the patch, now on VER 4.3.7.63.
The program will compile with out error and attempt to program the PIC (successfully)

With program I posted in above post, just tested on my hardware and the words HI MOM can be seen, but is scrolling too fast. All config. settings that I altered are spot on.
I have altered flowchart just to produce a single HI MOM.
Also added a LED on A0 to test flashing rate. All tested and working 100% on hardware. so if you use these files and you don't get a working display, then you have a hardware issue to resolve.
I totally agree with you. 16F1827 can run its internal oscillator at 32MHz. Has 16 Stack levels, its the only 18 pin chip I could find that has 2 ECCP & 2 CCP (Enhanced/Capture Compare PWM) and has a whopping 7K of mem, 256bytes of eprom etc. seems to have it all, and not that pricey either. It will be even better, when boostc and ppp fully supports it.Bobw wrote: 16F1827 is faster has has a bit more program room.
- Attachments
-
- X1827HELLO.fcf
- (6.5 KiB) Downloaded 439 times
-
- X1827HELLO.hex
- (1.68 KiB) Downloaded 405 times
Martin
-
- Posts: 157
- Joined: Sat Jan 22, 2011 10:39 pm
- Location: Michigan
- Has thanked: 6 times
- Been thanked: 27 times
- Contact:
Re: Flowcode PIC Student ver4 and Hi TECH
The last FCF file compiled, loaded and ran with no problems, even the LED, glad I had a few laying around.
Will have to look at the "C" file and see what is different on this one and the first one I tried.
I have written programs to the 16F88 to display ADC values, tell me which switch I have pressed. This is the first go around with the 16F1827. Now to figure out the mouse encoder part.
Ben...medelec35...
Thank you both for your time and patience with a newbie.
Bob
Will have to look at the "C" file and see what is different on this one and the first one I tried.
I have written programs to the 16F88 to display ADC values, tell me which switch I have pressed. This is the first go around with the 16F1827. Now to figure out the mouse encoder part.
Ben...medelec35...
Thank you both for your time and patience with a newbie.
Bob
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: Flowcode PIC Student ver4 and Hi TECH
Your welcome. We were all beginners once, so I know what it's like.
Just glad its working OK. Any other issues, or your stuck just ask as much as you like.
One thing i need to mention for future reference.
In your original Flowchart you put OSCCON in caps.
I left it the same because with Hitc compile caps is OK.
However if you are using a different chip with boost C, You MUST use lower case.
If you use upper case for a register you will get the following error:
In hindsight I should have changed it for you to avoid confusion.
Just glad its working OK. Any other issues, or your stuck just ask as much as you like.
One thing i need to mention for future reference.
In your original Flowchart you put OSCCON in caps.
I left it the same because with Hitc compile caps is OK.
However if you are using a different chip with boost C, You MUST use lower case.
If you use upper case for a register you will get the following error:
Code: Select all
error: left operand must be l-value
Martin
-
- Posts: 157
- Joined: Sat Jan 22, 2011 10:39 pm
- Location: Michigan
- Has thanked: 6 times
- Been thanked: 27 times
- Contact:
Re: Flowcode PIC Student ver4 and Hi TECH
Thanks for the tip. I changed the header to reflect it in lower case. Going to hang on to this one to build other programs from.
Is it possible to make an ACD input (POT) display a negative number? I need from -90 to +450 with out a bunch of table look up.
If not, may just use push buttons to move the set point up or down.
Bob
Is it possible to make an ACD input (POT) display a negative number? I need from -90 to +450 with out a bunch of table look up.
If not, may just use push buttons to move the set point up or down.
Bob
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: Flowcode PIC Student ver4 and Hi TECH
Try this version. Hope it is what you are after.Bobw wrote:Is it possible to make an ACD input (POT) display a negative number? I need from -90 to +450 with out a bunch of table look up.
Bob
- Attachments
-
- X1827HELLO_Modified1.fcf
- (7.5 KiB) Downloaded 451 times
Martin
-
- Posts: 157
- Joined: Sat Jan 22, 2011 10:39 pm
- Location: Michigan
- Has thanked: 6 times
- Been thanked: 27 times
- Contact:
Re: Flowcode PIC Student ver4 and Hi TECH
WOW...
I didn't expect you to actually write something. That solved a major head ache and saved me a pin on the PIC. Now I have room to put the 3 switches on their own pins.
Did notice on the simulator that it shows PIN 18 (RA1) as the input when it is actually PIN 17 (RA0).
With the exception of the optical encoder, I have this just about figured out now.
Major Thank You.
I didn't expect you to actually write something. That solved a major head ache and saved me a pin on the PIC. Now I have room to put the 3 switches on their own pins.
Did notice on the simulator that it shows PIN 18 (RA1) as the input when it is actually PIN 17 (RA0).
With the exception of the optical encoder, I have this just about figured out now.
Major Thank You.
-
- Posts: 5
- Joined: Tue Mar 10, 2009 12:52 pm
Re: Flowcode PIC Student ver4 and Hi TECH
Launching the compiler...
C:\Program Files\HI-TECH Software\PICC\9.81\bin\picc.exe --CHIP=16F1827 -N48 HalfWaveControl.c
HalfWaveControl.c: main()
382: INT0IE = 1;
^ (192) undefined identifier "INT0IE"
HalfWaveControl.c: myisr()
504: if (ts_bit(INTCON, INT0IF) && ts_bit(INTCON, INT0IE))
^ (192) undefined identifier "INT0IF"
(192) undefined identifier "INT0IE" ^
HI-TECH C Compiler for PIC10/12/16 MCUs (PRO Mode) V9.81
Copyright (C) 2010 Microchip Technology Inc.
Licensed for evaluation purposes only.
This licence will expire on Fri, 20 May 2011.
(908) exit status = 1
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[/quote]
C:\Program Files\HI-TECH Software\PICC\9.81\bin\picc.exe --CHIP=16F1827 -N48 HalfWaveControl.c
HalfWaveControl.c: main()
382: INT0IE = 1;
^ (192) undefined identifier "INT0IE"
HalfWaveControl.c: myisr()
504: if (ts_bit(INTCON, INT0IF) && ts_bit(INTCON, INT0IE))
^ (192) undefined identifier "INT0IF"
(192) undefined identifier "INT0IE" ^
HI-TECH C Compiler for PIC10/12/16 MCUs (PRO Mode) V9.81
Copyright (C) 2010 Microchip Technology Inc.
Licensed for evaluation purposes only.
This licence will expire on Fri, 20 May 2011.
(908) exit status = 1
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[/quote]
-
- Posts: 5
- Joined: Tue Mar 10, 2009 12:52 pm
Re: Flowcode PIC Student ver4 and Hi TECH
Sorry... I seemed to have messed up the previous post.
That was the message I get when I try to compile to HEX using Hi-tech. The problem is that it seems to overwrite the interrupt bit identifiers (without interrupt function, the code compiles fine). The weird thing that when I open the c file (HalfWaveControl.c), it doesn't even have the lines it complains about. In fact, the text in the file looks fine, using the correct identifiers. I was wondering whether this is an effect of the optimisation done by the compiler?
Any help would be greatly appreciated.
Thanks,
Gyorgy
That was the message I get when I try to compile to HEX using Hi-tech. The problem is that it seems to overwrite the interrupt bit identifiers (without interrupt function, the code compiles fine). The weird thing that when I open the c file (HalfWaveControl.c), it doesn't even have the lines it complains about. In fact, the text in the file looks fine, using the correct identifiers. I was wondering whether this is an effect of the optimisation done by the compiler?
Any help would be greatly appreciated.
Thanks,
Gyorgy