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?
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?
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?
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.
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.
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.
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.
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
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.