16F877A with 20MHz XTAL not working?


Closed Thread
Results 1 to 13 of 13

Hybrid View

  1. #1
    Join Date
    Mar 2006
    Location
    INDIA
    Posts
    89


    Did you find this post helpful? Yes | No

    Default

    you will have to edit your 16F877A.inc file as below.

    NOLIST
    ifdef PM_USED
    LIST
    include 'M16F87xA.INC' ; PM header
    device pic16F877A, HS_osc, wdt_OFF, lvp_off, protect_ON , CP_ON
    XALL
    NOLIST
    else
    LIST
    LIST p = 16F877A, r = dec, w = -302
    INCLUDE "P16F877A.INC" ; MPASM Header
    __config _HS_OSC & _WDT_OFF & _LVP_OFF & _CP_OFF
    NOLIST
    endif
    LIST

    Your 16F877A will work on 20Mhz.

  2. #2
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default My Opinion

    Quote Originally Posted by precision View Post
    you will have to edit your 16F877A.inc file as below.

    NOLIST
    ifdef PM_USED
    LIST
    include 'M16F87xA.INC' ; PM header
    device pic16F877A, HS_osc, wdt_OFF, lvp_off, protect_ON , CP_ON
    XALL
    NOLIST
    else
    LIST
    LIST p = 16F877A, r = dec, w = -302
    INCLUDE "P16F877A.INC" ; MPASM Header
    __config _HS_OSC & _WDT_OFF & _LVP_OFF & _CP_OFF
    NOLIST
    endif
    LIST

    Your 16F877A will work on 20Mhz.
    Hi ustredna,
    The file mentioned above is included into your code automaticly when you compile using PBP and it contains "Default Settings" for your config statements, so if you do not include config statements in YOUR CODE it will default to the settings in this file. If you change the settings here it will DEFAULT to whatever you set here. Now for my opinion: I would not change the default to 20 mhz, I would instead simply put a semicolon at the beginning of the config statements so as to make the compiler overlook them as comments, and then include my own config statements in "MY CODE" every time.
    JS
    edit: Oh BTW, each PIC type has it's own file like this.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  3. #3


    Did you find this post helpful? Yes | No

    Default My experience on this

    Hi,

    Ive the same problem, i thange the crystal, caps, code... and nothing (at 1st time when y bought it works on 20mhz).Then today i went to the store ans bougt one pic more, caps, clocks. The problem was on the the 1st pic!!! i was not very good only acepts 4mhz clocks.


  4. #4
    Join Date
    Feb 2011
    Location
    Kuantan, Pahang, Malaysia
    Posts
    4


    Did you find this post helpful? Yes | No

    Default Re: 16F877A with 20MHz XTAL not working?

    Quote Originally Posted by precision View Post
    you will have to edit your 16F877A.inc file as below.

    NOLIST
    ifdef PM_USED
    LIST
    include 'M16F87xA.INC' ; PM header
    device pic16F877A, HS_osc, wdt_OFF, lvp_off, protect_ON , CP_ON
    XALL
    NOLIST
    else
    LIST
    LIST p = 16F877A, r = dec, w = -302
    INCLUDE "P16F877A.INC" ; MPASM Header
    __config _HS_OSC & _WDT_OFF & _LVP_OFF & _CP_OFF
    NOLIST
    endif
    LIST

    Your 16F877A will work on 20Mhz.
    thx, this one works.

Similar Threads

  1. First time with external oscillator - 16F877a Not working
    By financecatalyst in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 15th October 2009, 17:14
  2. 16F877a, stopped working
    By comwarrior in forum General
    Replies: 2
    Last Post: - 18th September 2009, 06:39
  3. 16F877 vs. 16F877A
    By DavyJones in forum General
    Replies: 12
    Last Post: - 11th April 2009, 18:22
  4. Pls How can I make 16F877A use 15MHz Xtal
    By ozzie1st in forum mel PIC BASIC Pro
    Replies: 30
    Last Post: - 26th July 2007, 23:01
  5. Clock connection to DS1802 from 16F877A
    By coyotegd in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 3rd January 2006, 18:52

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