I have some troubles understanding the datasheets when comes to use the internal oscilator in a PIC 12F629, using C (MPLAB X IDE + XC8 compiler). Also I don't have any PICKIT or anything, I use a DIY K150 programmer. I have read that the manufacturer calibration could be erased when I burn the program. So the specific question is: Which would be the code to use the internal oscilator? (__CONFIG ?) Feel free to recommend a burning procedure.
PS: Sorry for the bad english…
Electronic – How to program PIC 12F629 internal oscilator in C
cmplabpic
Related Topic
- Electronic – PIC18F24K50 vendor-defined USB device using libusb, what is needed
- Electronic – Does any MPLAB compiler e.g XC8 have built in functions to control PIC peripherals like in CCS PIC C
- Electronic – PIC Kit 3 – PIC32 memory mismatch error
- Is it possible to program PIC18F device with .hex and .bin files
- Electronic – PIC10F200 internal clock
- Electrical – Simple number counter – PIC16F877A microcontroller problem
- Electronic – Best approach for PIC programming I need to do
Best Answer
In order to choose for internal oscillator in MPLAB X go to window\PIC memory views\configuration bits
in the row of the FOSC choose one of the INTOSC options and any other configuration you would like
press on the "Generate Source Code to Output" button
copy the text you received to the top of the main.c file
If you see the text you copied displayed as errors don't mind it, it is a known bug in MPLAB X
I never worked with pic12f629 using MPLAB X but basically if you don't erase the entire PIC your OSCCAL will be saved. OSCCAL corruption can also happen if your programing fails (e.g. bad connection during programing). if that happend you should use user2320835 advice and use the XC8 linker option
If i were you i would also try to check for the basic examples found on microchip.com, it will be a very good start