PDA

View Full Version : Setting OSC pins to o/p's



jmgelba
- 7th October 2005, 16:32
I need to use all the o/p's on my 16F818 and 2 are tied up with the resonator. I want to run using the internal 8MHz oscillator and use the 2 pins as o/p's. How do I program the fuse in EPIC to do that? I see an option for internal plus clock out on those pins.

mister_e
- 8th October 2005, 10:28
there's probably an option like Internal OSC I/O. And you will need to set MCLR to internal to free your RA5 pin.

Personnally i prefer to do it in the code instead of setting config fuse manually in the programmer software.

Look at the following to know how set the PIC config fuses in your code:
http://www.picbasic.co.uk/forum/showthread.php?t=543

Now, if my memory is good, the F818 default oscillator speed is 32KHZ, have a look to the datasheet in the Oscillator section. Search for the OSCCON register or something like that. Also look at the following link to Melabs Website
http://www.melabs.com/support/mcu_hints.htm#81x

peterdeco1
- 8th October 2005, 10:41
Hope this helps:
'OSCCON VALUES FOR 16F818/819:
'OSCCON = $00 '31.25 khz DEFAULT
'OSCCON = $10 '125khz
'OSCCON = $20 '250khz
'OSCCON = $30 '500khz
'OSCCON = $40 '1mhz
'OSCCON = $50 '2mhz
'OSCCON = $60 '4mhz
'OSCCON = $70 '8mhz

jmgelba
- 8th October 2005, 22:48
Awesome guys, thanks for the replies. I'll let you know how I get on.

jmgelba
- 20th October 2005, 20:15
I got around to working on this today and couldnt get the config working correctly.
I edited the 16f818.INC file and commented out the DEVICE CONFIG line. It solved the overwrite error.
However, when I get into the EPIC programming screen, my configs are set back to EPICs defaults and it programs to whatever EPIC is set to. The config in the code is completely ignored. As I see it, there is no option in EPIC for having internal clock with I/O's, only internal clock with clock in, or clock out.
So how do I get EPIC to program the device with the config in my code?

jmgelba
- 20th October 2005, 21:34
Nevermind, problem solved.