Problems with PIC12F629 that doesn't program them to work
Moderator: Benj
Problems with PIC12F629 that doesn't program them to work
Hi,
In older versions of Flowcode v4, v5, v6 when programming the Pic12F629/675, I used a C box on start with "osccan = 0x080" to put this small microcontroller to work as "internal RC CLKout" whell configurated (other options were simple to config like clk=4Mhz etc) to work , but now with Flowcode 8.0, I try to import the same old program I made (working one) from back and when I try to compile it on Hex, it gives me an error that is: " ^ (192) undefined identifier "osccal".
I managed and changed so many options around this confgurations but without success, because simply sending the program to the microcontroller when it is supposed to work alone, it does nothing at all!
Also I read the matrix help about this and it suggests doing this: https://www.matrixtsl.com/wikiv7/index. ... rix_Tools) , but it doesnt help on this kind of pic12f because it allways say that it doesnt have internal oscillator?!
Can you test this with simple LED flash code, using this Pic12f629/675 and help me find the solution please! what I need to do?
In older versions of Flowcode v4, v5, v6 when programming the Pic12F629/675, I used a C box on start with "osccan = 0x080" to put this small microcontroller to work as "internal RC CLKout" whell configurated (other options were simple to config like clk=4Mhz etc) to work , but now with Flowcode 8.0, I try to import the same old program I made (working one) from back and when I try to compile it on Hex, it gives me an error that is: " ^ (192) undefined identifier "osccal".
I managed and changed so many options around this confgurations but without success, because simply sending the program to the microcontroller when it is supposed to work alone, it does nothing at all!
Also I read the matrix help about this and it suggests doing this: https://www.matrixtsl.com/wikiv7/index. ... rix_Tools) , but it doesnt help on this kind of pic12f because it allways say that it doesnt have internal oscillator?!
Can you test this with simple LED flash code, using this Pic12f629/675 and help me find the solution please! what I need to do?
- 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: Problems with PIC12F629 that doesn't program them to work
Hello,
Try this instead.
OSCCAL = 0x80;
We moved to the XC8 compiler for Flowcode v7 and this requires register names in upper case.
Try this instead.
OSCCAL = 0x80;
We moved to the XC8 compiler for Flowcode v7 and this requires register names in upper case.
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
Re: Problems with PIC12F629 that doesn't program them to work
I tried that option, it no more gives error compiling the hex file, but still microchip doesn't work, in simple program it won't blink the LED!
Any more suggestions?
Any more suggestions?
Re: Problems with PIC12F629 that doesn't program them to work
This is the simple program configuration, see image...
- Attachments
-
- flowcode 1.jpg (81.71 KiB) Viewed 17658 times
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: Problems with PIC12F629 that doesn't program them to work
Hi bruno504,
We can't see everything within one image.
Can you post your flowchart please.
Also, could it be a programming issue?
do you have confirmation of chip being programmed and verified OK?
We can't see everything within one image.
Can you post your flowchart please.
Also, could it be a programming issue?
do you have confirmation of chip being programmed and verified OK?
Martin
Re: Problems with PIC12F629 that doesn't program them to work
here it is in attachments...
- Attachments
-
- blink teste configs.fcfx
- (9.38 KiB) Downloaded 367 times
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: Problems with PIC12F629 that doesn't program them to work
I can't see any issues with your Flowchart that would prevent LED from flashing.
It could flash at slightly incorrect frequency as I believe OSCCAL value is factory preset to give correct 4MHz internal osc frequency.
You are overriding this to center frequency by using.
As setting a single pin you don't need 255,just use 1.
That won't affect anything so LED should still flash.
So either config settings are not being sent to programmer (or switched off withing programmer).
Programmer is not successfully programming and varying.
Faulty chip, incorrect wiring to chip (if not programming OK) , or LED/resistor not wired correctly.
Can you remove the connection from pin A1 to LED/resistor and connected LED/resistor directly to +supply & make sure it lights up.
All else fails, can you post hex file, so I can check it.
It could flash at slightly incorrect frequency as I believe OSCCAL value is factory preset to give correct 4MHz internal osc frequency.
You are overriding this to center frequency by using
Code: Select all
OSCCAL = 0x80
As setting a single pin you don't need 255,just use 1.
That won't affect anything so LED should still flash.
So either config settings are not being sent to programmer (or switched off withing programmer).
Programmer is not successfully programming and varying.
Faulty chip, incorrect wiring to chip (if not programming OK) , or LED/resistor not wired correctly.
Can you remove the connection from pin A1 to LED/resistor and connected LED/resistor directly to +supply & make sure it lights up.
All else fails, can you post hex file, so I can check it.
Martin
Re: Problems with PIC12F629 that doesn't program them to work
Yes looking my program it would work, I know about 255 insted of true or "1", but I'm tired to change everything to make it work one time!
Yes the pic programmer works, I can upload to pic 12f629 other hex file that I had from couple of years now (made on flowcode v4 and v5, I'm sure microchip pic12f629 is good too so, must be the compiler to hex file, or eventually the chip programmer, but it worked with other hex files!?
Im using microchip PICDEM 2 plus, LED's are conneted correctly by years ago, the fact is when using oscilloscope to see what is going on in pins of the pic12f629 to ground, they are complettly freezed ! so it's because I saied that pic12f doesnt work at all!
Yes the pic programmer works, I can upload to pic 12f629 other hex file that I had from couple of years now (made on flowcode v4 and v5, I'm sure microchip pic12f629 is good too so, must be the compiler to hex file, or eventually the chip programmer, but it worked with other hex files!?
Im using microchip PICDEM 2 plus, LED's are conneted correctly by years ago, the fact is when using oscilloscope to see what is going on in pins of the pic12f629 to ground, they are complettly freezed ! so it's because I saied that pic12f doesnt work at all!
- Attachments
-
- blink teste configs.hex
- (524 Bytes) Downloaded 372 times
Re: Problems with PIC12F629 that doesn't program them to work
For you to know if I configure chip to "Int RC clockout" after program the pic12f and put it on test board, it doesn't do nothing from what I programmed (blinking LED) but measuring the pin 3 (clk out) I can measure square wave with 1,130MHz.
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: Problems with PIC12F629 that doesn't program them to work
Nothing appears to be wrong with with hex file.
Configuration settings are correctly embedded.
Enabled clockout and disabled brownout in case voltage is too low.
So you can see if all is working using FC5.
I could be wrong but don't think it would make any difference?
To me it does look like a hardware issue.
Check supply voltage going to the chip, if too low then brownout will occur.
Is the power supply steady?
Next I would remove power.
Check A1 for shorts to ground, and its connected to resistor/LED anode.
Also check LED cathode is connected to ground.
Another thing you can do is power back on the board, erase chip (so all pins default to high impendence state), then link A1 to the chip supply.
Configuration settings are correctly embedded.
It should be 1MHz, so that back ups what I was sayingbruno504 wrote:but measuring the pin 3 (clk out) I can measure square wave with 1,130MHz.
medelec35 wrote: I believe OSCCAL value is factory preset to give correct 4MHz internal osc frequency.
You are overriding this to center frequency by usingCode: Select all
OSCCAL = 0x80
I have attached a hex file created by Flowcode V5 to flash LED on A1 every second.bruno504 wrote: I can upload to pic 12f629 other hex file that I had from couple of years now (made on flowcode v4 and v5, I'm sure microchip pic12f629 is good too
Enabled clockout and disabled brownout in case voltage is too low.
So you can see if all is working using FC5.
I could be wrong but don't think it would make any difference?
To me it does look like a hardware issue.
Check supply voltage going to the chip, if too low then brownout will occur.
Is the power supply steady?
Next I would remove power.
Check A1 for shorts to ground, and its connected to resistor/LED anode.
Also check LED cathode is connected to ground.
Another thing you can do is power back on the board, erase chip (so all pins default to high impendence state), then link A1 to the chip supply.
Martin
Re: Problems with PIC12F629 that doesn't program them to work
tested this for ours... it won't work on this chips pic12f629, I'm using 9V battery, voltage is regulated to 5V checked, LED's all well connected to the pic12f, programmer is working with this chip also, because can load and program pic12f with older hex files and everything works. I just don't understand what is wrong in compiler of flowcode!? If you want I can make a video to YouTube showing this problem with Flowcode 8. any more suggestions?! 

-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: Problems with PIC12F629 that doesn't program them to work
Sorry attachment hex file created by Flowcode V5 did not get attached in my last post. Here it is.
- Attachments
-
- LED Blink FC5.hex
- (712 Bytes) Downloaded 419 times
Martin
Re: Problems with PIC12F629 that doesn't program them to work
the hex file you sent to me works great, how did you do it? it was compiled on flowcode 8?
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: Problems with PIC12F629 that doesn't program them to work
Oh, that does change things.bruno504 wrote:the hex file you sent to me works great
No I created it in Flowcode V5 as a sanity check.
Just one more hex file to test.
- Attachments
-
- blink teste configs.hex
- (656 Bytes) Downloaded 287 times
Martin
Re: Problems with PIC12F629 that doesn't program them to work
But that last you sent to me now, doesn't work!
What is wrong?!
What is wrong?!
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: Problems with PIC12F629 that doesn't program them to work
Ok the issues is with Flowcode V8 or XC8.
I'm surprised as its an old chip and only getting the port to change output.
It may have to be matrix staff that sorts this out.
I'm looking into it to see if I can get V8 to work.
Can't promise anything at this stage.
I'm surprised as its an old chip and only getting the port to change output.
It may have to be matrix staff that sorts this out.
I'm looking into it to see if I can get V8 to work.
Can't promise anything at this stage.
Martin
Re: Problems with PIC12F629 that doesn't program them to work
I'm not surprised, because ten years ago I found problems on Flowcode at the time it was relative to pic16f84 or 88 something near this kind of microcontroller... I have been lucky on find small hidden bugs on this software that I love so much!
Any help from me just write to me, I can test it quickly in my hardware systems! I got everything needed.
Thank you, I'll wait for the quick solution...
Any help from me just write to me, I can test it quickly in my hardware systems! I got everything needed.
Thank you, I'll wait for the quick solution...
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: Problems with PIC12F629 that doesn't program them to work
Not sure whats going on as checked SFR registers on two different simulators and FC5 & FC8 hex files give similar SFR results.
Difference is FC5 does set OSCCAL = 0x80; as a default, FC8 does not.
Can you try final hex file please?
May not work, but I have had a go.
Difference is FC5 does set OSCCAL = 0x80; as a default, FC8 does not.
Can you try final hex file please?
May not work, but I have had a go.
- Attachments
-
- blink teste configs 2.hex
- (676 Bytes) Downloaded 311 times
Martin
Re: Problems with PIC12F629 that doesn't program them to work
Doesnt do nothing. Only clkout is present on respective output pin.
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: Problems with PIC12F629 that doesn't program them to work
LED flashed when hex file was created using Flowocde V5 therefore we can say hardware is working.
Since LED is not flashing with any of the flowcharts created with Flowcode V8,
I have moved topic to the bugs section for Matrix staff to look into.
To see if its a compiler issue, I recompiled using XC8 v2.10 instead of the xc8 version shipped with Flowcode.
I have also attached flowchart created in FlowcodeV8 for staff to look at as a sanity check for me.
Since LED is not flashing with any of the flowcharts created with Flowcode V8,
I have moved topic to the bugs section for Matrix staff to look into.
To see if its a compiler issue, I recompiled using XC8 v2.10 instead of the xc8 version shipped with Flowcode.
I have also attached flowchart created in FlowcodeV8 for staff to look at as a sanity check for me.
- Attachments
-
- blink teste configs 2 XC8 v2.10.fcfx
- (6.85 KiB) Downloaded 274 times
-
- blink teste configs 2 XC8 v2.10.hex
- (596 Bytes) Downloaded 306 times
Martin
Re: Problems with PIC12F629 that doesn't program them to work
I tested the "blink teste configs 2 XC8 v2.10.hex" and it doesn't work, I only got clkout working.
Re: Problems with PIC12F629 that doesn't program them to work
by what I can see, maybe in Flowcode v8 is missing the GPIO PORT configurations, because I can't see this on C code compiled:
#define porta gpio;
#define trisa trisio;
Could it be?!
#define porta gpio;
#define trisa trisio;
Could it be?!
-
- Valued Contributor
- Posts: 786
- Joined: Fri Jun 06, 2014 3:53 pm
- Has thanked: 187 times
- Been thanked: 205 times
Re: Problems with PIC12F629 that doesn't program them to work
Hi
A few years ago (circa 2016) I created a program for a 12F675 using FC6 without issue. Nothing terribly exciting and timing was not critical. Basically it slept until an interrupt woke it, then processed before returning to sleep. Did all it needed to without issue.
Some months back I revisited the code using FC8 for a new project that would be quite similar. After updating what little "C" blocks there were I couldn't get it to run at all. I then completely wrote the code again from scratch using FC8 but still couldn't get it to work. To say it was frustrating is an understatement.
Having very little time to explore further I returned to FC6, made whatever changes necessary and it worked.

Regards
A few years ago (circa 2016) I created a program for a 12F675 using FC6 without issue. Nothing terribly exciting and timing was not critical. Basically it slept until an interrupt woke it, then processed before returning to sleep. Did all it needed to without issue.
Some months back I revisited the code using FC8 for a new project that would be quite similar. After updating what little "C" blocks there were I couldn't get it to run at all. I then completely wrote the code again from scratch using FC8 but still couldn't get it to work. To say it was frustrating is an understatement.
Having very little time to explore further I returned to FC6, made whatever changes necessary and it worked.
So it seems I'm not alone and wasn't going insane...medelec35 wrote:Ok the issues is with Flowcode V8 or XC8.
I'm surprised as its an old chip and only getting the port to change output.
It may have to be matrix staff that sorts this out.
I'm looking into it to see if I can get V8 to work.
Can't promise anything at this stage.

Regards
Re: Problems with PIC12F629 that doesn't program them to work
yes it's true I went back to Flowcode 6 and everything runned well !
I'm using Flowcode 8 for arduino.
At least I post this problem for anyone know about it.
I'm using Flowcode 8 for arduino.
At least I post this problem for anyone know about it.
- 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: Problems with PIC12F629 that doesn't program them to work
I might have one or two of these chips kicking about the office. I'll see if I can dig one out next time I'm in and have a play.
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