16f876a


Closed Thread
Results 1 to 5 of 5

Thread: 16f876a

Hybrid View

  1. #1
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Smile

    Quote Originally Posted by DanS.
    ... then the processor just runs out into the weeds! ...
    1) What is connected to pin 1?

    2) consider adding ADCON1 = 7
    Last edited by paul borgmeier; - 14th October 2006 at 04:15.
    Paul Borgmeier
    Salt Lake City, UT
    USA
    __________________

  2. #2
    Join Date
    Sep 2004
    Location
    Mentor, Ohio
    Posts
    352


    Did you find this post helpful? Yes | No

    Smile

    Hi,

    Paul's reply is very important. Also do you have pull up or pull down resistors on your inputs?

    You can save some typing by setting up your ports like this:
    TRISA = %00000111 '1 = input 0 = output
    TRISB = %11000000
    TRISC = %00000000

    Just looking at your Main program, "If tpin = 0 then main" says if the input pin is grounded or low just loop here until it's high. If it's high then pulse the LED on and off until the tpin is low again. Without plugging this program into a board here it should seem it would work BUT as Paul said what have you done with pin 1 and did you set ADCON1 to 7.

    In your "hardware setup" you have CMCON = 7 'disable adcs, porta = digital.

    All "CMCON = 7" does is disable the comparators.

    "ADCON1 = 7" disables the analog ports making them digital.

    Pin 1 is the MCLR input and needs to be made high through at least a 1K resistor. You should also have .01uF capacitors across the + and - power pins as close as possible and also one between the MCLR pin and ground.

    I'm going to work now so try these things out and see if your PIC doesn't work better.

    You're only learning now!

    Have a nice day!

    BobK

Similar Threads

  1. Problem with 16F877A but not with 16F876A
    By savnik in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 16th May 2008, 14:18
  2. 16f876a Pwm
    By Hainkm in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 30th December 2007, 17:33
  3. 16F876A Configuration
    By RFEFX in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 29th November 2006, 18:30
  4. Pwm 16f876a
    By DynamoBen in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 19th September 2006, 06:35
  5. EPIC Programmer - Works for all chips but the 16F876A
    By 4Lewis in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 12th April 2006, 23:59

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