pin assignment


Closed Thread
Results 1 to 5 of 5

Thread: pin assignment

  1. #1
    cheznez's Avatar
    cheznez Guest

    Default pin assignment

    i am programming a pic16f648 for the first time. in the manuel i found a statement that says the pin number has nothing to do with the physical pin number. How do I assign know which physical pin number will be used for each pin of a port

  2. #2
    Join Date
    Nov 2004
    Location
    Saskatchewan Canada
    Posts
    189


    Did you find this post helpful? Yes | No

    Default

    Doesn't the datasheet show you what port numbers are assigned to what physical pin numbers? It's usually right near the front of the specific PIC datasheet.

    Bart

  3. #3
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    Hello Cheznez,

    Chez>>i am programming a pic16f648 for the first time. in the manuel i found a statement that says the pin number has nothing to do with the physical pin number. How do I assign know which physical pin number will be used for each pin of a port<<

    Most chips that I know of, have a little indent, or dot on the #1 pin of the chip, and you count clockwise or counter clockwise for the pin numer.

    You have to look at the DATA sheet for the PIC chip you are using.

    For example the chip has 8 pins.....

    PortA has 8 pins, but for a ADC pin there may be 5 of them. Pins number 0,1,2,3,7. but on your Switch part of the program (the headers that tell the chip which pins you are using for ADC), It keeps them in order.

    so activating a ADC would be like
    ADCON1="00011111" 'Activating all 5 ADC's on pin 0,1,2,3,7

    not

    ADCON1="10001111"

    Dwayne
    Ability to Fly:
    Hurling yourself towards the ground, and missing.

    Engineers that Contribute to flying:
    Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute

    Pilots that are Flying:
    Those who know their limitations, and respect the green side of the grass...

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    If you refer to ident pin like for

    HIGH PinNumber

    as

    HIGH 0

    you'll find some information in the page 26 of the PBP manual.

    BUT i'll prefer to use PIN NAME instead of pin number... more easy to read.

    ex:

    HIGH PORTB.0
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  5. #5
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    Hello Steve,

    Steve>>BUT i'll prefer to use PIN NAME instead of pin number... more easy to read.

    ex:

    HIGH PORTB.0
    <<

    I agree Steve... Makes a heck of a lot easier to debug too. You are not constantly referring back to a previously assigned Pin Value.

    I do the same with the header variables too. I realize that using certain functions will automatically assign a pin to a input or output, but I use (by habit) the Header assignments for safety sake <g>.

    Dwayne
    Ability to Fly:
    Hurling yourself towards the ground, and missing.

    Engineers that Contribute to flying:
    Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute

    Pilots that are Flying:
    Those who know their limitations, and respect the green side of the grass...

Similar Threads

  1. Is this a K Type sensor?
    By jessey in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 21st November 2009, 13:55
  2. DS1820 with 16f688
    By jessey in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 23rd May 2009, 05:07
  3. Advice-scrutiny for my serial controller
    By kevlar129bp in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 13th December 2008, 17:11
  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. Another RTC, DS1287
    By DavidK in forum Code Examples
    Replies: 0
    Last Post: - 12th December 2006, 17:07

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