16F877A don't start :(


Closed Thread
Results 1 to 10 of 10
  1. #1
    Join Date
    Nov 2008
    Location
    Epernon, France
    Posts
    15

    Unhappy 16F877A don't start :(

    Hello,

    I want to blink a led on a 16F877A but nothing run :/
    This is my code:

    Code:
    'Initialisation des fusibles:
    @ DEVICE pic16f877A, HS_OSC, WDT_OFF, LVP_OFF, PROTECT_OFF
    define OSC 20
    
    output portc.2
    Main:
              high portc.2
              pause 1000
              low portc.2                 
              pause 1000
         goto main
    end
    Nothing really fantastic :/

    I've tested with OSC 4 & OSC 8. HS,RC,XT...
    On the PIC i can read "16F877A-I/P" not "16F877A-I/P20"



    Can you show me a working code to blink a LED on this PIC ?


    I'v a 10K pullpup resistor for MCLR connected to +5v, 470ohms for the red 5mm LED, a XTAL 20mhz on PIN 13 & 14, fallowed by 2 capa (22pf) -> GROUND.

    I'm speaking bad but i understand good

    @+
    Niko
    Last edited by nquere; - 8th November 2008 at 22:28.

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


    Did you find this post helpful? Yes | No

    Default

    Bonjour!
    Well in theory the above has to work... maybe your PIC programmer don't program the configuration fuses... or don't have the 16F877A option in the list?

    Make sure you have all Vdd and Vss pins connected.
    0.1 uF close to your PIC (on Vdd/vss line)

    For now use a 4MHz crystal (or resonator) and use XT_OSC.


    Bonne chance!
    Steve

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

  3. #3
    Join Date
    Nov 2008
    Location
    Epernon, France
    Posts
    15


    Did you find this post helpful? Yes | No

    Default

    Hie,

    OK i will buy a 4mhz osc. My programmer is PicKit 2... :-/

  4. #4
    Join Date
    Sep 2008
    Location
    Stockholm
    Posts
    80


    Did you find this post helpful? Yes | No

    Default

    What software do you use ? "Pickit 2 programmer" or MPLAB IDE ? ..with the later I dont know if the manual settings overrides the settings in the source, I use the Pickit2 software.

    I just tried your code, compiled it with

    C:\PBP>pbpw -p16f877a blinkit.bas

    and loaded the hexfile into the pic with the pickit2 software.

    The pic only had a 20MHz xtal between pin 13 and 14, two 22pf caps from both pins to ground and a 10k pullup on ~MCLR, a 470ohm resistor from pin 17 to a LED wich is connectet to ground in the other end. exactly your setup as far as I can see.

    And yes, it works here.

  5. #5
    Join Date
    Sep 2008
    Location
    Stockholm
    Posts
    80


    Did you find this post helpful? Yes | No

    Default

    btw the text on my 16F877A also reads "PIC16F877A-I/P" and its 20MHz units, i know coz I ordered it, and I also run them in 20MHz

  6. #6
    Join Date
    Jun 2007
    Location
    Mansfield, UK
    Posts
    697


    Did you find this post helpful? Yes | No

    Default

    I had problems with that same PIC not so long ago. Mackrackit posted a solution in post 21 of this thread. It might help here

  7. #7
    Join Date
    Sep 2008
    Location
    Stockholm
    Posts
    80


    Did you find this post helpful? Yes | No

    Default

    yea, but his example works for me without disabling AD-converters and comparators.

  8. #8
    Join Date
    Nov 2008
    Location
    Epernon, France
    Posts
    15


    Did you find this post helpful? Yes | No

    Default

    Coucou,

    Bon j'ai testé avec un autre PIC et apparement tout est OK ! Surement le PIC qui devaient etre foutu...

    J'ai testé avec et sans
    Code:
    ADCON1=7 
    CMCON=7
    et cela fonctionne

    Merci ŕ tous !



    -----------------

    Oups ! To resume, it's OK with an another PIC. I've tested with A/D off and comparator OFF.
    I use PIC Flash soft

    Thx for your support
    Last edited by nquere; - 10th November 2008 at 20:58.

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


    Did you find this post helpful? Yes | No

    Default

    Yup ca fait du sens! Anyways the pin you're using aren't multiplexed with ADCs, or comparator...
    Steve

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

  10. #10
    Join Date
    Nov 2008
    Location
    Epernon, France
    Posts
    15


    Did you find this post helpful? Yes | No

    Default

    Erf, i think that i have the same PIC because it don't run today

    I will buy an another one :/

Similar Threads

  1. First timer...building a remote controlled vehicle
    By .n0rig. in forum mel PIC BASIC Pro
    Replies: 32
    Last Post: - 9th February 2009, 03:44
  2. Pic16f84 and RC5 kode
    By terminator in forum Bluetooth
    Replies: 5
    Last Post: - 18th June 2007, 21:40
  3. LCD will not start
    By btaylor in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 24th May 2007, 02:30
  4. Clock connection to DS1802 from 16F877A
    By coyotegd in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 3rd January 2006, 18:52
  5. 16F877A stack problems
    By rocketman in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 1st October 2004, 16:54

Members who have read this thread : 1

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