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

    Default External clock on 16f819 problem.

    OK, I've read the datasheet but I'm still confused.

    I have someone elses pre-made project that I'm altering. It already runs from asm with a 16F818 but I wanted to add big characters for the LCD.

    The project uses non standard pins for the LCD so I'm using LCD_AnyPin.pbp and it uses an external 10Mhz oscillator as clock in.


    I have a small test board running the code I want successfully using the odd pins, but a standard crystal 10Mhz oscillator as DEFINE OSC 10.

    I read the datasheet as EICON for the external oscillator option but I have no idea how to set it ?

    I tried DEFINE EXT_OSC 10 and selecting EXTCLOCK on the programmer but although I get two lines showing (Contrast up) there is no data.

    I also tried 'clkin VAR portA.7' with no success.

    Anyone point me in the right direction?

    As I say the code works with Xtal osc but not external clock so seems no point posting the code.

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


    Did you find this post helpful? Yes | No

    Default Re: External clock on 16f819 problem.

    If it already runs in assembler, why assume posting your new basic code is pointless?

    Port A is analog in many (if not all) PICs, you have to set it to digital to use it with the LCD.

    It's difficult to make suggestions if we can't see your code, a schematic of your project wouldn't hurt either.

    Robert

    Note: This thread is just 4 below yours right now:
    http://www.picbasic.co.uk/forum/showthread.php?t=16016
    Last edited by Demon; - 21st January 2012 at 23:11. Reason: Added link to analog/digital setting

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

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


    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.

  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.

    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

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


    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: 2706
Size:  22.3 KB

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

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