The basics


Results 1 to 15 of 15

Thread: The basics

Threaded View

  1. #6
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    Hi Alain,

    I think that would be nice, but I think its a long way off if PBP went that route.

    No I think the previous poster understood me a little better. If this helps, let me give you an example.

    I have a 28 pin device, want to use port C as output to leds, port B to an LCD and port A to be a mix of digital I/O for switches, and a pot or two. This is where I (and probably most newbies) stumble when it comes to configuring the PIC. Whilst following Mels post would indeed set up port A for digital, if you want to use one of the AN pins, but have switches on the others, then its confusing. Maybe a database is too complicated, I would simply like somehing along the lines of:

    "to set PORTA.0 to analogue, PORTA.1-7 Digital use ADCON = X"
    "to set PORTA.1 to analogue, PORTA.0 and A.2-7 digital use ADCON = Y

    etc

    On a current project I've resurrected I want PortA.0, 2 & 3 digital for switches, and Porta.1 analoge to read the value from a 10K pot. But I'm not sure what value I need to set ADCON to get this mix.

    EDIT: - I see "bit 3" needs to have a value of 1110 (if I follow the data sheet), but how do I convert that into a statement "ADCON = ???" (Data sheet http://ww1.microchip.com/downloads/e...Doc/39582b.pdf) - I'm using a 16F873A
    Last edited by malc-c; - 21st June 2008 at 21:49.

Similar Threads

  1. Bitwise operations and masks: basics, help?
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 19th April 2008, 00:24
  2. IR software & hardware basics
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 6th May 2007, 10:05
  3. basics programming
    By olivierb38 in forum General
    Replies: 3
    Last Post: - 18th February 2007, 18:56
  4. Timers, oscillators, cycles... need basics please
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 24th October 2006, 18:33
  5. SERIN basics
    By Michael in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 14th August 2006, 18:37

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