I need some help with 12f675 and flowcode 5

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 5.
To post in this forum you must have a registered copy of Flowcode 5 or higher.

Moderator: Benj

Post Reply
T3CKN3SS
Posts: 5
Joined: Wed Jun 01, 2016 9:28 am
Has thanked: 5 times
Been thanked: 1 time
Contact:

I need some help with 12f675 and flowcode 5

Post by T3CKN3SS »

Hello.

I'm really hoping someone here can help me with this.
I wrote a simple program in flowcode 5 that basically uses a half rectified square wave as a trigger, the program then waits x number of microseconds and makes a high then low pulse output on one of it pins. The program gradually increases x by a fixed amount until x is > or = y, then x is reset back to its starting point.
Okay after many attempts I finally got all the timing right and the chip does its job perfectly (12f675).
But when wrote exactly the same program to another 12f675 chip the timing is all out, and when I say out I mean far out.
Thinking it was just the new chip at fault I tried writing the program to anther 12f675 and this time the time is out again but its not as far out as the second chip, but it seems to be racing through the program much faster than both the first and second chips.
All the chips are set at 4mhz.

I really don't know what to do, I think it is oscillator calibration related because I am using internal clock. But if this is the case how can i fix it?

Thank you in advance for any help or advice.
The human brain is nothing more than a simple computer...and Im its hacker.

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: I need some help with 12f675 and flowcode 5

Post by medelec35 »

Hi T3CKN3SS.
When programming 12F675 the calibration data is erased.
Therefore if the programmer you used does not store the calibration data for restoring to chip, then calibration will be off.
There are posts on different web sites showing how to determine & restore calibration data.
Also I believe the PICkit2 can restore calibration data.
So there is a fair bit of hassle involved.

If it was me I would use a 12F1840 as they are cheap and far, far superior to 12F675 .
E.g have I2C and SPI, double memory capacity and selectable internal oscillator frequencies up-to 32MHz

You just need to make sure your programmer is compatible with 12F1840

Martin
Martin

T3CKN3SS
Posts: 5
Joined: Wed Jun 01, 2016 9:28 am
Has thanked: 5 times
Been thanked: 1 time
Contact:

Re: I need some help with 12f675 and flowcode 5

Post by T3CKN3SS »

medelec35 wrote:Hi T3CKN3SS.
When programming 12F675 the calibration data is erased.
Therefore if the programmer you used does not store the calibration data for restoring to chip, then calibration will be off.
There are posts on different web sites showing how to determine & restore calibration data.
Also I believe the PICkit2 can restore calibration data.
So there is a fair bit of hassle involved.

If it was me I would use a 12F1840 as they are cheap and far, far superior to 12F675 .
E.g have I2C and SPI, double memory capacity and selectable internal oscillator frequencies up-to 32MHz

You just need to make sure your programmer is compatible with 12F1840

Martin

Hello Martin

Thank you for your response, I have a PICkit 3 here and i used it to read the 12f675 chips and I believe the PICkit 3 retains the Osccal value when programming , all three chips would seem to have different calibration values so i don't think they were overwritten.
Is it possible that i am missing something?
Would you prefer if i attached the flowcode file?
I was asked to write 37 of these chips and the 12f675 is the cheapest chip i have available,that will do this job, unfortunately the electrical supply shops here in SA are rather useless. :cry: .

thank you again
The human brain is nothing more than a simple computer...and Im its hacker.

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: I need some help with 12f675 and flowcode 5

Post by medelec35 »

T3CKN3SS wrote: I believe the PICkit 3 retains the Osccal value when programming ,
It should do.
Have you tried reading chip with programmer and checking osccal value stored in hex file at location 0x3FFF?
T3CKN3SS wrote:Would you prefer if i attached the flowcode file?
Yes can do, I could take a look to see if i can spot something.

Martin
Martin

T3CKN3SS
Posts: 5
Joined: Wed Jun 01, 2016 9:28 am
Has thanked: 5 times
Been thanked: 1 time
Contact:

Re: I need some help with 12f675 and flowcode 5

Post by T3CKN3SS »

Phase counter.fcf
(13.7 KiB) Downloaded 259 times
Here is the flowcode file.

I did check 0x3fff and i found some 4 digit values, pretty sure those are the calibration values, 3450, 3438, 3446, those are the values from the 3 chips I've used

Thanks
The human brain is nothing more than a simple computer...and Im its hacker.

Post Reply