12F675 - another issue


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    579

    Default 12F675 - another issue

    Hello ! I use in many projects PIC 12F675. For programming I use WinPic 3.55b.
    I wrote one code like this :
    Code:
    @ DEVICE PIC12F675, INTRC_OSC_NOCLKOUT, WDT_OFF, PWRT_ON, MCLR_OFF, BOD_OFF, PROTECT_ON
    DEFINE OSCCAL_1K 1
    DEFINE OSC  4
    DEFINE ADC_BITS 10
    DEFINE ADC_CLOCK 3
    DEFINE ADC_SAMPLEUS 50
    
    CMCON = 7
    OPTION_REG  = %10000110
    TRISIO      = %00011110                ' if 1 then GPIO=input ; if 0 then GPIO=output
    ANSEL       = %00011000
    ADCON0      = %10001101
    etc.
    When I try to programming the PIC, I receive this message. Usually I choose the "Yes" option, but I wonder if is OK ? Which option it's better ? Thanks in advance for help !
    Attached Images Attached Images  

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


    Did you find this post helpful? Yes | No

    Default Re: 12F675 - another issue

    If your application is not that much timing sensitive, get rid of the DEFINE OSCCAL line.

    There's a thread in here showing how to recover the OSCCAL value.

    Before ereasing the PIC, you may want to read the OSCCAL value, write it on a label, stick it on the top of your PIC and then set it manually your code.

    Same goes for the Bandgap value
    ^Note 1: The Bandgap Calibration bits are factory programmed and must be read and saved prior to erasing
    the device as specified in the PIC12F629/675 Programming Specification. These bits are reflected
    in an export of the configuration word. Microchip Development Tools maintain all calibration bits to
    factory settings.
    Last edited by mister_e; - 26th August 2011 at 17:41.
    Steve

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

  3. #3
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    579


    Did you find this post helpful? Yes | No

    Default Re: 12F675 - another issue

    Thank You !
    ...and if I need the DEFINE OSCCAL too ?
    What it's the right answer ? NO ?

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


    Did you find this post helpful? Yes | No

    Default Re: 12F675 - another issue

    Your screen shot only talk about the BandGap, not the OSCCAL. read the PIC and see what's written to 0x3ff, should be something like 3480. If there's a value there, you're up to go.

    My feeling is that some less sensitive device programmer software will erase the BandGap value BECAUSE it is located in the CONFIG register... the same who set your configuration fuses... nothing you can really do. However the Bandgap is for BOD and POR you may set them the way you like. I would dare to say to click on YES which seems to say it actually read the existing one BEFORE doing anything 'bad'.
    Steve

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

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