16F876A Configuration


Closed Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2006
    Location
    Murrieta, CA
    Posts
    62

    Exclamation 16F876A Configuration

    Ok,
    So please bare with me... I am a previous Basic Stamp II Junkie (tired of buying $50 Stamps) and you can say i have finally stepped into the light. I am learning the whole PIC programming thing.

    I have recently fabbed a new circuit board using the 16F876A PIC QFN28 Package.

    Heres problem 1:
    PORTA 0,1,2,3,4 are being used as outputs. PORTA.4 can't get it to output.
    using PicBasic Pro i have included ADCON1=7 at the top of the program along with TRISA=%00000000

    Heres Problem 2:
    PORTC 7,6,5,4,3 are used as inputs and are being driven by a Holtek Decoder.
    So far PORTC.3 and 4 are the only ones actually working. I have set TRISC=%11111111 at the top of the program.

    Sample program:
    In the program below I have the 5 logic inputs coming from the Decoder to PORTC 3-7. when only 3 and 4 actually get read by the PIC (Problem 2). PORTB.5 and PORTA.4 are connected to LEDs. Only PORTB.5 turns on (Problem 1).

    Thanks for any help.

    '''''''''''''''''''''''''''''''''''''''''
    ADCON1=7
    CMCON=7
    TRISA=%00000000
    TRISC=%11111111

    main:
    low PORTB.5
    low PORTA.4
    if portc.7 = 1 then led:
    if portc.6 = 1 then led:
    if portc.5 = 1 then led:
    if portc.4 = 1 then led:
    if portc.3 = 1 then led:
    goto main:

    led:
    HIGH PORTA.4
    HIGH PORTB.5
    goto main:

  2. #2
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default A little help, maybe

    Hi RFEFX,
    Heres problem 1:
    PORTA 0,1,2,3,4 are being used as outputs. PORTA.4 can't get it to output.
    using PicBasic Pro i have included ADCON1=7 at the top of the program along with TRISA=%00000000
    is your OUTPUT AN OUTPUT LOGIC 1,, port A4 on most PIC requires an external pullup and will only switch low(open drain)and will sink current, not supply.
    Heres Problem 2:
    PORTC 7,6,5,4,3 are used as inputs and are being driven by a Holtek Decoder.
    So far PORTC.3 and 4 are the only ones actually working. I have set TRISC=%11111111 at the top of the program.
    If you have a logic probe or DVM check the port status and the output of encoder, you may need to pull port up or down with resistors

Similar Threads

  1. Presetting Configuration Fuses (PIC Defines) into your Program
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 82
    Last Post: - 15th December 2013, 09:54
  2. Configuration error
    By Russ Kincaid in forum mel PIC BASIC Pro
    Replies: 27
    Last Post: - 20th September 2009, 00:10
  3. 16F726 configuration
    By Byte_Butcher in forum General
    Replies: 2
    Last Post: - 8th February 2009, 17:53
  4. meProg configuration vs setting fuses in code
    By AndrewC in forum General
    Replies: 2
    Last Post: - 10th June 2008, 14:00
  5. Problem with 16F877A but not with 16F876A
    By savnik in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 16th May 2008, 14: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