PIC16F877A PORTA.2 not working


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2007
    Location
    Mansfield, UK
    Posts
    697

    Default PIC16F877A PORTA.2 not working

    Hi, I think i know the answer to this one but i want to double check. Ive got PORTA.2 connected to a transistor but it never turns on. Im pretty sure my settings are correct.

    Code:
    'Chip settings
    ADCON0=0
    ADCON1=0
    CMCON=7
    CVRCON=0
    CCP1CON=0
    All special operations on that pin should be disabled. When i put my finger under the transistor the LEDs turn on so i know the transistor is working. When the PIC is connected they even flash. It seems like the PIC is turning that output on and off correctly but it doesnt actually go high. It seems to switch between low and floating.

    Is the chip supposed to do this or is this one broken? Will it be fine to add something like a 100K pull up resistor? (I think that might solve this problem)

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    For an 877A, you only need one of those lines, but with a different value.

    ADCON1 = 7

    CMCON=7 ; already 7 on power-up
    ADCON0=0 ; already 0 on power-up
    CVRCON=0 ; already 0 on power-up
    CCP1CON=0 ; already 0 on power-up
    DT

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


    Did you find this post helpful? Yes | No

    Default

    Thanks, Ill try that.

    Im going to leave the other lines there because last year im sure i had to add 2 lines to get it to work properly but i cant remember which 2.

Similar Threads

  1. PIC16F877A analog problem
    By DeViLa_Q8 in forum mel PIC BASIC
    Replies: 0
    Last Post: - 30th July 2009, 20:19
  2. PIC16F877A for application in mobile robot...
    By mcbeasleyjr in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 30th January 2009, 14:47
  3. PIC16F877A not working again :(
    By The Master in forum Off Topic
    Replies: 24
    Last Post: - 30th October 2008, 00:04
  4. PIC16F877A not working
    By The Master in forum General
    Replies: 6
    Last Post: - 16th November 2007, 11:32
  5. Help Quick Need to make code smaller
    By Programmednew in forum mel PIC BASIC Pro
    Replies: 41
    Last Post: - 25th January 2005, 03:46

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