PDA

View Full Version : Pls How can I make 16F877A use 15MHz Xtal



ozzie1st
- 18th April 2007, 17:19
Hi I am using a PIC 16F877A in my project. The Project works fine with a 4MHz crystal but when I replace the 4MHz crystal and its associated capacitors with a 15 MHz crystal and associated capacitors, The pic does not work
Does anyone know what needs to be done in PIC basic to make the 16F877A work?
Thanks

skimask
- 18th April 2007, 17:23
Hi I am using a PIC 16F877A in my project. The Project works fine with a 4MHz crystal but when I replace the 4MHz crystal and its associated capacitors with a 15 MHz crystal and associated capacitors, The pic does not work
Does anyone know what needs to be done in PIC basic to make the 16F877A work?
Thanks

XT vs. HS...
Look in the datasheets.

ozzie1st
- 18th April 2007, 18:48
My understanding is that to use 15 MHz crystal i need to include
DEFINE OSC 15
at the top of my pic basic pro codes
and that I needed to edit the 16F877A.INC file on my C: drive and replace XT_OSC with HS_OSC.
I have done this. Is there anything I am not doing? Thanks

skimask
- 18th April 2007, 18:59
My understanding is that to use 15 MHz crystal i need to include
DEFINE OSC 15
at the top of my pic basic pro codes
and that I needed to edit the 16F877A.INC file on my C: drive and replace XT_OSC with HS_OSC.
I have done this. Is there anything I am not doing? Thanks

XT vs. HS. Check the datasheets
You have to reconfigure your PIC to run the 15mhz oscillator.

And check your PBP manual for the correct use of:
DEFINE OSC 15

paul borgmeier
- 18th April 2007, 19:24
Skimask is hinting that you read section 7.1 of the manual (and pay particular attention to the table)

... and I think he wants 15MHz, not 15mHz .... 1,000,000,000X difference:)

skimask
- 18th April 2007, 19:25
Skimask is hinting that you read section 7.1 of the manual (and pay particular attention to the table)

... and I think he wants 15MHz, not 15mHz .... 1,000,000,000X difference:)

Good call. At least I didn't say 15uhz...or 15phz...or 15fhz :) and keep going...and going...and going...

Archangel
- 19th April 2007, 03:04
Skimask is hinting that you read section 7.1 of the manual (and pay particular attention to the table)

... and I think he wants 15MHz, not 15mHz .... 1,000,000,000X difference:)
Hi Paul,
_ D'oh I think I missed something here, mHz != MHz by a billion times, What the heck is mHz if not megahertz? Please forgive my American ignorance of this little part of the Metric system but they didn't teach that in school in those days. :)
Thanks
JS

skimask
- 19th April 2007, 04:09
Hi Paul,
_ D'oh I think I missed something here, mHz != MHz by a billion times, What the heck is mHz if not megahertz? Please forgive my American ignorance of this little part of the Metric system but they didn't teach that in school in those days. :)
Thanks
JS

Unwritten rules I think...Probably hinting that:
mhz = milli hertz
Mhz = mega hertz
kinda like
bps = bits per second, while
Bps = could be taken as BYTES per second

I would take it that way if I didn't have anything else to base it on...meaning if I didn't know we were talking about megahertz I might think we might've been talking about milli hertz...

paul borgmeier
- 19th April 2007, 04:44
Hi Joe,

I was being more of a smart @$$ than anything else - I knew exactly what was implied by mhz. However, the m versus M thing is what I was taught in school and is the accepted standard for abbreviations

http://en.wikipedia.org/wiki/Milli

I should have kept my 10^9 comment to myself and instead said "thanks skimask for helping so many people learn to fish instead of just giving them the fish!" You have been getting a lot of "thanks" from these fishermen (or should I say fisherpeople) as of late.

Ozzie, did you get your PIC to run at 15MHz?

skimask
- 19th April 2007, 04:50
I was being more of a smart @$$ than anything else - I knew exactly what was implied by mhz. However, the m versus M thing is what I was taught in school and is the accepted standard for abbreviations

I knew what ya meant and what you were getting at. Sometimes, it's obvious, sometimes not. I know I've been tripped up by the 'bps' vs 'BPS' thing more than once. And I spent the best 4 years of my life in 6th grade! :D

(grumpy ol' man)
Back in my day...we didn't have 'METERS' and 'GRAMS'...we had 'a long ways' and 'heavier than hell'...and (slams hand on table) 'WE LIKED IT THAT WAY'...

Archangel
- 19th April 2007, 07:25
I knew what ya meant and what you were getting at. Sometimes, it's obvious, sometimes not. I know I've been tripped up by the 'bps' vs 'BPS' thing more than once. And I spent the best 4 years of my life in 6th grade! :D

(grumpy ol' man)
Back in my day...we didn't have 'METERS' and 'GRAMS'...we had 'a long ways' and 'heavier than hell'...and (slams hand on table) 'WE LIKED IT THAT WAY'...
Back in my day they called it CPS and didn't worry about less than 1 whole cycle.

Melanie
- 19th April 2007, 08:14
Geeze... and you'll be sticking 15pF Condensers around your crystal next...

Acetronics2
- 19th April 2007, 08:47
XT vs. HS. Check the datasheets
You have to reconfigure your PIC to run the 15mhz oscillator.

And check your PBP manual for the correct use of:
DEFINE OSC 15


geeeee !!! What a wonderful forum is has become these days ...

after all these years, I didn't know there was a DEFINE OSC 15 ...

12 or 16 only available ... too bad !!! ( Manual p. 170 ... )

but ... PBPIC libs can be modified, of course !!! ... or time related functions re-calculated ... isn't it ???

Alain

PS: Sorry Ozzie, but it will be VERY difficult to run off-the-list frequencies with straight PBP ... try 16 Mhz !!! it will be so much simpler ...

May be some ones here could explain you how to modify the PbPlib files ... to run a True 15 Mhz Xtal !!!

I'd really love to read them too ... humour.

ozzie1st
- 19th April 2007, 10:19
Thankjs SKIMASK, thanks Paul. I got it working!! Muchos Gracias;-)

T.Jackson
- 19th April 2007, 10:49
Hi I am using a PIC 16F877A in my project. The Project works fine with a 4MHz crystal but when I replace the 4MHz crystal and its associated capacitors with a 15 MHz crystal and associated capacitors, The pic does not work
Does anyone know what needs to be done in PIC basic to make the 16F877A work?
Thanks

There is actually a variant of the 877a that is limited to 4MHz. 877a-20p will work up to 20MHz

ozzie1st
- 19th April 2007, 16:35
T.Jackson,
Yes not to mislead anyone; I typed 15 loosely here. It could have been 8, 16 20 etc; I simply couldnt get any crystal (8, 20, 16 etct) to work. OF course PBP will not compile with DEFINE OSC 15. But it did compile with the listed frequecies 16MHz, 24MHz etc. However at the time I entered this thread I did not know that PBP wil not work with 15
However Thanks to the forum I now know better and I am actually using a 24MHz crystal;-)

paul borgmeier
- 19th April 2007, 18:12
Hi Ozzie,

Now that everything is fine, it is not. This time you need to check the datasheet. You will see that 24MHz is beyond the specified limit of DC-20MHz. You are "overclocking" the PIC and performance is not implied.


Hi Alain, you quoted skimask's reply from post#4 and then wrote this


geeeee !!! What a wonderful forum is has become these days ...

after all these years, I didn't know there was a DEFINE OSC 15 ...

12 or 16 only available ... too bad !!! ( Manual p. 170 ... )

for clarification, skimask did not suggest using DEFINE OSC 15, the OP did (post#3). Skimask hinted that the OP might want to check the manual (post#4).

in otherwords, skimask asked him to fish (post#4), I baited the hook (post#5), and you gave him a fish (post#13).

EDIT: and I had a little fun with the m M thing along the way :) (Trent also noted the 20MHz top limit above)

T.Jackson
- 20th April 2007, 01:17
T.Jackson,
Yes not to mislead anyone; I typed 15 loosely here. It could have been 8, 16 20 etc; I simply couldnt get any crystal (8, 20, 16 etct) to work. OF course PBP will not compile with DEFINE OSC 15. But it did compile with the listed frequecies 16MHz, 24MHz etc. However at the time I entered this thread I did not know that PBP wil not work with 15
However Thanks to the forum I now know better and I am actually using a 24MHz crystal;-)

I'm unaware of any variant of the 877a that can be clocked as high as 24MHz.

skimask
- 20th April 2007, 02:55
I'm unaware of any variant of the 877a that can be clocked as high as 24MHz.

Maybe I'll send you my special one that was clocked at 32Mhz for awhile.
I don't know why it worked, but it did. Would it work under all conditions, using all modules, under all combinations of code? Probably not, but it worked for me.
(Yes, I know it's a one-off situation and they're only rated for 20Mhz)

Acetronics2
- 20th April 2007, 09:03
Hi, Skimask

ALL the pics I use are "overclocked" to their max. "µChip" freq. ... my old 16F84-04, 16F628-04, 16F876-04, 16F877-04 and else happily run @ 20 mhz.
32 Mhz is not really surprising nor, I often read about !!!

this fact is well known, also well known those chips have not being TESTED over the whole voltage, temp. and freq. range !!!

Just keep in mind those overclocked chips are not guaranteed by µChip ... that's the only point to care with when professionnal use !!!

May be we also might point out that , these days, "Non Rohs" devices are sold at a really fair price ...

Alain

Archangel
- 21st April 2007, 06:29
Geeze... and you'll be sticking 15pF Condensers around your crystal next...
Tsk, Tsk, Tsk Melanie, Condensers? I hope you learned that one from a history book :), oh . . . that would be 15 uuf condensers ;)

skimask
- 21st April 2007, 06:36
Hi, Skimask...ALL the pics I use are "overclocked" to their max. "µChip" freq. ... my old 16F84-04, 16F628-04, 16F876-04, 16F877-04 and else happily run @ 20 mhz. 32 Mhz is not really surprising nor, I often read about !!! this fact is well known, also well known those chips have not being TESTED over the whole voltage, temp. and freq. range !!! Just keep in mind those overclocked chips are not guaranteed by µChip ... that's the only point to care with when professionnal use !!! May be we also might point out that , these days, "Non Rohs" devices are sold at a really fair price ...
Alain

I've always wanted to apply 'standard' PC overclocking techniques to a PIC, just to see what it would do...


Tsk, Tsk, Tsk Melanie, Condensers? I hope you learned that one from a history book :), oh . . . that would be 15 uuf condensers ;)

Now I feel the need to 'tickle a diode' for entertainment...

Melanie
- 21st April 2007, 09:15
Tsk, Tsk, Tsk Melanie, Condensers? I hope you learned that one from a history book :), oh . . . that would be 15 uuf condensers ;)

Well actually, I was looking on the net for some surface mount Leyden Jars, but I don't think Pieter van Musschenbroek came out with an SMD version...

T.Jackson
- 21st April 2007, 12:42
Maybe I'll send you my special one that was clocked at 32Mhz for awhile.
I don't know why it worked, but it did. Would it work under all conditions, using all modules, under all combinations of code? Probably not, but it worked for me.
(Yes, I know it's a one-off situation and they're only rated for 20Mhz)

Nah I'll be right. Not in the habit of challenging large teams of professional engineers. The data sheet says 20 - that's as far as I go.

Archangel
- 22nd April 2007, 07:41
Well actually, I was looking on the net for some surface mount Leyden Jars, but I don't think Pieter van Musschenbroek came out with an SMD version...

He He He, Leydan jars! I almost went there too. Just keep tapping on that coherner and those radio waves will get detected, and I'll adjust the spark gap . . . Hey can you spare an extra cat whisker?

Acetronics2
- 6th June 2007, 10:13
Well actually, I was looking on the net for some surface mount Leyden Jars, but I don't think Pieter van Musschenbroek came out with an SMD version...

Hi, Mel

a nice "through hole" version ... like the one I played with, when child ...

http://villa-vacances.chez.tiscali.fr.chez-alice.fr/sections/bricolage/dossiers/exp%20electrostat/dossiers/generateur%20de%20wimshurst/index.htm

Regards

Alain

mister_e
- 6th June 2007, 15:45
mmm, it looks more surface mount to me :eek: :D

coyotegd
- 24th July 2007, 04:48
No need to edit your INC file. Just add a line of assembler to your program:

@ DEVICE HS_OSC

Then add a line of PIC Basic:

DEFINE OSC 20

I don't believe Pic Basic Pro can use 15MHz properly. See page 170 of Compiler manual: "The acceptable oscillator definitions are: . . . 12, 16, 20 . . ." If you use "DEFINE OSC 15", I believe PIC Basic will default to 4MHz, but then you have changed "DEVICE XT_OSC" to "DEVICE HS_OSC", so it may not work at all.

ChrisHelvey
- 25th July 2007, 21:14
Hey, what's wrong with "condensers," I always thought it made sense...just cram (condense) those little electrons in there until no more will fit. ;-)

As for "resonators," the more I learn about "resonance," the more methinks the numbers have a "little" something to do with harmonics. I'll stick with what the design specs state.

Got a few laughs from this thread.


Chris Helvey

Acetronics2
- 26th July 2007, 10:03
Hi, Chris

a Condenser is something generally used to change physical phase ( from gas state to liquid state ... see how to make bad Whisky or alcohol ... i.e ... or how your climate works).

Alain

ChrisHelvey
- 26th July 2007, 23:01
I was being tongue and cheek, of course. But really, there is a part on my air conditioner full of Freon that must be 10,000uF! It runs hot though...