Regenerating OSCAL and Bandgap


Closed Thread
Results 1 to 5 of 5
  1. #1
    malc-c's Avatar
    malc-c Guest

    Default Regenerating OSCAL and Bandgap

    Hi,

    I'm posting this on behalf of a friend. He's just getting to grips with PIC programming and PBP. In the course of trying to program his 12F675 pics with a simple "flash an led" code using WinPic software and a serial JDM programmer he has over-written the OSCAL and Bandgap settings and now thinks the pics are wasted and of no use.

    Is there a way using the equipment and software to re-generate the OSCAL setting ?

    I have a Microchip PicKIT1 which has the option to re-generate the OSCAL value and set the Bandgap to one of three values, so if I screw up its not a problem

  2. #2
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Both are of little consequence.

    The OSCAL value trims the INTERNAL Oscillator. This is only important for timing critical functions. Set the CONFIG fuse settings to give you CLKOUT on GP4 and play with the settings until you get as close to 4MHz as possible using a Frequency Counter.

    Alternatively, DEBUG out a string like "abcdefghijk" followed by a CR/LF, in a continuous loop starting at 300 baud, and adjust the OSCAL values until you get something sensible on Hyperterminal. Once you've got it working, increase the baudrate to 2400 or 9600 and repeat for a finer trim setting.

    If you don't plan to do timing critical functions it's a complete waste of effort. Get a life, get a beer, get anything, damn PIC costs less than a Dollar USA and how many hours did you plan to spend on this?

    The BANDGAP just trims the BOR and POR values. Set the PCON register to enable BOD, have a simple LED program in a loop. Use a variable power supply along with a good DVM to drop the supply voltage until the PIC trips-out. Trim the bandgap until the PIC trips within the value range in the published specifications. A lot of hassle to trim a few millivolts here or there.

  3. #3
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Melanie

    If you don't plan to do timing critical functions it's a complete waste of effort. Get a life, get a beer, get anything, damn PIC costs less than a Dollar USA and how many hours did you plan to spend on this?
    That was my thought to be honest... but like I said I was posting on behalf of a friend, who felt that the pics were usless !

  4. #4
    Join Date
    Jan 2005
    Posts
    21


    Did you find this post helpful? Yes | No

    Default

    Look for "Recover.bas" in your PBP sample folder. Also here a link "http://users.tpg.com.au/btkelly/pic/osccal_sync.html"

    Kman

  5. #5
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    Thanks - I'll pass on the info

Similar Threads

  1. 12F675 Calibration?
    By brodin in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 6th January 2004, 01:41

Members who have read this thread : 0

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