PDA

View Full Version : Port pin identification



jmgelba
- 18th October 2005, 00:44
I've seen two ways of identifying the same pin......

PORTA.5 = pin 5 Physically
PORTA.5 = RA 5.


Both are in the PBP manual or on links to PBP examples out on the web.
Error in the users manual? As the first statment is used as an example.

Melanie
- 18th October 2005, 08:25
Your first exaple is correct usage for PBP. For example...

High PortA.5 ' Make pin go High (Output)

or

MyBitVariable=PortA.5 ' Transfer status of pin to Variable (Input)

or

MyFavouritePin var PortA.5 ' alias the pin

High MyFavouritePin ' Make pin go High (Output)

Your second example (as RA5) is the preferred designation in Microchips' Datasheets and is a quick way of referring to that pin although NOT a correct way to PROGRAM unless you first alias that prin as so...

RA5 var PortA.5

Now you can refer to RA5 within your program.

jmgelba
- 19th October 2005, 01:01
I might be missunderstanding your reply, but im talking about the actual physical pin itself.

Is PORTA.5 RA5 or is it the physical pin 5 of the chip? It has to be PORTA.5 = RA5, as PORTA.0 cant be pin 0 as pin 0 does not exist.
What Im saying is both examples of how to identify the physical pin number are shown in the manual, so one of them has to be wrong, and I believe its the first example.

Melanie
- 19th October 2005, 01:07
Go to the Microchip website and download the Datasheet for your PIC. Look at the pin layout for your chosen package and all will be revealed!