Specifications

mikroElektronika | Free Online Book | PIC Microcontrollers | Chapter 3: I/O Ports
TOC
Introduction
Ch. 1
Ch. 2
Ch. 3
Ch. 4
Ch. 5
Ch. 6
Ch. 7
Ch. 8
Ch. 9
App. A
App. B
App. C
Chapter 3: I/O Ports
Features and Functions
One of the most important feature of the microcontroller is a number of input/output pins used for connection with
peripherals. In this case, there are in total of thirty-five general purpose I/O pins available, which is quite enough for the
most applications.
In order pins’ operation can match internal 8-bit organization, all of them are, similar to registers, grouped into five so
called ports denoted by A, B, C, D and E. They all have several features in common:
For practical reasons, many I/O pins have two or three functions. If a pin is used as any other function, it may not
be used as a general purpose input/output pin; and
Every port has its “satellite”, i.e. the corresponding TRIS register: TRISA, TRISB, TRISC etc. which determines
performance, but not the contents of the port bits.
By clearing some bit of the TRIS register (bit=0), the corresponding port pin is configured as output. Similarly, by setting
some bit of the TRIS register (bit=1), the corresponding port pin is configured as input. This rule is easy to remember 0 =
Output, 1 = Input.
http://www.mikroe.com/en/books/picmcubook/ch3/ (1 of 10)5/3/2009 11:32:31 AM