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.
I need some help with 12f675 and flowcode 5
Moderator: Benj
-
- 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
The human brain is nothing more than a simple computer...and Im its hacker.
-
- 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
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
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
-
- 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
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. .
thank you again
The human brain is nothing more than a simple computer...and Im its hacker.
-
- 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
It should do.T3CKN3SS wrote: I believe the PICkit 3 retains the Osccal value when programming ,
Have you tried reading chip with programmer and checking osccal value stored in hex file at location 0x3FFF?
Yes can do, I could take a look to see if i can spot something.T3CKN3SS wrote:Would you prefer if i attached the flowcode file?
Martin
Martin
-
- 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
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.