Setting OSC pins to o/p's


Closed Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2004
    Location
    Michigan, USA
    Posts
    305

    Default Setting OSC pins to o/p's

    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.

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    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
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3


    Did you find this post helpful? Yes | No

    Smile

    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

  4. #4
    Join Date
    Feb 2004
    Location
    Michigan, USA
    Posts
    305


    Did you find this post helpful? Yes | No

    Default

    Awesome guys, thanks for the replies. I'll let you know how I get on.

  5. #5
    Join Date
    Feb 2004
    Location
    Michigan, USA
    Posts
    305


    Did you find this post helpful? Yes | No

    Default

    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?

  6. #6
    Join Date
    Feb 2004
    Location
    Michigan, USA
    Posts
    305


    Did you find this post helpful? Yes | No

    Default

    Nevermind, problem solved.

Similar Threads

  1. PICKit2 - warning about configuration words
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 26
    Last Post: - 4th August 2009, 14:01
  2. Problem setting pins on 12f675
    By srnet01 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 19th February 2009, 15:58
  3. Change On Interrupt, PIC16F884
    By elec_mech in forum mel PIC BASIC Pro
    Replies: 17
    Last Post: - 14th November 2008, 17:25
  4. Setting up the oscillator
    By J_norrie in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 2nd October 2007, 14:53
  5. Setting up 5 HPWM pins on 18F4680
    By tcbcats in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 2nd August 2006, 05:54

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts