PIC18F458 oscillator modes


Closed Thread
Results 1 to 5 of 5
  1. #1
    josegamez's Avatar
    josegamez Guest

    Unhappy PIC18F458 oscillator modes

    Hello.
    I have a question about the programming of the PIC18F458. It involves the oscillator configuration of it,I read the datasheet and it's a bunch of gibberish to me mostly because its's the first time I've used a PIC and didn't have the possibility nor the time to choose a simpler PIC. Also since I'm using PICBasic Pro I don't know how it applies to this language. Basically my question is: how do I "tell" the PIC in which oscillator configuration it should work on? We want to develop our project first with a 4 Mhz crystal and then change to a 36 Mhz crystal (HS mode) so we need to make that change of configuration. I asked the people at Microchip but all they told me was to choose the configuration I needed in one of the MPLAB menus and I'm not even using the MPLAB IDE or even assembler for that matter. So any help would be welcome including source code sample if possible. Thanks to anyone who decides to help, and please excuse my ignorance in the subject. God bless.

  2. #2
    niels's Avatar
    niels Guest


    Did you find this post helpful? Yes | No

    Default

    Hi,

    You set the PIC oscillator configuration when you program the chip. If you're using anything other than 4Mhz, make sure you 'DEFINE OSC' to whatever frequency you are using otherwise your delay routines (and some other fuctions) will not work as expected.

    I can't give you anything more specific because I don't know what software you are you using to program your PIC.

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


    Did you find this post helpful? Yes | No

    Default

    have a look there
    http://www.picbasic.co.uk/forum/showthread.php?t=543

    you can't change toa 36MHZ crystal... it will be over the PIC spec (as far as i remind) BUT you'll be able to run your PIC @36MHZ by using the internal PLL (wich multiply your crystal frequency by 4)

    In your case 36/4=9MHZ... if it exist

    BUT PBP don't allow 36MHZ... well yes but not directly. You'll have to play with the timing. Why not running it @40MHZ? PBP support this frewuency and you'll need a 10MHZ crystal.

    HTH
    Steve

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

  4. #4
    josegamez's Avatar
    josegamez Guest


    Did you find this post helpful? Yes | No

    Smile Thanks

    Thanks a lot guys. About the PIC supporting 36 Mhz I don't think there's any trouble, the datasheet states that it runs from DC to 40 Mhz, although it is true that PBP supports 33 Mhz and not 36 but I don't think it makes much difference for my aplication if PBP thinks it's 33 and the timings because of that turn to be a little bit off. The reason I didn't use a 40 xtal was that I could NOT get one anywhere so I bought the closest I could find. But thanks about the internal PLL tip, that was great, I hadn't even seen that, I think I will use that to get to an actual 40 MHz thanks. Again thank you guys, you were all very helpful. God bless

  5. #5
    Join Date
    Oct 2004
    Location
    Hangover, Germany
    Posts
    289


    Did you find this post helpful? Yes | No

    Red face

    I think, the quickest crystal you can get is between 20 and 25MHz. All crystal at higher "speeds" need to be driven on the 3rd harmonic frequency... PICs doesn't do that. Use the PLL-option instead !!
    PBP 2.50C, MCS+ 3.0.0.5, MPLAB 8, MPASM 5.14, ASIX Presto, PoScope, mE mikroBasic V7.2, PICKIT2

Similar Threads

  1. Problem with PIC18F458 ADC code
    By minmin in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 1st June 2011, 08:13
  2. Digital inputs are some pin NOT working (PIC18F458)
    By san6302 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 4th July 2008, 06:50
  3. Can anyone help me to use Writecode for pic18f458 ?
    By dip1 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 28th June 2006, 22:29
  4. PIC18F458 Shiftin / Out
    By pberhin in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 29th May 2006, 20:36
  5. PIC18F458 and LCD
    By Uffe in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 5th September 2005, 20:16

Members who have read this thread : 0

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