Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PIC oscillator question

Status
Not open for further replies.
Alrightee I have two questions.

First, if I have a 20MHz crystal + capacitors hooked up to a PIC16F877 at the respsctive pins, this would mean that the actual chip runs at 5MHz, right? (meaning that you just divide whatever size your crystal is by four) I know that this works for another PIC I have, it's just not in the 16F877's datasheet (meaning where you would divide the oscillator by four).

Second, the Part number that I have is a PIC16F877-04/P. Does this mean that the fastest that this chip can run is at 4MHz even though in the datasheet it says that it runs at 20MHz?
 
First, if I have a 20MHz crystal + capacitors hooked up to a PIC16F877 at the respsctive pins, this would mean that the actual chip runs at 5MHz, right?
Yes.

I know that this works for another PIC I have, it's just not in the 16F877's datasheet (meaning where you would divide the oscillator by four).
As far as I know all 16F's (and others) are built that way.

Second, the Part number that I have is a PIC16F877-04/P. Does this mean that the fastest that this chip can run is at 4MHz even though in the datasheet it says that it runs at 20MHz?
That chip is rated at 4MHz. You might overclock it a bit, but you'll never get 20MHz out of it.
 
Hi,
1. It is still running at 20 MHz, and 5 MIPS (Mega Instruction Per Second). It takes 4 clock cycles for each instruction.

2. No. I'm not sure about the 04, P is probably indicating the PDIP package. The PIC16F877 should have the spec according to the datasheet.
 
Last edited:
Second, the Part number that I have is a PIC16F877-04/P. Does this mean that the fastest that this chip can run is at 4MHz even though in the datasheet it says that it runs at 20MHz?

The datasheet clearly says it can only run at 4MHz max.
 

Attachments

  • PICsp.gif
    PICsp.gif
    9.5 KB · Views: 284
Last edited:
That chip is rated at 4MHz. You might overclock it a bit, but you'll never get 20MHz out of it.

Do you genuinely think that MicroChip have separate production lines for 4MHz chips and 20MHz chips?.

I've never seen a 4MHz chip that didn't work perfectly at 20MHz (where there are 20MHz versions of the same chip). Even the ancient 16F84, where they didn't make 20MHz versions, work perfectly fine at 12MHz - the highest I've had occasion to try on one.
 
Do you genuinely think that MicroChip have separate production lines for 4MHz chips and 20MHz chips?
Well... I guess not. I know Intel doesn't for CPU's. If they're in a hurry they just sort em into different piles. If they aren't, they test them to see if they'll run at a certain speed before sorting. At least that's what I've heard. Could be a load of bollocks for all I know. :p

I've never seen a 4MHz chip that didn't work perfectly at 20MHz (where there are 20MHz versions of the same chip).
I have! But it was **broken link removed**. Probably there wasn't a 20MHz version at the time it was made. It won't run at 20MHz. I haven't tried anything between 4 and 20MHz.

For the OP's 16F877 I just looked at the datasheet and assumed it was correct.

EDIT: To the original poster (OP): Easiest way to find out is to just try it with different clock rate crystals. Try a 4MHz, 8MHz, 12MHz or whatever you have. If it runs at 4MHz but not at higher speeds, then it's a 4MHz part. It won't hurt anything to clock it faster than rated.
 
Last edited:
Well... I guess not. I know Intel doesn't for CPU's. If they're in a hurry they just sort em into different piles. If they aren't, they test them to see if they'll run at a certain speed before sorting. At least that's what I've heard. Could be a load of bollocks for all I know. :p

Sounds likely - but while you might grade on test from 800MHz down to 700MHz, you aren't going to leap from 20MHz down to 4MHz.

I have! But it was **broken link removed**. Probably there wasn't a 20MHz version at the time it was made. It won't run at 20MHz. I haven't tried anything between 4 and 20MHz.

The 16F84 was only available as 4MHz and 10MHz - and the 10MHz might have been a later addition, I can't remember back that far :D

EDIT: To the original poster (OP): Easiest way to find out is to just try it with different clock rate crystals. Try a 4MHz, 8MHz, 12MHz or whatever you have. If it runs at 4MHz but not at higher speeds, then it's a 4MHz part. It won't hurt anything to clock it faster than rated.

I don't think you'll ever find one that won't easily exceed 4MHz - it's also worth trying both XT and HS options, over the years I've often forgotten to alter the setting, and they have always worked regardless.
 
Thank you for the help. I did eventually find someting in the datasheet on what speed to set it to, and from how everything looks I'll probably run it at 4MHz.

just another quick question that is --somewhat related, but I've been having a little bit of trouble getting ahold of the .inc file for the PIC16F877. would it be possible to use the .inc file for the PIC16F877A for the PIC16F877?
 
I've been having a little bit of trouble getting ahold of the .inc file for the PIC16F877. would it be possible to use the .inc file for the PIC16F877A for the PIC16F877?
You're running MPLAB? You're programming in assembler? If so, the include files are at c:\Program Files\Microchip\MPASM Suite. Adjust that file path to suit differences in your install, like maybe you installed it on D or E drive, and/or in a different directory or whatever.

There's an include file there for every supported PIC, including the 877 and the 877A.
 
Status
Not open for further replies.

Latest threads

Back
Top