External clock on 16f819 problem.


Closed Thread
Results 1 to 16 of 16

Hybrid View

  1. #1
    Join Date
    Dec 2011
    Location
    IO93ok
    Posts
    190


    Did you find this post helpful? Yes | No

    Default Re: External clock on 16f819 problem.

    Hmm, my post isn't very clear.

    I have the software working on a development board. This board uses a 10Mhz Xtal osc as standard.

    The board I want to use it on uses an external 10Mhz oscillator source on one pin only OSC1.

    I believe I need to set OSCCON=8 to select mode 8 in the oscillator settings. It appears my programmer is defaulting to the 'inc' values.

  2. #2
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,159


    Did you find this post helpful? Yes | No

    Default Re: External clock on 16f819 problem.

    Quote Originally Posted by tasmod View Post
    ...The board I want to use it on uses an external 10Mhz oscillator source on one pin only OSC1.
    ...
    Can you give more information about that board?

    I've never seen a circuit using only one pin for the oscillator (it doesn't mean it doesn't exist).

    Robert

    EDIT: Interesting, Pierce and Colpitts oscillators have only one output:
    http://ww1.microchip.com/downloads/e...tes/00826a.pdf


    Quote Originally Posted by tasmod View Post
    ...The board I want to use it on uses an external 10Mhz oscillator source on one pin only OSC1....
    After glancing through that application note, I'd start by checking just how accurate the oscillator is working.
    Last edited by Demon; - 22nd January 2012 at 14:46.

  3. #3
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: External clock on 16f819 problem.

    Robert, Havent you ever ran a PIC from an external oscillator before? You only need 1 pin for the input. That frees up another pin for some external use by the designer.
    Dave Purola,
    N8NTA
    EN82fn

  4. #4
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,159


    Did you find this post helpful? Yes | No

    Default Re: External clock on 16f819 problem.

    Quote Originally Posted by Dave View Post
    Robert, Havent you ever ran a PIC from an external oscillator before? ...
    Always.


    Quote Originally Posted by Dave View Post
    ...You only need 1 pin for the input. ...
    Not wired like this:

    Name:  PIC schematic.JPG
Views: 2730
Size:  22.3 KB

    Robert
    Last edited by Demon; - 22nd January 2012 at 20:13.

  5. #5
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: External clock on 16f819 problem.

    No Robert, Like this:
    Name:  Ext Osc.JPG
Views: 1092
Size:  42.9 KB
    Dave Purola,
    N8NTA
    EN82fn

  6. #6
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,159


    Did you find this post helpful? Yes | No

    Default Re: External clock on 16f819 problem.

    Wouldn't that need a CONFIG fuse?

    Dave, do you have an example from one of your programs?

    Robert

    EDIT: These are the available fuses for a 16F819:

    Code:
    _CP_ALL                      EQU     H'1FFF'
    _CP_OFF	                     EQU     H'3FFF'
    _CCP1_RB2		     EQU     H'3FFF'
    _CCP1_RB3                    EQU     H'2FFF'
    _DEBUG_OFF                   EQU     H'3FFF'
    _DEBUG_ON                    EQU     H'37FF'
    _WRT_ENABLE_OFF              EQU     H'3FFF'
    _WRT_ENABLE_512              EQU     H'3DFF'
    _WRT_ENABLE_1024             EQU     H'3BFF'
    _WRT_ENABLE_1536             EQU     H'39FF'
    _CPD_ON                      EQU     H'3EFF'
    _CPD_OFF                     EQU     H'3FFF'
    _LVP_ON                      EQU     H'3FFF'
    _LVP_OFF                     EQU     H'3F7F'
    _BODEN_ON                    EQU     H'3FFF'
    _BODEN_OFF                   EQU     H'3FBF'
    _MCLR_ON		     EQU     H'3FFF'
    _MCLR_OFF                    EQU     H'3FDF'
    _PWRTE_OFF                   EQU     H'3FFF'
    _PWRTE_ON                    EQU     H'3FF7'
    _WDT_ON                      EQU     H'3FFF'
    _WDT_OFF                     EQU     H'3FFB'
    _EXTRC_CLKOUT		     EQU     H'3FFF'
    _EXTRC_IO		     EQU     H'3FFE'
    _INTRC_CLKOUT                EQU     H'3FFD'
    _INTRC_IO		     EQU     H'3FFC'
    _EXTCLK			     EQU     H'3FEF'
    _HS_OSC                      EQU     H'3FEE'
    _XT_OSC                      EQU     H'3FED'
    _LP_OSC                      EQU     H'3FEC'

    And these are the default settings (PM and MPASM):

    Code:
            device  pic16F819, hs_osc, wdt_on, pwrt_on, lvp_off, protect_off
            ...    else
            ...        __config _HS_OSC & _WDT_ON & _PWRTE_ON & _LVP_OFF & _CP_OFF
    Last edited by Demon; - 22nd January 2012 at 23:04. Reason: Used sample from proper PIC

  7. #7
    Join Date
    Dec 2011
    Location
    IO93ok
    Posts
    190


    Did you find this post helpful? Yes | No

    Default Re: External clock on 16f819 problem.

    To all intents and purposes a clock and oscillator are one and the same.

    The answer lies at the end of the fuses list 4th from bottom _EXTCLK needs setting as my programmer defaults to standard inc setting.

    This is what I need :

    _LVP_OFF & _CP_OFF & _BODEN_ON & _MCLR_OFF & _PWRTE_ON & _WDT_OFF & _EXTCLK & _DEBUG_OFF & _WRT_ENABLE_OFF & _CPD_OFF & _CCP1_RB3
    Last edited by tasmod; - 23rd January 2012 at 10:22.

  8. #8
    Join Date
    Jan 2009
    Location
    Miami, Florida USA
    Posts
    699


    Did you find this post helpful? Yes | No

    Default Re: External clock on 16f819 problem.

    Quote Originally Posted by Dave View Post
    Robert, Havent you ever ran a PIC from an external oscillator before? You only need 1 pin for the input.
    What you posted is an external clock input, like the title says. That's not really an external oscillator.
    "No one is completely worthless. They can always serve as a bad example."

    Anonymous

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