Pls How can I make 16F877A use 15MHz Xtal


Closed Thread
Results 1 to 31 of 31
  1. #1
    Join Date
    Apr 2007
    Posts
    4

    Unhappy Pls How can I make 16F877A use 15MHz Xtal

    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

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by ozzie1st View Post
    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.

  3. #3
    Join Date
    Apr 2007
    Posts
    4


    Did you find this post helpful? Yes | No

    Unhappy XT vs HS

    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

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by ozzie1st View Post
    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

  5. #5
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Smile

    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
    Paul Borgmeier
    Salt Lake City, UT
    USA
    __________________

  6. #6
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by paul borgmeier View Post
    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...

  7. #7
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default ? ? ? ? ? !

    Quote Originally Posted by paul borgmeier View Post
    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
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  8. #8
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Joe S. View Post
    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...

  9. #9
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Smile

    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?
    Paul Borgmeier
    Salt Lake City, UT
    USA
    __________________

  10. #10
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by paul borgmeier View Post
    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!

    (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'...

  11. #11
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by skimask View Post
    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!

    (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.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  12. #12
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Geeze... and you'll be sticking 15pF Condensers around your crystal next...

  13. #13
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,614


    Did you find this post helpful? Yes | No

    Talking RTFM ... ha,ha,ha ... I REALLY LOVE !!!

    Quote Originally Posted by skimask View Post
    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.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  14. #14
    Join Date
    Apr 2007
    Posts
    4


    Did you find this post helpful? Yes | No

    Smile

    Thankjs SKIMASK, thanks Paul. I got it working!! Muchos Gracias;-)

  15. #15
    T.Jackson's Avatar
    T.Jackson Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by ozzie1st View Post
    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
    Last edited by T.Jackson; - 19th April 2007 at 11:12.

  16. #16
    Join Date
    Apr 2007
    Posts
    4


    Did you find this post helpful? Yes | No

    Thumbs up Yes PBP will not compile with DEFINE OSC 15

    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;-)

  17. #17
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Smile

    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)
    Last edited by paul borgmeier; - 19th April 2007 at 21:27. Reason: see EDIT:
    Paul Borgmeier
    Salt Lake City, UT
    USA
    __________________

  18. #18
    T.Jackson's Avatar
    T.Jackson Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by ozzie1st View Post
    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.
    Last edited by T.Jackson; - 20th April 2007 at 01:22.

  19. #19
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by T.Jackson View Post
    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)

  20. #20
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,614


    Did you find this post helpful? Yes | No

    Talking rocket pics ...

    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
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  21. #21
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Talking Now we are talking old school . . .

    Quote Originally Posted by Melanie View Post
    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
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  22. #22
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Acetronics View Post
    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...

    Quote Originally Posted by Joe S. View Post
    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...

  23. #23
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Joe S. View Post
    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...

  24. #24
    T.Jackson's Avatar
    T.Jackson Guest


    Did you find this post helpful? Yes | No

    Post

    Quote Originally Posted by skimask View Post
    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.

  25. #25
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Beaten to the punch

    Quote Originally Posted by Melanie View Post
    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?
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  26. #26
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,614


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Melanie View Post
    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.f...urst/index.htm

    Regards

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  27. #27
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    mmm, it looks more surface mount to me
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  28. #28
    Join Date
    Oct 2005
    Location
    Las Vegas, Nevada, USA
    Posts
    27


    Did you find this post helpful? Yes | No

    Default 15MHz on 16F877A

    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.

  29. #29
    Join Date
    Jul 2006
    Posts
    36


    Did you find this post helpful? Yes | No

    Default

    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

  30. #30
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,614


    Did you find this post helpful? Yes | No

    Talking

    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
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  31. #31
    Join Date
    Jul 2006
    Posts
    36


    Did you find this post helpful? Yes | No

    Wink

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

Similar Threads

  1. 16F877A with 20MHz XTAL not working?
    By ustredna in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 19th August 2011, 15:04
  2. Change On Interrupt, PIC16F884
    By elec_mech in forum mel PIC BASIC Pro
    Replies: 17
    Last Post: - 14th November 2008, 17:25
  3. Clock connection to DS1802 from 16F877A
    By coyotegd in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 3rd January 2006, 18:52

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts