Posting it here, because someone here might know a solution, but looks like it is another annoying unfixed problem with PICKit 3: They removed the possibility to recalibrate the OSCCAL word for the older devices, if I didn't miss something:
https://www.eevblog.com/forum/beginners/pic-12f509-the-target-has-invalid-calibration-data-(0x00)/
Glad I still have my PICKit 2 as well.
According to the datasheet for these devices:
In addition, a calibration instruction is programmed into the last address of memory, which contains the calibration value for the internal RC oscillator. This location is always uncode protected, regardless of the code-protect settings. This value is
programmed as a MOVLW XX instruction where XX is the calibration value, and is placed at the Reset vector. This will load the W register with the calibration value upon Reset and the PC will then roll over to the users program at address 0x000. The user then has the option of writing the value to the OSCCAL Register (05h) or ignoring it.
All you should need to do is ensure an appropriate MOVLW instruction is in the last word of program memory, preferably based on reading what was placed there from the factory. I haven't tested this to see if it works. But I also haven't used the internal oscillator in years (crystals are too inexpensive not to use, and I'm not space sensitive).
Yes, but the value can get deleted, as the other thread I linked showed (and other people on the Microchip forum had the same problem), and it might be more accurate if it is possible to do the calibration again.
Yes, but the value can get deleted, as the other thread I linked showed (and other people on the Microchip forum had the same problem), and it might be more accurate if it is possible to do the calibration again.
Ahh, I missed the 'auto regenerate' option....
I'm surprised someone hasn't written a chunk of code to deal with this particular issue (i.e. output a squarewave on a pin, then adjust per measurement).
Finally I got a response from Microchip support: "I got a response from our development team. As of the moment, there is no plan in supporting OSCCAL feature in PICkit 3.". So now it is official: PICkit 3 is worse than PICkit 2.
Talking about nightmares. PICkit 3 is an absolute nightmare and sometimes it just doesn't work. Both the software and hardware are too complicated and prone to fail. I almost bricked the thing once. I ceased to use PICs a long time ago, because the programming tool is garbage and you need to pay just to optimize the code.
Now I use the Parallax Propeller with an FTDI UART (but any kind of USB to UART converter will do). The software tool SimpleIDE works on Linux as well as on Windows. It works every time, provided I don't mess up the definitions. It supports all configurations you can think of, clock rates, baud rates, you name it. Never had any problems with it. Bricking it is pretty much impossible.