 |
 |
On this page, I will explain about
Input/Output port of PIC16F873.There are 22 ports
in total. 6 ports as Port A, 8 ports as Port B, 8 ports as Port C. When
using as the input/output port of the digital signal, the A port, the B
port and the C port can be similarly used. However, some ports are used
also as the other feature port in addition to the digital signal I/O
port.
Port APort A is composed of 6 ports to RA5
from RA0.These ports can also be served as the
input port of the analog signal, the input port of analog reference
voltage, the input port of the timer0 clock of the outside so
on. The circuit is the same as PIC16F84A approximately but a selecting
circuit for the analog input is incorporated.When using for the digital signal I/O port, input mode or output
mode are specified by the TRISA register.In
case of not being the digital signal I/O port, the feature of each port is
specified by ADCON0 and ADCON1 registers.When
setting analog signal input, the specification of the TRISA register is
effective. So, when using as the analog signal input port, the
corresponding bit of TRISA register must be set to input mode
"1".
Port B
Port B is composed of 8 ports to RB7
from RB0. These ports can also be served as the
programming port in addition to the digital signal I/O
port. There is not a setting register when using as
the programming port. It is automatically used as the programming ports by
the ICSP programming. As for ICSP, refer to the item of PIC16F84A.
Four of port B, RB7 to RB4, have an interrupt on change feature.
When the circuit detects the change, RBIF bit of INTCON register will be
set and program conter will be change to address 4( Interrupt Vector
).
The RB0/INT port can be used as an external
interrupt input pin. When using this feature, the INTE bit of the INTCON
register should be set to "1" and rising detection(1) or falling
detection(0) should be selected by the INTEDG bit of the OPTION_REG
register.
Also, port B has a pull-up feature.
This feature is the feature to make the condition of the port H level
condition when nothing is connected with the port. Eight all of the ports
become a pull-up condition by making the RBPU bit of OPTION_REG "0". This
feature is effective only in the input mode. When set to the output mode
with the TRISB register, the port is detached from the pull-up
circuit. The circuit is same as PIC16F84A.

|
|
 |