Searching \ for '[PIC:] Cycle time on a 12F675 with 4Mhz internal R' 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/microchip/time.htm?key=time
Search entire site for: 'Cycle time on a 12F675 with 4Mhz internal R'.

Exact match. Not showing close matches.
PICList Thread
'[PIC:] Cycle time on a 12F675 with 4Mhz internal R'
2003\11\27@110807 by Andrew Herdman

flavicon
face
I have been playing with Microchip's PICkit 1 and the 12F675 8-Pin PIC.  I have been using the internal RC oscillator, as it keeps the number of external parts down, which keeps the playtime with the PIC up.  I have downloaded and read the documentation on the device and am confused by trying to figure out what the clock cycle time is.

What I think I know;

-The documentation says that the minimum cycle time is 200nS which is a 5MHz Clock
   -a 20MHz crystal used an external oscillator, would be divided by 4, in fact any external oscillator would be divided by 4
-the internal RC oscillator runs at ~4MHz, within 1% accuracy when calibrated.
   -the internal oscillator is not divided by 4, thus instruction cycle time is 250nS

Is this correct?  I understand some instructions may take 2 cycles to run.  Loops I have made appear to support that the internal RC oscillator is not divided by 4, but the documentation is not clear on this.

Thanks
 Andrew

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

2003\11\27@112645 by Mike Harrison

flavicon
face
On Thu, 27 Nov 2003 10:56:33 -0500, you wrote:

>I have been playing with Microchip's PICkit 1 and the 12F675 8-Pin PIC.  I have been using the internal RC oscillator, as it keeps the number of external parts down, which keeps the playtime with the PIC up.  I have downloaded and read the documentation on the device and am confused by trying to figure out what the clock cycle time is.
>
>What I think I know;
>
>-The documentation says that the minimum cycle time is 200nS which is a 5MHz Clock
>    -a 20MHz crystal used an external oscillator, would be divided by 4, in fact any external oscillator would be divided by 4
>-the internal RC oscillator runs at ~4MHz, within 1% accuracy when calibrated.
>    -the internal oscillator is not divided by 4, thus instruction cycle time is 250nS
>
>Is this correct? No, all oscillators are divided by 4. Internal 4MHz RC will give 1uS per instruction.

--
http://www.piclist.com hint: To leave the PICList
.....piclist-unsubscribe-requestKILLspamspam@spam@mitvma.mit.edu

2003\11\27@112646 by Wouter van Ooijen

face picon face
> Is this correct?  I understand some instructions may take 2
> cycles to run.  Loops I have made appear to support that the
> internal RC oscillator is not divided by 4, but the
> documentation is not clear on this.

The internal clock is handled the same way as an external clock, so the
PIC will run at 1 MIPS (except for PC-changing intsructions).

Wouter van Ooijen

-- -------------------------------------------
Van Ooijen Technische Informatica: http://www.voti.nl
consultancy, development, PICmicro products

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

2003\11\27@113308 by Spehro Pefhany

picon face
At 10:56 AM 11/27/2003 -0500, you wrote:
>I have been playing with Microchip's PICkit 1 and the 12F675 8-Pin PIC.  I
>have been using the internal RC oscillator, as it keeps the number of
>external parts down, which keeps the playtime with the PIC up.  I have
>downloaded and read the documentation on the device and am confused by
>trying to figure out what the clock cycle time is.
>
>What I think I know;
>
>-The documentation says that the minimum cycle time is 200nS which is a
>5MHz Clock
>     -a 20MHz crystal used an external oscillator, would be divided by 4,
> in fact any external oscillator would be divided by 4
>-the internal RC oscillator runs at ~4MHz, within 1% accuracy when calibrated.
>     -the internal oscillator is not divided by 4, thus instruction cycle
> time is 250nS
>
>Is this correct?  I understand some instructions may take 2 cycles to
>run.  Loops I have made appear to support that the internal RC oscillator
>is not divided by 4, but the documentation is not clear on this.

It's divided by 4, so 1us Tcy using the internal RC clock on the
aforementioned part.

Where the data sheet seems to offer insufficient information, you should
be checking the midrange reference manual. Usually it's there.

Best regards,

Spehro Pefhany --"it's the network..."            "The Journey is the reward"
.....speffKILLspamspam.....interlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com

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

2003\11\28@081003 by Olin Lathrop
face picon face
Andrew Herdman wrote:
> -The documentation says that the minimum cycle time is 200nS which is
> a 5MHz Clock

Yes, if you mean 5MHz instruction clock.

>     -a 20MHz crystal used an external oscillator, would be divided by
> 4, in fact any external oscillator would be divided by 4

Yes.

> -the internal RC oscillator runs at ~4MHz, within 1% accuracy when
> calibrated.

Yes.

>     -the internal oscillator is not divided by 4, thus instruction
> cycle time is 250nS

No.  All oscillators are divided by 4 because 4 clock phases are required by
the hardware to execute one instruction.  The internal 4MHz oscillator
causes 1MHz instruction rate, which is 1uS per instruction.


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

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2003\11\28@113933 by Mike

picon face
On 28 Nov 2003 at 8:08, Olin Lathrop wrote:

<snip>
> > -the internal RC oscillator runs at ~4MHz, within 1% accuracy when
> > calibrated.
>
> Yes.
>
That's interesting. I saw that 1% spec and later couldn't find it. I tried running internal
Osc and measured 1.5MHz CLK out which is 6MHz OSC in.

Now either my DVM freq counter is way off (kinda doubt it, but I stuck a XTAL in b4
breaking out the real freq counter) or the internal Osc is off. What is this calibration? I
couldn't find anything on that, just curves over temp and Vdd, IIRC.

BRs,
Mike

<snip>

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2003\11\28@120841 by

picon face
Mike wrote :

> What is this calibration?

Data sheet DS41190C, page 54, paragraph 9.2.5.1.

/Jan-Erik.

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2003\11\28@175403 by Olin Lathrop

face picon face
> That's interesting. I saw that 1% spec and later couldn't find it. I
> tried running internal Osc and measured 1.5MHz CLK out which is 6MHz
> OSC in.
>
> Now either my DVM freq counter is way off (kinda doubt it, but I
> stuck a XTAL in b4 breaking out the real freq counter) or the
> internal Osc is off. What is this calibration? I couldn't find
> anything on that, just curves over temp and Vdd, IIRC.

Some of the newer PICs do have about 1% or 2% accuracy in their internal
oscillator.  I don't remember for sure if the 12F629 is one of them, but I
thought so.  I was confirming the general way the internal oscillator
worked, and didn't really pay much attention to the accuracy spec.


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

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2003\11\28@181518 by

picon face
Olin Lathrop wrote :

> Some of the newer PICs do have about 1% or 2% accuracy in their internal
> oscillator.  I don't remember for sure if the 12F629 is one of them, but I
> thought so.

MC claim 1% *if* your programmer setup takes care of saving and
restoring the RETLW XX instruction in the last location of the
program memory. *And*, of course, that you include a CALL to this
instruction and saves the returned value in OSCCAL in your
startup part of your application.

Here is a major difference between this kind of "calibration"
and the method the newer parts (as the 18F1220) uses. There
you have the specific accuracy with a POR value (h'00') in
OSCCAL (or OSCTUNE as it's called there). So no need of any
RETLW or anyhing else...

Jan-Erik.

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2003\11\28@181727 by Stef Mientki

flavicon
face
The 12F675 uses a calibration byte in the PIC to adjust the oscillator.
The calibration is done at the factory.
When you (re-)program the chip, you always have to read the calibration
byte first (because it will be erased),
then program the chip and then write back the calibration value.
See for more information: DS41173B
A good programmer will do that automatic, and you won't be aware of.
If you loose the calibration value, Microchip has somewhere a program to
recalibrate the chip.

The 1% accuracy is only at a Vdd=3.5 V and a stable temperature of 25
Celcius.
A more realistic value spec is  +/- 2%  at 2.5V ... 5.5V  and 0..85
Celcius !
See for more information p95 of DS41190C.

Stef Mientki

Andrew Herdman wrote:

{Quote hidden}

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2003\11\28@182346 by

picon face
Stef Mientki wrote:

> The 12F675 uses a calibration byte in the PIC to adjust the oscillator.

It's actualy a 14-bit program memory *word*, not a byte...

No big deal, maybe :-)

Jan-Erik.

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2003\11\28@191027 by Stef Mientki

flavicon
face
Jan-Erik Soderholm XA (TN/PAC) wrote:

>Stef Mientki wrote:
>
>
>
>>The 12F675 uses a calibration byte in the PIC to adjust the oscillator.
>>
>>
>
>It's actualy a 14-bit program memory *word*, not a byte...
>
>No big deal, maybe :-)
>
Yes, you are completely right !
Bad ..., this is my third error today in a newsgroup :-(
So let me try to improve myself:
Only the 6 most significant bits of the 14 bit program memory word,
contribute to  the oscillator calibration information ;-)

Stef Mientki

>
>Jan-Erik.
>
>--
>http://www.piclist.com hint: PICList Posts must start with ONE topic:
>[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads
>
>
>

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2003\11\28@200542 by Spehro Pefhany

picon face
At 11:38 AM 11/28/2003 -0500, you wrote:


>Now either my DVM freq counter is way off (kinda doubt it, but I stuck a
>XTAL in b4
>breaking out the real freq counter) or the internal Osc is off. What is
>this calibration? I
>couldn't find anything on that, just curves over temp and Vdd, IIRC.

You have to load the OSCCAL register. It's done in those parts by calling
the last location in memory, IIRC (which had better not have been erased).
Before you do that, the oscillator runs uncalibrated.

Best regards,

Spehro Pefhany --"it's the network..."            "The Journey is the reward"
@spam@speffKILLspamspaminterlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2003\11\28@202900 by

picon face
Spehro Pefhany wrote:

> You have to load the OSCCAL register. It's done in those parts by calling
> the last location in memory, IIRC...

Correct, but not enough, you must also do a MOVWF OSCCAL after the CALL.
The CALL only will not do any difference by itself.

> (which had better not have been erased).

It is erased in each programming cycle, but it has to be pre-read and
re-written by the programming tools.

Jan-Erik.

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2003\11\28@203316 by

picon face
Ahem...

> Only the 6 most significant bits of the 14 bit program memory word,
> contribute to  the oscillator calibration information ;-)

Only the 6 most significant bits of the *8 least significant bits of the*
14 bit program memory word,

:-)

Jan-Erik.

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2003\11\29@010433 by Wouter van Ooijen

face picon face
> > The 12F675 uses a calibration byte in the PIC to adjust the
> oscillator.
>
> It's actualy a 14-bit program memory *word*, not a byte...

But that 14-bit word contains only 8 bits of data, and IIRC only a few
bits out of that are actually used for calibration.

Wouter van Ooijen

-- -------------------------------------------
Van Ooijen Technische Informatica: http://www.voti.nl
consultancy, development, PICmicro products

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2003\11\29@085147 by Olin Lathrop

face picon face
Jan-Erik Soderholm XA (TN/PAC) wrote:
> Stef Mientki wrote:
>
>> The 12F675 uses a calibration byte in the PIC to adjust the
>> oscillator.
>
> It's actualy a 14-bit program memory *word*, not a byte...

You are both right.  The last word of program memory contains a RETLW
instruction.  This takes up a whole program memory word, but the data is one
8 bit byte.  Of those 8 bits, only the high 6 are actually used in the
current implementation.  The low 2 bits written to the OSCCAL register are
ignored.


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

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

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