Using port A on the 16F73


Closed Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2004
    Posts
    24

    Default Using port A on the 16F73

    I have a display project that uses a 16F73, and I need to add a GPS reciever and status LED. However the only availible ports are RB7, RA1 and RA3. Unfortunatly RA0 is used as an analogue input while RA2,4 and 5 are digital input so the ADCON1=4, which also set RA1 and RA3 to analogue as well.

    I was going to put the GPS reciever on RB7 and was wondering if it is possible to toggle the ADCON registor within the programme so that when I need to get the voltage on RA0, I can set it to analogue and then set it back to digital straight after, e.g.

    ADCON1 = 7 'port a digital
    ...
    high porta.1 'turn on status LED
    ....
    ADC: ADCON1=4 'RA0 analogue
    ADCin 0,volt 'get voltage
    ADCON1=7 'Port A digital again
    RETURN

    Thanks

  2. #2
    Join Date
    Oct 2003
    Location
    holland
    Posts
    251


    Did you find this post helpful? Yes | No

    Default

    Yes, you can do that.

Similar Threads

  1. Why (or how to) make a port array for OW
    By Roy___ in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 22nd February 2009, 23:30
  2. Change On Interrupt, PIC16F884
    By elec_mech in forum mel PIC BASIC Pro
    Replies: 17
    Last Post: - 14th November 2008, 17:25
  3. port config.
    By tamertokgoz in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 25th July 2008, 12:25
  4. Microcontroller with 2 way paging application problem
    By oneohthree in forum mel PIC BASIC Pro
    Replies: 30
    Last Post: - 20th April 2007, 17:27
  5. STATUS re-curtain W
    By zugvogel1 in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 13th February 2005, 15:21

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