How to check oscillator frequency


Closed Thread
Results 1 to 15 of 15

Hybrid View

  1. #1
    Join Date
    Jun 2007
    Posts
    56


    Did you find this post helpful? Yes | No

    Default

    Thanks Steve,
    It was my mistake , I looked at C:PBP\INC folder instead of C:PBP, that's why I never found the 18F4431.INC file.

    Now, it it configured as your suggestion, and it works ( The Configuration bits on Picflash changed as well , save me some clicks, thanks )

    One more thing, I 'd like to know more about HS PLL mode ( Datasheet 2.3 ). Suppose I want to use external 8 Mhz crystal to produce 32 Mhz clock, what settings are required ?



    Johan
    Last edited by Johan; - 14th July 2007 at 15:01.

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by P18F4431.INC, MPASM Suite
    ;----- CONFIG1H Options --------------------------------------------------
    _OSC_LP_1H EQU H'F0' ; LP
    _OSC_XT_1H EQU H'F1' ; XT
    _OSC_HS_1H EQU H'F2' ; HS
    _OSC_RC2_1H EQU H'F3' ; External RC, RA6 is CLKOUT
    _OSC_EC_1H EQU H'F4' ; EC, RA6 is CLKOUT
    _OSC_ECIO_1H EQU H'F5' ; EC, RA6 is I/O
    _OSC_HSPLL_1H EQU H'F6' ; HS-PLL Enabled
    _OSC_RCIO_1H EQU H'F7' ; External RC, RA6 is I/O
    _OSC_IRCIO_1H EQU H'F8' ; Internal RC, RA6 & RA7 are I/O
    _OSC_IRC_1H EQU H'F9' ; Internal RC, RA6 is CLKOUT, RA7 is I/O
    _OSC_RC1_1H EQU H'FB' ; External RC, RA6 is CLKOUT
    _OSC_RC_1H EQU H'FF' ; External RC, RA6 is CLKOUT

    _FCMEN_OFF_1H EQU H'BF' ; Disabled
    _FCMEN_ON_1H EQU H'FF' ; Enabled

    _IESO_OFF_1H EQU H'7F' ; Disabled
    _IESO_ON_1H EQU H'FF' ; Enabled

    i bet on...
    Code:
            '
            '       Pic Configuration
            '       =================
            ASM         
            __CONFIG _CONFIG1H, _OSC_HSPLL_1H  & _FCMEN_OFF_1H & _IESO_OFF_1H
            __CONFIG _CONFIG2L, _PWRTEN_ON_2L & _BOREN_ON_2L & _BORV_45_2L
            __CONFIG _CONFIG2H, _WDTEN_OFF_2H & _WINEN_OFF_2H 
            __CONFIG _CONFIG3L, _T1OSCMX_OFF_3L & _HPOL_LOW_3L & _LPOL_HIGH_3L & _PWMPIN_OFF_3L
            __CONFIG _CONFIG3H, _MCLRE_ON_3H
            __CONFIG _CONFIG4L, _LVP_OFF_4L & _DEBUG_OFF_4L
            ENDASM
            DEFINE OSC 32
    Steve

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

Similar Threads

  1. TMR1 external LP xtal setup check
    By comwarrior in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 13th October 2009, 18:11
  2. HARDWARE I2C SAMPLE CODE question
    By Michael Wakileh in forum Code Examples
    Replies: 2
    Last Post: - 16th June 2009, 21:07
  3. PIC16F877A - Timer0 won't interrupt
    By WishMaster^ in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 25th April 2007, 08:25
  4. Code check -- button not working
    By docwisdom in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 2nd March 2006, 22:43
  5. Even Parity Check, How?
    By Mark Scotford in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 24th January 2005, 09:21

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