First time with external oscillator - 16F877a Not working


Closed Thread
Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Using MPLAB, GOOD!

    First:
    Turn off the setting of the fuses in your programmer software and do it in code or the *.inc file.

    Second:
    To make this all digital use
    Code:
    ADCON1=7
    CMCON=7
    Third:
    Try this code before you write something "looooong", just to make sure everything is working.
    Code:
    '****************************************************************
    '16F877A       HEART_BEAT
        DEFINE OSC 4
    '####################
        @ __config _XT_OSC & _WDT_OFF & _LVP_OFF & _CP_OFF &_BODEN_OFF
        ADCON1=7
        CMCON=7
        
    START:
        HIGH PORTD.2
        PAUSE 100
        LOW PORTD.2
        PAUSE 100
        GOTO START
    Dave
    Always wear safety glasses while programming.

  2. #2


    Did you find this post helpful? Yes | No

    Exclamation

    Quote Originally Posted by mackrackit View Post
    Using MPLAB, GOOD!

    First:
    Turn off the setting of the fuses in your programmer software and do it in code or the *.inc file.

    Second:
    To make this all digital use
    Code:
    ADCON1=7
    CMCON=7
    Third:
    Try this code before you write something "looooong", just to make sure everything is working.
    Code:
    '****************************************************************
    '16F877A       HEART_BEAT
        DEFINE OSC 4
    '####################
        @ __config _XT_OSC & _WDT_OFF & _LVP_OFF & _CP_OFF &_BODEN_OFF
        ADCON1=7
        CMCON=7
        
    START:
        HIGH PORTD.2
        PAUSE 100
        LOW PORTD.2
        PAUSE 100
        GOTO START
    Hi, thanks for replying. My Loooong code is working fine (Code is good) on 16F690. I want to transffer the code to 16F877 but since it uses external oscillator and I have never used one before, I only have intentions to blink an LED first.
    I have tried your advise above but its not working still. Timing of blinking is not right (when it is blinking), it blinks sometimes when I touch the capacitor leg, touch the bench where the circuit is left on, sometimes its just sitting bright on. I feel the problem is with hardware configuration.
    I am building the circuit on a breadboard with 4MHz ceramic oscillator and two 22pF ceramic capacitors. But just don't know what is wrong and it is taking me towards insanity....
    ___________________
    WHY things get boring when they work just fine?

  3. #3
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Tell about the MCLR pin connection.
    Is it pulled high?
    Dave
    Always wear safety glasses while programming.

  4. #4
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Talking

    10 Bucks on Mackrackit ...

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  5. #5


    Did you find this post helpful? Yes | No

    Wink

    Did I mentioned that some people here really know there stuff?
    Thank you very much, this problem was due to MCLR!

    But

    I'LL BE BACK (with more problems ofcourse)

    ___________________
    WHY things get boring when they work just fine?

Similar Threads

  1. I don't understand this code!
    By Russ Kincaid in forum mel PIC BASIC Pro
    Replies: 46
    Last Post: - 13th February 2008, 02:55
  2. Working with indivividual bytes of an array
    By J_norrie in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 22nd January 2007, 19:16
  3. Serout2/serin2 Pbp Problem
    By SOMRU in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 11th December 2006, 19:55
  4. help with 16f628a
    By thalia in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 3rd May 2006, 08:16
  5. Timer in real time
    By martarse in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 29th July 2005, 14:24

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