Searching \ for '[PIC]: PIC12F675 - I got an LED to flash!' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/displays.htm?key=led
Search entire site for: 'PIC12F675 - I got an LED to flash!'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: PIC12F675 - I got an LED to flash!'
2002\11\06@040845 by Sean Alcorn - Avion SYD

flavicon
face
Hi guys,

Well I've achieved my next milestone. I keyed in a few lines of code
today and had an LED flashing nicely at approximately 1Hz. However just
as I hit the program button, I realised I may have done one thing
wrong. I did not open the Program/Verify window of MPLAB. If I had, I
would have noticed that "Calibration Memory" was checked.

I know this is bad news for a JW Part - unless you record the factory
setting. Does this apply to EEPROM parts also?

The data sheet says;

"Note: Erasing the device will also erase the pre-programmed internal
calibration value for the internal oscillator. The calibration value
must be saved prior to erasing part."

However, what happens for the first write, and subsequent re-writes if
the "Calibration Memory" is selected in the Program/Verify dialogue box
is not clear.

Is it wise to erase a EEPROM part before re-writing with new code? Or
does each (used) register get cleared first prior to writing?

Sorry if this is old stuff for you guys, but I have only used OTP parts
with JW equivalents till now. I have not used a EEPROM part with
internal clock.

Also, writing to the OSCCAL register appears to be different to the
PIC12C508 and PIC12C671 parts. The data sheet now says;

bsf     STATUS, RP0     ;Bank 1
call    3FFh            ;Get the cal value
movwf   OSCCAL          ;Calibrate
bcf     STATUS, RP0     ;Bank 0

Am I mistaken, or did the PIC12C508 and PIC12C671 basically powerup at
the end of it's memory and effectively do a movlw   [calibration value]
- then your first instruction simply needed to be a MOVWF   OSCCAL -
did it not?

It's interesting that there is no Window > Calibration Data option when
I have PIC12F675 selected in MPLAB v5.70.40, however when I change to
any of the 12C series, I can open a dialogue box called "Calibration
Contants" by selecting Calibration Data from the Windows menu. How is
is possible to read (and therefore record) the factory set calibration
data for a PIC12F675 or is it simply not necessary?

Regards,

Sean Alcorn

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email spam_OUTlistservTakeThisOuTspammitvma.mit.edu with SET PICList DIGEST in the body


2002\11\06@080507 by Olin Lathrop

face picon face
> Well I've achieved my next milestone. I keyed in a few lines of code
> today and had an LED flashing nicely at approximately 1Hz. However just
> as I hit the program button, I realised I may have done one thing
> wrong. I did not open the Program/Verify window of MPLAB. If I had, I
> would have noticed that "Calibration Memory" was checked.

Good programmers will follow the Microchip recommendation to read the
calibrated values, erase the chip, then write the calibrated values back.
A recent programmer I worked on does exactly that for the 12F628/675.
You'd have to check the documentation for the specific programmer, or how
MPLAB handles it if you are programming directly from MPLAB.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email .....listservKILLspamspam@spam@mitvma.mit.edu with SET PICList DIGEST in the body


2002\11\06@160253 by Tony Nixon

flavicon
picon face
Sean Alcorn - Avion SYD wrote:
>
> Hi guys,
>
> Well I've achieved my next milestone. I keyed in a few lines of code
> today and had an LED flashing nicely at approximately 1Hz.


Me too :-)

However just
> as I hit the program button, I realised I may have done one thing
> wrong. I did not open the Program/Verify window of MPLAB. If I had, I
> would have noticed that "Calibration Memory" was checked.
>
> I know this is bad news for a JW Part - unless you record the factory
> setting. Does this apply to EEPROM parts also?
>
> The data sheet says;

I've got my programmer working with these things, and the spec says to
read OSCAL abd bangap values before erasing and restore them afterwards.
The programmer is responsible for maintaining the data, although it
would be wise to read these and store them just in case.

{Quote hidden}

The 12C50x powers up at last memory, the 12C6xx at first.

12C50x has movlw OSCCAL
12C6xx has retlw OSCCAL

> It's interesting that there is no Window > Calibration Data option when
> I have PIC12F675 selected in MPLAB v5.70.40, however when I change to
> any of the 12C series, I can open a dialogue box called "Calibration
> Contants" by selecting Calibration Data from the Windows menu. How is
> is possible to read (and therefore record) the factory set calibration
> data for a PIC12F675 or is it simply not necessary?

Just read the chip. and note the data.

--
Best regards

Tony

mICros
http://www.bubblesoftonline.com
salesspamKILLspambubblesoftonline.com

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email .....listservKILLspamspam.....mitvma.mit.edu with SET PICList DIGEST in the body


2002\11\06@180116 by Sean Alcorn - Avion Sydney

flavicon
face
Olin,

> Good programmers will follow the Microchip recommendation to read the
> calibrated values, erase the chip, then write the calibrated values
> back.
> A recent programmer I worked on does exactly that for the 12F628/675.
> You'd have to check the documentation for the specific programmer, or
> how
> MPLAB handles it if you are programming directly from MPLAB.

The MPLAB help file has a step-by-step procedure how to read the
calibration value, record it (or export it as a HEX file) and then
procedures how to use this for subsequent writes. The interesting part
is though, that you can not open the Calibration Memory dialogue box
while you have PIC12F675 - so perhaps it is automated as you say. If I
select a PIC12C508 or PIC12C671 etc, then I can access the Calibration
Memory window.

I may have to go back to Microchip to be sure. I need *reasonable*
accuracy in the clock, and I was certainly satisfied with the 12C
series. The 12Fs are supposed to be even more accurate - but I had
better find out how to calibrate them correctly.

Cheers,

Sean

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email EraseMElistservspam_OUTspamTakeThisOuTmitvma.mit.edu with SET PICList DIGEST in the body


2002\11\06@190956 by Dwayne Reid

flavicon
face
At 08:06 PM 11/6/02 +1100, Sean Alcorn - Avion SYD wrote:
>However just
>as I hit the program button, I realised I may have done one thing
>wrong. I did not open the Program/Verify window of MPLAB. If I had, I
>would have noticed that "Calibration Memory" was checked.
>
>I know this is bad news for a JW Part - unless you record the factory
>setting. Does this apply to EEPROM parts also?

MPLAB will NOT alter the value of the calibration registers if they contain
valid data.  The following is a copy/paste of the replies I received from
David Otten of Microchip.  He is apparently the person responsible for
writing the 12f675-specific portions of MPLAB.

Copy begins:

To: Dwayne Reid <dwaynerspamspam_OUTplanet.eon.net>
Subject: Re: Calibration Memory for 12f675
Date: Wed, 11 Sep 2002 15:43:31 -0700
X-MIMETrack: Serialize by Router on USMail1/US/Microchip(Release 5.0.10
|March 22, 2002) at
09/11/2002 03:43:32 PM,
Serialize complete at 09/11/2002 03:43:32 PM

Hi Dwayne -

Thanks for the feedback. The programmers and ICD won't support changes to
the oscillator and bandgap calibration bits. They're always restored to
their factory settings after programming. Since the older EPROM devices
needed to be UV erased, the calibration windows were required which isn't
the case for the flash parts.

Best regards,

David Otten


To: Dwayne Reid <@spam@dwaynerKILLspamspamplanet.eon.net>
Subject: Re: Calibration Memory for 12f675
From: KILLspamDavid.OttenKILLspamspammicrochip.com
Date: Wed, 11 Sep 2002 18:03:12 -0700
X-MIMETrack: Serialize by Router on USMail1/US/Microchip(Release 5.0.10
|March 22, 2002) at
09/11/2002 06:03:13 PM,
Serialize complete at 09/11/2002 06:03:13 PM

Dwayne -

The calibration bits will be erased when the part is bulk erased per the
data sheet. Our programmers read the calibration bits then reprogram them
during the erase/program cycle. Our programmers won't lose the calibration
information.

Take care,

David


From: RemoveMEDavid.OttenTakeThisOuTspammicrochip.com
Date: Thu, 12 Sep 2002 10:50:24 -0700
X-MIMETrack: Serialize by Router on USMail1/US/Microchip(Release 5.0.10
|March 22, 2002) at
09/12/2002 10:50:26 AM,
Serialize complete at 09/12/2002 10:50:26 AM

Dwayne -

Our programmers won't (aren't suppose to) lose calibration data even if you
bulk erase the device and remove it. After the bulk erase, the calibration
bits are reprogrammed. As far as using the calibration window for other
parts, I'm not in the loop for tool specifics. I know everything is moving
to MPLAB 6.xx so hopefully that will be easier to use.

Take care.

David

<end of copy>


Hope this helps!

dwayne

--
Dwayne Reid   <spamBeGonedwaynerspamBeGonespamplanet.eon.net>
Trinity Electronics Systems Ltd    Edmonton, AB, CANADA
(780) 489-3199 voice          (780) 487-6397 fax

Celebrating 18 years of Engineering Innovation (1984 - 2002)
 .-.   .-.   .-.   .-.   .-.   .-.   .-.   .-.   .-.   .-
    `-'   `-'   `-'   `-'   `-'   `-'   `-'   `-'   `-'
Do NOT send unsolicited commercial email to this email address.
This message neither grants consent to receive unsolicited
commercial email nor is intended to solicit commercial email.

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email TakeThisOuTlistservEraseMEspamspam_OUTmitvma.mit.edu with SET PICList DIGEST in the body


2002\11\06@201411 by Sean Alcorn - Avion SYD

flavicon
face
Thanks Dwayne,

> MPLAB will NOT alter the value of the calibration registers if they
> contain
> valid data.  The following is a copy/paste of the replies I received
> from
> David Otten of Microchip.  He is apparently the person responsible for
> writing the 12f675-specific portions of MPLAB.

> Thanks for the feedback. The programmers and ICD won't support changes
> to
> the oscillator and bandgap calibration bits. They're always restored to
> their factory settings after programming. Since the older EPROM devices
> needed to be UV erased, the calibration windows were required which
> isn't
> the case for the flash parts.

Until your post, I thought I may have killed (or at least wounded) one
of my brave little soldiers. After reading your post, I put a new
PIC12F675 in my programmer and read the data. The value of the last
register (which I think is 3FFh) was 3478. I then put the original one
I programmed in and read the data and the value was 3480. A third one
produced 3484, a fourth one 3488 etc.

So what David Otten is saying is that this is no longer an issue. It's
a no-brainer? No matter what I do in MPLAB, it is not possible to
delete that data?

What if you change the "End Address" when programming? Would this do it?

This is great news. I was disappointed when I found that I had lost the
data in my expensive /JW parts. :-(

Thanks again,

Regards,

Sean Alcorn

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email RemoveMElistservspamTakeThisOuTmitvma.mit.edu with SET PICList DIGEST in the body


2002\11\06@203159 by Tony Nixon

flavicon
picon face
Sean Alcorn - Avion SYD wrote:
>
> So what David Otten is saying is that this is no longer an issue. It's
> a no-brainer? No matter what I do in MPLAB, it is not possible to
> delete that data?

Knowing MPLABs bug history, I wouldn't count on it ;-)


> What if you change the "End Address" when programming? Would this do it?

MPLAB will 'remember' the OSCAL and BG bits and restore them after
programming.

I just verified this by writing 0x0000 to the cal location, but MPLAB
still wrote 0x3484 which was the original cal value.

--
Best regards

Tony

mICros
http://www.bubblesoftonline.com
salesEraseMEspam.....bubblesoftonline.com

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email EraseMElistservspammitvma.mit.edu with SET PICList DIGEST in the body


2002\11\06@204249 by Sean Alcorn - Avion SYD

flavicon
face
Tony,

> Knowing MPLABs bug history, I wouldn't count on it ;-)

Oh Ye of little faith! :-)

>> What if you change the "End Address" when programming? Would this do
>> it?
>
> MPLAB will 'remember' the OSCAL and BG bits and restore them after
> programming.
>
> I just verified this by writing 0x0000 to the cal location, but MPLAB
> still wrote 0x3484 which was the original cal value.

Yes. I did a barrage of similar tests this morning and could not trip
it up. Now on with the coding! My first A/D project and first to
actually use TMR0 instead of delay loops! I don't need to, but I
thought I gotta start sometime! :-)

Regards,

Sean

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email RemoveMElistservEraseMEspamEraseMEmitvma.mit.edu with SET PICList DIGEST in the body


2002\11\07@042914 by Alan B. Pearce

face picon face
>This is great news. I was disappointed when I found that I
>had lost the data in my expensive /JW parts. :-(

IIRC Microchip do have an app note on how to determine the value for the JW
parts if this happens. I thought I had a copy and could point you at it, but
cannot find it at the moment.

--
http://www.piclist.com hint: To leave the PICList
RemoveMEpiclist-unsubscribe-requestspam_OUTspamKILLspammitvma.mit.edu


2002\11\07@073501 by Olin Lathrop

face picon face
> So what David Otten is saying is that this is no longer an issue. It's
> a no-brainer? No matter what I do in MPLAB, it is not possible to
> delete that data?

Not as long as everything works correctly.  A power glitch during the
erase before the old values are restored would be a problem.  Fortunately
the vulnerability is only a fraction of a second long and such a loss
should therefore be very rare.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

--
http://www.piclist.com hint: To leave the PICList
RemoveMEpiclist-unsubscribe-requestTakeThisOuTspamspammitvma.mit.edu


More... (looser matching)
- Last day of these posts
- In 2002 , 2003 only
- Today
- New search...