Dummy Needs help with 12f675


Results 1 to 8 of 8

Threaded View

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


    Did you find this post helpful? Yes | No

    Default

    With 8-bit PIC's like the 12C509, there are no Flash equivallents. You are either good at programming and get it right first time, or you fill up a garbo skip parked outside your office/house/garden shed with dead parts that didn't work because you made a boo-boo programming these one-time parts. To help the terminally dsylexic, Microchip came out with the J-series UV eraseable parts. Cooking them under a UV lamp for quarter of an hour, or out in the sunlight in the Arizona desert for two years (the non-urgent projects) would neatly erase the chip. Unfortunately, it also erased the OSCCAL value (see further down). So you had to read the chip FIRST, and then replace the OSCCAL value by writing that value back into your program or presetting it manually into your programmer.

    The 12F675 and it's dinky brothers has TWO sets of configuration bits which should be preserved at program time. These are the OSCCAL and BANDGAP bits. Most sensible programmers (the machines not the people) can be set to avoid overwriting these bits when programming or erasing the chip which means you can dispense with reinserting them back into your program. Hell... you got 1,000 12F675's to program it'll be a bit of a chore to read the value from each of them first and to embed it manually thereafter. So basically, you can dispense with PBP's OSCCAL defines and setting for the 12F675... it's really intended for UV parts.

    You're just about to ask "Why are these bits important?", so I'll tell you...

    The OSCCAL value trims the internal 4MHz oscillator to as close to 4Mhz as they can be bothered to get it in the factory. Still no replacement for using an Xtal or Resonator when doing high-speed comms, but the internal oscillaor is however reliable enough for 2400 baud providing you don't screw-up OSCCAL too much. If you do lose OSCCAL by inadvertantly erasing it, the chip is still fully useable, but the timing won't be 4.000MHz... (it never is anyway) but could vary by a percentage point or so. Let's face it, if you're blinking an LED at one Hz, you don't really care if it's 1.0000Hz, or 0.98Hz or 1.02Hz.

    The BANDGAP bits are used to trim the on chip voltage reference. This voltage reference is NOT the VRef for the Comparators set by VRCON, but just a variable voltage divider used to trim the reference for POR/BOR. If they are changed the reference will probably not meet the accuracy specifications in the Data Sheet. No big deal for Hobbyists or non-critical applications either.

    @ DEVICE INTRC_OSC_NOCLKOUT

    The above line tells the PIC to use the internal oscillator (INTRC_OSC) no xtals, resonators or other external circuitry required, and we don't want the clock appearing on any pin (NOCLKOUT) leaving BOTH those pins available for I/O.

    @ DEVICE MCLR_OFF

    That line tells the PIC to use it's internal MCLR circuitry, and leaves that pin free for Input. Note that the MCLR pin (GP3) is INPUT ONLY.

    Melanie
    Last edited by Melanie; - 14th October 2003 at 19:48.

Similar Threads

  1. 12F683 vs 12F675.
    By sccoupe in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 11th July 2009, 04:58
  2. DS1302 16F628 Woes
    By idtat in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 15th January 2009, 14:15
  3. LANC code 12F675
    By MikeDD in forum General
    Replies: 4
    Last Post: - 9th May 2008, 05:44
  4. Instant Interupts with a 12f675
    By wlundonly in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 26th January 2008, 01:52
  5. Serial LCD on 12F675
    By anj in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 31st March 2004, 23:11

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