• AVR Freaks

AnsweredHot!PIC12F675 Invalid Calibration Data

Author
WorkWorkWork
New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2020/01/14 01:38:56
  • Location: 0
  • Status: offline
2020/01/16 01:53:50 (permalink)
0

PIC12F675 Invalid Calibration Data

Hello All,
 
I have a PIC12F675 fitted to a PCB, with the following problem.
 
I randomly get invalid calibration data error messages when trying to program the target, using the hex file and the v5.25 IPE programmer.
 
I checked these forums and the only other thread (https://www.microchip.com/forums/m1115868.aspx) I could find on this topic, did not have a simple answer or solution and it has been dead for two and a half months.
 
Thanks for reading, any helpful advice would be appreciated.
#1
katela
Super Member
  • Total Posts : 1564
  • Reward points : 0
  • Joined: 2013/06/11 05:25:18
  • Location: South Africa
  • Status: offline
Re: PIC12F675 Invalid Calibration Data 2020/01/17 10:50:47 (permalink)
0
It's better to provide more details about your problem which might be different to the ones discussed in that thread. Your setup, connection, does it happen on only one device? etc.

Free online Microcontroller Tutorials and Projects for Hobbyists and students. From beginners to advanced. Website: www.studentcompanion.co.za
YouTube Tutorials: https://www.youtube.com/StudentCompanionSA
#2
NorthGuy
Super Member
  • Total Posts : 5917
  • Reward points : 0
  • Joined: 2014/02/23 14:23:23
  • Location: Northern Canada
  • Status: offline
Re: PIC12F675 Invalid Calibration Data 2020/01/17 11:08:17 (permalink)
0
WorkWorkWork
... did not have a simple answer or solution and it has been dead for two and a half months.



Perhaps there's no simple answer or solution. Old PIC. No device id. Diagnostics is very limited. OSCCAL calibration storage is unreliable. If you get intermittent errors, perhaps the connection is not always good. If you re-connect and repeat, it may cure. Another possible cause is a damaged PIC. If so, you will get the error even if you re-try. It's also possible that the OSCCAL calibration is lost during programming. Tell these situations apart is difficult if at all impossible.
 
Newer PIC16 will have less problems.
#3
WorkWorkWork
New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2020/01/14 01:38:56
  • Location: 0
  • Status: offline
Re: PIC12F675 Invalid Calibration Data 2020/01/20 01:55:21 (permalink)
0
The problem has been occuring across different projects, with different PICkit 3 programmers and test setups. With the same batch of PICs.
 
Some are used in lead free assemblies, others lead free (so reflow temperatures differ). I have had some luck in hand soldering replacement PIC12F675s from stock, however even hand soldering them to a PCB and trying to program, sometimes gives the exact problem of calibration data invalid error message during programming.
 
I have also tried to do the trick desribed in the following URL and although we do not get the error message anymore, when testing the PIC12F675 after programming in circuit, the PIC device outputs do not work as intended when the correct supply and inputs are applied.
http://embeddedlaboratory.blogspot.com/2016/10/how-to-solve-target-device-has-invalid.html
 
I have one question which I have not been able to find a suitable answer for online:
 
If the OSCCAL register has been erased during programming, is there a way for me to reprogram this register with a default value using a PICkit3, or PICkit4? (I have both of these ISCPs).
#4
NorthGuy
Super Member
  • Total Posts : 5917
  • Reward points : 0
  • Joined: 2014/02/23 14:23:23
  • Location: Northern Canada
  • Status: offline
Re: PIC12F675 Invalid Calibration Data 2020/01/20 10:35:22 (permalink) ☄ Helpfulby WorkWorkWork 2020/01/21 08:20:49
+1 (1)
WorkWorkWork
If the OSCCAL register has been erased during programming, is there a way for me to reprogram this register with a default value using a PICkit3, or PICkit4? (I have both of these ISCPs).



The blogpost you quoted explains how.
 
However, the probability that you get this error because of bad connections is far greater than lost calibration.
#5
piticbogdan
New Member
  • Total Posts : 14
  • Reward points : 0
  • Joined: 2018/12/02 17:58:02
  • Location: 0
  • Status: offline
Re: PIC12F675 Invalid Calibration Data 2020/01/20 17:21:36 (permalink)
0
("The entire program memory will be erased, including OSCCAL value, when the code protection is turned off.")
#6
ric
Super Member
  • Total Posts : 25592
  • Reward points : 0
  • Joined: 2003/11/07 12:41:26
  • Location: Australia, Melbourne
  • Status: online
Re: PIC12F675 Invalid Calibration Data 2020/01/20 17:40:04 (permalink) ☼ Best Answerby WorkWorkWork 2020/01/21 08:20:26
+2 (2)
The Microchip tools always read the calibration value, and try to replace it whenever the chip is erased.
Faulty connections can cause the programming cycle to be interrupted, and THAT is when the calibration gets lost.

I also post at: PicForum
Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
NEW USERS: Posting images, links and code - workaround for restrictions.
To get a useful answer, always state which PIC you are using!
#7
WorkWorkWork
New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2020/01/14 01:38:56
  • Location: 0
  • Status: offline
Re: PIC12F675 Invalid Calibration Data 2020/01/21 01:50:09 (permalink)
0
Well I can elaborate more on the programming header we use (linked in my following forum post). We have the non clip version (TC2030-MCP-NL). The spring pins have to be held in place during programming of the PIC in circuit, we chose this programming header because of the small surface area and relative ease of use in comparison to other alternative programming headers. This programming header setup is used on both projects that had recently started having invalid calibration data errors during programming.
 
The other thing I can tell you, is that we have added additional circuitry to this projects PCB and I noted that the design team had put an additional long track branching from the GP0 (DATA_PIC) line, going about 50mm across the PCB, to an op-amp circuit output, a couple of 10k resistors into a couple of 1nF caps to ground and inputs of two TPS2819BDV MOSFET drivers.
 
I know we are supposed to keep ICSP data and clock pins clear, however on this design I was not involved until after the PCBs had been designed/built and passed to me to test. I was thinking of removing the additional components temporarily and trying to program the faulty PIC12F675 to see if that fixes it.
 
Thanks for the help all. I will let you know how I get on later today.
post edited by WorkWorkWork - 2020/01/21 02:39:16
#8
WorkWorkWork
New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2020/01/14 01:38:56
  • Location: 0
  • Status: offline
Re: PIC12F675 Invalid Calibration Data 2020/01/21 02:20:08 (permalink)
0
Here is a link the connections made to the PICkit3 http://www.tag-connect.com/pickit3 (note we use the no clip version of the programming header lead, linked in my post above).
 
Also I double checked again and the 100nF is not on the DATA_PIC line. I tried to edit that out of my post above, but I keep getting the following message in my browser, when I click the save changes button in this forum.
Access Denied
You don't have permission to access "http://www.microchip.com/forums/post.aspx?" on this server.
 
EDIT: Thanks ric, I have edited by post above with the correct information now.
post edited by WorkWorkWork - 2020/01/21 02:41:55
#9
ric
Super Member
  • Total Posts : 25592
  • Reward points : 0
  • Joined: 2003/11/07 12:41:26
  • Location: Australia, Melbourne
  • Status: online
Re: PIC12F675 Invalid Calibration Data 2020/01/21 02:33:28 (permalink) ☄ Helpfulby WorkWorkWork 2020/01/21 02:36:12
+1 (1)
That is due to the live URL in your post, and a buggy firewall on the web server this forum runs on.
See: How to avoid errors when editing posts
 

I also post at: PicForum
Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
NEW USERS: Posting images, links and code - workaround for restrictions.
To get a useful answer, always state which PIC you are using!
#10
WorkWorkWork
New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2020/01/14 01:38:56
  • Location: 0
  • Status: offline
Re: PIC12F675 Invalid Calibration Data 2020/01/21 08:20:04 (permalink)
+1 (1)
Hello All,
 
I wanted to provide you with an update to the problem I described in my original post. 
 
I checked the data and clock lines with an oscilloscope at the PICkit3 header (I used a longer male to male header so I could clip onto and evaulation the two signals). This is when I noticed the data line peak to peak voltage was being pulled down to between 2.400V and 2.725V, the clock line peak to peak was 5V during the communication pulses.
 
I have not fitted the op-amp, whos output was connected directly to the DATA_PIC line and now both data and clock lines are 5Vp-p as they should be. 
 
I had to replace the PIC12F675 with a new one, because the original PIC still had the invalid calibration data problem from the previous attempts at programming (with the data line being affected by the op-amp output pin). The PICkit3 connected correctly to the new PIC with no invalid calibration data error and I was able to program it successfully.
 
I re-fitted the op-amp after programming and tested the software, which passes all tests now. The design will be changed to include a programming jumper between the offending op-amp and the data line.
 
Thanks for the help all.
post edited by WorkWorkWork - 2020/01/21 08:23:17
#11
NorthGuy
Super Member
  • Total Posts : 5917
  • Reward points : 0
  • Joined: 2014/02/23 14:23:23
  • Location: Northern Canada
  • Status: offline
Re: PIC12F675 Invalid Calibration Data 2020/01/21 08:38:46 (permalink)
0
We used pogo pins manually held by an operator for programming, and sometimes (may be 1-2%) the connection is not made, thus the programming fails. In this case, just removing pins and sticking them back works.
 
If you have a scope, you can look at PGC and PGD lines during programming and check SI - edges and voltage levels. If SI is barely Ok, you may get intermittent errors.
#12
NKurzman
A Guy on the Net
  • Total Posts : 18266
  • Reward points : 0
  • Joined: 2008/01/16 19:33:48
  • Location: 0
  • Status: offline
Re: PIC12F675 Invalid Calibration Data 2020/01/21 10:51:45 (permalink)
0
Once the Calibration value is lost, it is lost.  You can not get it back.
There used to be a way to regenerate with a PICKit2.
you could copy another PIC, or set the Default to get rid of the Message.  But the Cal would be wrong for the Chip. AND you would need to change some settings to get IPE to write it.  THEN reset then to the normal values.
#13
Jump to:
© 2020 APG vNext Commercial Version 4.5