12F675 Calibration?


Closed Thread
Results 1 to 8 of 8
  1. #1
    brodin's Avatar
    brodin Guest

    Default 12F675 Calibration?

    I did something stupid today. I bought a 12F675, and without reading the datasheet i erased it the first thing i did. Very stupid!

    Now the OSC calibration values are gone, aren't they? How can i get them back? The datasheet says something about that it is possible to get them form Microchip.

    Help!!!

    How shall i do?


    Is the value uniqe for every single PIC, or is it the same for all of them

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


    Did you find this post helpful? Yes | No

    Default

    Apart from losing the OSCAL values you've probably also erased the BANDGAP presets.

    Firstly, let's deal with OSCAL... the PIC will stilll work, but the internal oscillator will be off by an unknown amount. This OSCAL value is unique to each PIC, so reading mine and giving it to you will be pretty meaningless. If you are going to use an external xtal or resonator then again there is no problem. The problem remains if you are going to use the INTERNAL Oscillator with time critical applications (eg serial comms like SERIN/OUT etc).

    Most good programmers have an option to preserve the OSCAL and BANDGAP bits when programming and erasing, and now is the time to ensure yours are set.

    There's many methods to tune your OSCAL. Here's some depending on your patience and available hardware...

    Method 1. Create a simple program (say LED Blink), set the OSCAL value to mid-way and PIC to have the oscillator output it's clock on OSC2/GP4 with the define...

    @ DEVICE pic12F675, INTRC_OSC_CLKOUT

    Attach a frequency counter to GP4 and trim your OSCAL value up or down accordingly (yes you need to reprogram the PIC each time) to what the frequency counter is telling you.

    Method 2. Create a simple program and have say DEBUG at 4800 in a loop sending a series of 'U's... eg

    DEBUG REP "U"\16,13,10

    Now, connect to your PC and go thru OSCAL values until you reach a band of values that display the characters properly on your PC. Chose the mid-band value as your final OSCAL.

    Now for the BANDGAP. There are only four possible settings, so life is easy. The BANDGAP trims the on-board voltage reference used for BOR and POR. If it's wrong, then most probably BOR and POR won't meet the published specs. Again, write a simple program, say to blink an LED and wind the voltage down on a variable PSU and read on an accurate DVM to see at which point BOR activates. Adjust accordingly.

    Personally, it's so much aggrevation for so little gain, I'd put the PIC asside for the first non-critical application or toy I'd need to make, and go buy another one. They're only about $1.50 - so how much time do you want to devote to this?

    Melanie

  3. #3
    brodin's Avatar
    brodin Guest


    Did you find this post helpful? Yes | No

    Default

    thanks a lot!

    Mabybe you are right =) (about the price)

    By the way, where do you buy your PICs and other components? $1.5 sound cheep for a 675. I pay like $2.5

    How much do you pay for a PIC16F876A?

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


    Did you find this post helpful? Yes | No

    Default

    We probably pay less because we usually bulk purchase. I don't use the 16F876A part, but the straight 16F876 is between $4 and $4.50 in volume. About 99% of all our PIC's are imported bulk from the far east. The remaining 1% or so are sourced locally in the UK. You should try Crownhill, they're really not too bad with their PIC pricing for small quantities and as a bonus you end up supporting this web site...

    www.crownhill.co.uk

  5. #5
    brodin's Avatar
    brodin Guest


    Did you find this post helpful? Yes | No

    Default

    Okay.

    I have another question about the 675. How good is the internal 4 MHz? Is it as good as a crystal when it is calibrated? I mean how stable and accurate is it?

    I need it to an extremly timing accurate project, where i earlier have used a 16F84 and a 4MHz crystal.

  6. #6
    Join Date
    Oct 2003
    Location
    holland
    Posts
    251


    Did you find this post helpful? Yes | No

    Default here is the solution

    look at this url: http://www.microchip.com/1010/suppdo...n250/index.htm
    and there is the sollution for you problem.
    succes with it
    greetings
    Mat

  7. #7
    Desterline's Avatar
    Desterline Guest


    Did you find this post helpful? Yes | No

    Default

    >I have another question about the 675. How good is the >internal 4 MHz? Is it as good as a crystal when it is calibrated?

    No.

    >I mean how stable and accurate is it?

    Not very. It's fine for a lot of things, but I wouldn't even consider it for serial communications or RTC functions or the like.

    >I need it to an extremly timing accurate project, where i earlier >have used a 16F84 and a 4MHz crystal.

    The easy answer here is to use a crystal for this project too.

    -Denny

  8. #8
    Join Date
    Dec 2003
    Location
    WI
    Posts
    13


    Did you find this post helpful? Yes | No

    Default

    I get my PIC's at http://www.glitchbuster.com/

    Great prices and cheap shipping.

    Jason
    Last edited by jbirnsch; - 6th January 2004 at 01:44.

Similar Threads

  1. 12F683 vs 12F675.
    By sccoupe in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 11th July 2009, 04:58
  2. LANC code 12F675
    By MikeDD in forum General
    Replies: 4
    Last Post: - 9th May 2008, 05:44
  3. serout out of order on 12F675
    By Ricardo in forum Serial
    Replies: 7
    Last Post: - 29th April 2008, 00:16
  4. OSC Calibration byte in wrong location?
    By ehoskins in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 4th October 2006, 19:44
  5. 12F675 code sample
    By marad73 in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 23rd May 2006, 13:53

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