16F877 Flickering LED


Closed Thread
Results 1 to 17 of 17

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Unhappy code

    Here is my code:




    Include "Modedefs.bas"

    DEFINE OSC 20 ' Set the Xtal frequency to 20mHz
    RFVDDPin VaR PORTA.3 ' RF Module Power Pin.

    Main:
    ADCON1 = 7 ' Set Analog pins to Digital.
    TRISA = 0 ' Set all PortA Pins as output
    high RFVDDPin ' Switch RF Module On.
    end

  2. #2


    Did you find this post helpful? Yes | No

    Red face Circuit looks weird

    What is looking weird about my circuit?

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


    Did you find this post helpful? Yes | No

    Default

    by using end this make your pic to stop or goto lalaland IMHO.

    what about
    Code:
    DEFINE OSC 20 ' Set the Xtal frequency to 20mHz
    
    ADCON1 = 7 ' Set Analog pins to Digital.
    TRISA = 0 ' Set all PortA Pins as output
    RFVDDPin VaR PORTA.3 ' RF Module Power Pin.
    
    
    Main:
        high RFVDDPin ' Switch RF Module On.
    here:
         goto here
    also be sure you set the oscillator configuration fuse to HS.
    Steve

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

  4. #4


    Did you find this post helpful? Yes | No

    Red face oscillator configuration

    "also be sure you set the oscillator configuration fuse to HS."

    How do I do this?

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


    Did you find this post helpful? Yes | No

    Default

    in your PIC programmer software or into your code
    click here to know set fuse into your code

    be sure you have a PIC who can handle the 20Mhz clock. PIC16F877-20
    Steve

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

  6. #6


    Did you find this post helpful? Yes | No

    Red face Osc

    Is _XT_OSC for a Crystal, because that is what I am using and that is what the Inc file's default is?

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


    Did you find this post helpful? Yes | No

    Default

    XT_OSC is used for 4MHZ crystal/oscillator speed. HS_OSC is used for crystal/oscillator over 4MHZ. The default setting is XT_OSC. There's no difference for a PIC to see ceramic resonator or crystal... since it generate pulses.

    So in your case you'll have to change it to HS, in the .INC file or as i suggest, comment the config lines in your .INC file and place all fuses setting in your code. Really handy.
    Steve

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

  8. #8


    Did you find this post helpful? Yes | No

    Red face Still Nothing

    Hi Steve

    I have done the following:
    Edit C:\pbp\16F877.INC, Replace _XT_OSC to _HS_OSC

    And edit my code as followings:


    Include "Modedefs.bas"

    DEFINE OSC 20 ' Set the Xtal frequency to 20mHz
    RFVDDPin VaR PORTA.3 ' RF Module Power Pin.

    Main:
    ADCON1 = 7 ' Set Analog pins to Digital.
    TRISA = 0 ' Set all PortA Pins as output
    high RFVDDPin ' Switch RF Module On.
    here:
    goto here
    end



    But with no luck, it is still flickering?

Similar Threads

  1. Conway's Game Of Life
    By wellyboot in forum mel PIC BASIC Pro
    Replies: 45
    Last Post: - 28th May 2020, 07:14
  2. Replies: 3
    Last Post: - 5th December 2008, 16:00
  3. new and need help
    By smeghead in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 3rd November 2008, 21:19
  4. LCD will not start
    By btaylor in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 24th May 2007, 03:30
  5. can't even flash an LED
    By bruno333 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 28th April 2005, 14:27

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