PLL oscillator 18f452


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2008
    Location
    Varese , Italy
    Posts
    326

    Default PLL oscillator 18f452

    Good day to all of you in this forum.
    I am using the pic 18f452 with a 4.0 Mhz xtal and I want to use the HS PLL to have a 40 Mhz system clock.
    With the program listed below I should have a square wave output at 2 msec period.
    I have 5 msec period intead.
    I am not understanding where the problem lies.
    Any help is appreciated.
    Thanks
    Ambrogio

    ';Program Configuration Register 1H
    @ __CONFIG _CONFIG1H, _OSCS_OFF_1H & _HSPLL_OSC_1H

    ';Program Configuration Register 2L
    @ __CONFIG _CONFIG2L, _BOR_OFF_2L & _BORV_20_2L & _PWRT_ON_2L

    ';Program Configuration Register 2H
    @ __CONFIG _CONFIG2H, _WDT_OFF_2H & _WDTPS_128_2H

    ';Program Configuration Register 3H
    @ __CONFIG _CONFIG3H, _CCP2MX_OFF_3H

    ';Program Configuration Register 4L
    @ __CONFIG _CONFIG4L, _STVR_OFF_4L & _LVP_OFF_4L & _DEBUG_OFF_4L

    ';Program Configuration Register 5L
    @ __CONFIG _CONFIG5L, _CP0_OFF_5L & _CP1_OFF_5L & _CP2_OFF_5L & _CP3_OFF_5L

    ';Program Configuration Register 5H
    @ __CONFIG _CONFIG5H, _CPB_OFF_5H & _CPD_OFF_5H

    ';Program Configuration Register 6L
    @ __CONFIG _CONFIG6L, _WRT0_OFF_6L & _WRT1_OFF_6L & _WRT2_OFF_6L & _WRT3_OFF_6L

    ';Program Configuration Register 6H
    @ __CONFIG _CONFIG6H, _WRTC_OFF_6H & _WRTB_OFF_6H & _WRTD_OFF_6H

    ';Program Configuration Register 7L
    @ __CONFIG _CONFIG7L, _EBTR0_OFF_7L & _EBTR1_OFF_7L & _EBTR2_OFF_7L & _EBTR3_OFF_7L

    ';Program Configuration Register 7H
    @ __CONFIG _CONFIG7H, _EBTRB_OFF_7H

    ' ************************************************** **************************************


    DEFINE OSC 40
    INCLUDE "MODEDEFS.BAS"

    pippo:

    high portd.1
    pause 1
    low portd.1
    pause 1

    goto pippo

  2. #2
    Join Date
    May 2007
    Posts
    604


    Did you find this post helpful? Yes | No

    Default Re: PLL oscillator 18f452

    You are not going to get 40MHz with a 4MHz crystal. PLL gives x4 of the input frequency which is 16MHz in your case. See the device datasheet.
    Why pay for overpriced toys when you can have
    professional grade tools for FREE!!!

  3. #3
    Join Date
    Jun 2008
    Location
    Varese , Italy
    Posts
    326


    Did you find this post helpful? Yes | No

    Default Re: PLL oscillator 18f452

    thanks Rmteo,
    It is my fault .
    I have to use 10 Mhz xtal to get 40 Mhz !

    Is this Cortex programmable in Pbasic too ?
    Thanks
    Ambrogio

  4. #4
    Join Date
    May 2007
    Posts
    604


    Did you find this post helpful? Yes | No

    Default Re: PLL oscillator 18f452

    Sorry, no.
    Why pay for overpriced toys when you can have
    professional grade tools for FREE!!!

Similar Threads

  1. Replies: 6
    Last Post: - 7th May 2011, 15:44
  2. 18F4431 - internal oscillator and PLL ?
    By AndrewC in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 22nd March 2009, 14:20
  3. PLL with EXT oscillator
    By Ron Marcus in forum General
    Replies: 1
    Last Post: - 18th August 2008, 02:08
  4. Using PIC16F88 oscillator as oscillator for other ICs
    By Torael_7 in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 30th March 2008, 12:58
  5. Hs Pll
    By Ron Marcus in forum Off Topic
    Replies: 2
    Last Post: - 21st February 2006, 00:34

Members who have read this thread : 2

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