PIC16F877 Weird behavior


Closed Thread
Results 1 to 2 of 2
  1. #1
    fadibasic's Avatar
    fadibasic Guest

    Default PIC16F877 Weird behavior

    Hi guys,
    I am experiencing a weird behavior of the pic16F877.

    I have 24 led(s) That I have distributed on port D, C, E, and A.

    I wrote a code were the first 12 Leds will trun ON, and after every PAUSE 500, A LED will trun off and another LED will trun ON from the second set of 12 LEDs.
    Everything went well except 1 LED didn't turn ON at all. (I checked to see if it is burnt, but it is not). The LED was on PORTA.4

    Then I wrote another code, where all 24 LEDs will turn ON, and They will turn off, one at a time.

    I had a weird behavior: 6 LEDS didn't work and they are at PORTA.2, .3, .4, .5, PORTE.0, .2

    Have anyone experienced this behavior?
    Please if you have any advice or answer I will appreciate it.
    Thanks

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


    Did you find this post helpful? Yes | No

    Default

    is there any chance you forgot to disable the analog converters?
    ADCON1=7

    PortA Doesn't Work & Common 8-Bit PIC® Microcontroller I/O Pin Issues
    http://www.picbasic.co.uk/forum/showthread.php?t=561


    If i remember correctly, PORTA.4 is an open-drain output, so the LED has to be connected between Vdd and PORTA.4

    Pin RA4 doesn't work
    http://www.picbasic.co.uk/forum/showthread.php?t=562
    Steve

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

Similar Threads

  1. PIC16f877 code crosses boundary @800h
    By inventosrl in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 6th April 2009, 22:03
  2. Weird Problem
    By isaac in forum General
    Replies: 9
    Last Post: - 22nd September 2008, 19:30
  3. LCD and PIC18F2685 - Weird LCD behavior
    By Castor in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 29th April 2008, 09:55
  4. PIC16F877 I2C programme
    By cooqo in forum mel PIC BASIC
    Replies: 3
    Last Post: - 21st April 2008, 10:02
  5. Replies: 8
    Last Post: - 17th January 2007, 19:18

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