The internal osc isn't normally accurate enough for reliable serial communications.
It may work in one app, then not in the next. If you want reliable serial comms, go for an
external crystal or resonator. But if you are using the internal osc on this PIC, then you for
for sure want the DEFINE OSCCAL_1K 1 in there to load the factory osccal calibration value
at power-up.
Pretty much any decent device programmer will preserve the factory osccal value, but if it
doesn't, it's never going to work right with DEFINE OSCCAL_1K 1 in your code.
I.E. if your device programmer erases the last program memory location where the RETLW
xx (XX being the factory cal value to load into OSCCAL), and you insert DEFINE OSCCAL_1K
1 in your code, it creates a nasty loop you'll never get out of.
PBP inserts a call to the last program memory loaction when you include this DEFINE. If the
RETLW xx isn't there, it rolls-over back to location 0, and you land on the call repeatedly.
You can check by just reading your 12F with your programmer and checking to see if the
last program memory location has been erased.
If it has been erased, there are several threads here on how to fix this.
Nope. PBP doesn't support 5MHz osc speeds. Check in the back of your PBP manual in the DEFINEI have an external crystal here that has 5.000 on it, so I assume that is 5mhz. Will this work
section for a list of supported osc speeds.
There's also a schematic in your manual for connecting an external crystal with caps.
If you're using a 3-pin resonator with internal caps, ground the center leg & connect the
other two to the PIC OSC1 & OSC2 pins.
Bookmarks