PortA digita input?


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2009
    Location
    Alabama,USA
    Posts
    219

    Default PortA digita input?

    I am working on a home project which I would like to use a 16F873A to control a TIP120 Darlington to drive a relay coil. I first check a PortC pin for high or low. If high, I need to read an encoder to select a time delay before triggering the relay.

    I would like to Check for high or low on PortC, read the two bit encoder which will have some value continuously on PortA, display time delay value on PortB, and drive the TIP120 on PortC. As I read about PortA I have some concerns using PortA as digital inputs. Question; using PBP should I set ADCON1= %00000111, TRISA=%11111111. There is a note in the mid range manual that says I may have a high current on pins on PortA as I read the value of the port. Do I have a problem using PortA as digital input?
    TRISB=%00000000
    TRISC=%11110000
    Will PBP handle my concerns?
    Comments will be appreciated.
    Last edited by MOUNTAIN747; - 27th January 2009 at 01:17.

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by MOUNTAIN747 View Post
    Question; using PBP should I set ADCON1= %00000111
    ADCON1 =6 or 7 ok
    TRISA=%11111111. There is a note in the mid range manual that says I may have a high current on pins on PortA as I read the value of the port. Do I have a problem using PortA as digital input?
    NO, as set all port a inputs.
    TRISB=%00000000
    TRISC=%11110000
    Will PBP handle my concerns?
    Comments will be appreciated.
    Ok, all port b outputs upper half of PortC as inputs,
    set ADCON0=0 , CMCON=7 , and remember RA4 is open drain and requires a pullup resistor.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  3. #3
    Join Date
    Jan 2009
    Location
    Alabama,USA
    Posts
    219


    Did you find this post helpful? Yes | No

    Default PortA good to go

    It looks like I'm good to go. Also thanks for mentioning ADCON0 and CMCON, I wasn't sure about that.
    Thanks Joe

Similar Threads

  1. PIC Interrupt and PORTA input
    By Jerade in forum mel PIC BASIC
    Replies: 5
    Last Post: - 29th November 2009, 17:24
  2. Sony LanC Program
    By l_gaminde in forum Code Examples
    Replies: 2
    Last Post: - 25th September 2009, 18:51
  3. Timing input pulses and re-outputting them
    By jamie_s in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 28th February 2007, 01:50
  4. PIC16F877 PORTA Input Issue
    By CocaColaKid in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 6th December 2005, 20:33
  5. Can anyone help a beginner in a struggle?
    By douglasjam in forum mel PIC BASIC
    Replies: 1
    Last Post: - 5th May 2005, 23:29

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