Watching for pin High


Closed Thread
Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    Jan 2010
    Posts
    24


    Did you find this post helpful? Yes | No

    Default Re: Watching for pin High

    Thank you for the help. So far it is still not working(I have not tried everything suggested though). I will try to add the pull down resistors as well. I already have the working PCB but I should be able to drill and add them with some creative soldering.

    I didn't really intend this board to be an input board but figured I would use it for testing while I was ironing everything (output) else out.

  2. #2
    Join Date
    Jan 2009
    Location
    California, USA
    Posts
    323


    Did you find this post helpful? Yes | No

    Default Re: Watching for pin High

    Have you set the pins to be inputs using TRISA?

    (Heckler's post #5)

    Unless those pins are set as inputs, all other effort will be wasted...


    Steve
    Last edited by Byte_Butcher; - 16th October 2011 at 20:44.

  3. #3
    Join Date
    Oct 2009
    Location
    Utah, USA
    Posts
    427


    Did you find this post helpful? Yes | No

    Default Re: Watching for pin High

    actually the "TRIS" statement should have read...

    TrisA = %00000011 the "%" indicates the following number is binary

    you also need to turn off the comparators by including this statement...

    CMCON = %00000111
    or
    CMCON = 7 if you prefer to work with decimal numbers

    I like to show the configuration registers using binary as each bit usually does something different and it is easier for me to interpret my code.

    I am not sure of your level of knowledge setting up PIC micro's, but you should read the data sheet (at least parts of it) regarding the particular pins and functions you are trying to set up... for example TABLE 5-2 in the data sheet shows ALL the registers that affect PortA. There you see that CMCON must be configured to turn off the comparators.

    It is good to look around the forum and in the wiki section and view and study code examples to see how others set up the registers in order to do certain functions.

    That was by far the most difficult thing for me to understand when beginning to work with PIC's.

    As far as changing your circut board to include the pull-down resistor... you can also just hook it up externally without modifying your board. Just install a resistor (say 10K ohm) from the pin to ground... then when you touch that pin with +5 volts your code should be able to detect a "1".

    If you need more help... do post back here.

    good luck
    Dwight
    These PIC's are like intricate puzzles just waiting for one to discover their secrets and MASTER their capabilities.

Members who have read this thread : 1

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