PIC16F676 troubles


Closed Thread
Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: PIC16F676 troubles

    Well actually, If you were to put a scope on the led pin you should see it toggling with a period of 50 Milliseconds while the push button is being pressed. I assume you have a pullup resistor connected to +5 volts and the Porta.3 pin?
    Dave Purola,
    N8NTA
    EN82fn

  2. #2


    Did you find this post helpful? Yes | No

    Default Re: PIC16F676 troubles

    I see your point. But the flaw in the code is not the underlying problem. It should flicker while the button is held down. And then land on ON or OFF 50:50, right? I changed the pause to 1000 and it's still the same. Yes, I have the a 10k pull up resistor to Vdd. Does the config section look correct? For some reason, the TRIS reg didn't cut and past completely. It should be

    TRISA = %11001000

    Does that look correct?
    Do I need to do something with the C registry?

  3. #3
    Join Date
    Jan 2013
    Location
    Texas USA
    Posts
    229


    Did you find this post helpful? Yes | No

    Default Re: PIC16F676 troubles

    I don't see where you are configuring the analog select register ANSEL.
    By not explicitly setting the value of this register the PIC is using the default value, which might be enabling some pins as analog.

    Check the Datasheet to verify how you want them set and make sure you add the appropriate ANSEL = xxx statement to the beginning of your program.

    That may be causing you a problem.
    I have found it is usually a good idea to check and set the registers for all of the hardware modules.

    Might be worth checking.
    Regards,
    TABSoft

Similar Threads

  1. PIC16F676 RS232 baud rate
    By jrprogrammer in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 12th February 2010, 14:16
  2. PIC16F676 Problem
    By Atom058 in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 19th April 2007, 16:05
  3. Interfacing RTC (DS1302) with pic16F676
    By Andrew_A in forum Off Topic
    Replies: 1
    Last Post: - 14th February 2006, 08:49
  4. PIC16F676 I/O Problems.
    By BobEdge in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 7th March 2005, 16:37
  5. PIC16F676 Troubles
    By BobEdge in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 27th February 2005, 10:01

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