PIC16C782 Microchip Technology Inc., PIC16C782 Datasheet - Page 28
![no-image](/images/manufacturer_photos/0/4/440/microchip_technology_inc__sml.jpg)
PIC16C782
Manufacturer Part Number
PIC16C782
Description
8-bit Cmos Microcontrollers With A/d, D/a, Opamp, Comparators And Psmc
Manufacturer
Microchip Technology Inc.
Datasheet
1.PIC16C782.pdf
(186 pages)
Available stocks
Company
Part Number
Manufacturer
Quantity
Price
- Current page: 28 of 186
- Download datasheet (4Mb)
PIC16C781/782
3.2
PORTA is an 8-bit wide, bi-directional port with the
exception of RA0, RA1 and RA5, which are inputs only.
The corresponding data direction register is TRISA.
Setting a TRISA bit (= 1) makes the corresponding
PORTA pin an input (i.e., disables the digital output).
Clearing a TRISA bit (= 0) makes the corresponding
PORTA pin an output (i.e., disables the digital output).
Reading the PORTA register reads the status of the
pins, whereas writing to it, writes to the port latch. All
write operations are read-modify-write operations.
Therefore, a write to a port implies that the port pins are
read, this value is then modified and written to the port
data latch.
Pins RA<3:0> are multiplexed with analog functions:
• Analog inputs AN<3:0> to the A/D Converter.
• V
• OPAMP inverting/non-inverting inputs.
Pins RA<7:4> are multiplexed with digital functions:
• Pin RA4 is multiplexed with the TMR0 module
• Pin RA5 is multiplexed with the device RESET
• Pins RA6 and RA7 are multiplexed with the
PORTA has the following I/O characteristics:
• RA0, RA1, and RA5 are input only.
• RA4 is an open drain output. All other PORTA
• All PORTA pins have Schmitt trigger inputs.
DS41171A-page 26
Note:
clock input.
(MCLR) and programming input (V
oscillator/clock I/O functions. RA6 can also be
configured as the TMR1 clock input.
pins have full CMOS buffer outputs.
REF
1 and V
PORTA and the TRISA Register
When the analog peripherals are using any
of these pins as analog input/output, the
ANSEL register must have the proper
value to individually select the Analog
mode of the corresponding pins.
REF
2 inputs to the comparators.
PP
) function.
Preliminary
EXAMPLE 3-1:
;*
;*
;*
;*
;*
;*
;*
;*
;*
3.2.1
The ANSEL and TRISA registers are the primary soft-
ware controls for the configuration of PORTA pins.
TRISA bits tri-state the output drivers of PORTA, and
ANSEL register bits control the digital input buffers. It is
important to program both registers when configuring a
mixed signal port pin, as most peripherals cannot over-
ride the TRISA and ANSEL registers control. Even if a
peripheral has the ability to override control of the
TRISA and ANSEL registers, it is good programming
practice to program both registers appropriately.
There are specific cases in which the TRISA and
ANSEL registers can be overridden by a peripheral or
a configuration bit, see Figures 3-1 through 3-8 for
details.
Note:
Note 1: RB<3:0> configured as digital I/O
Note 2: RA<7:6> availability depends on
BANKSEL
CLRF
BANKSEL
MOVLW
MOVWF
MOVLW
MOVWF
This code block will configure PORTA
as follows
RA<3:2>
RA<1:0>
RB<3:0>
the oscillator selection
RA<7:4>
Crystal (LP, XT and HS) oscillator configu-
rations
T1CKI as OSC2. In these modes, setting
or clearing TRISA<6> will have no effect
and the pin will read as a zero (0).
TRISA, ANSEL, AND CONTROL
PRECEDENCE
digital outputs
digital inputs
analog inputs
digital I/O
PORTA
PORTA
TRISA
B’00001111’; Digital I/O
TRISA
B’00000011’; Analog I/O config
ANSEL
use
INITIALIZING PORTA
2001 Microchip Technology Inc.
pin
; Select Bank 0
; Preset PORTA data
;
; Select Bank 1
;
; Configure PORTA
;
;
; Configure PORTA
;
RA6/OSC2/CLKOUT/
reg
config data
digital
data
analog
Related parts for PIC16C782
Image
Part Number
Description
Manufacturer
Datasheet
Request
R
![PIC-0903](/images/no-image3.png)
Part Number:
Description:
Photo IC(photodiode with signal processing)
Manufacturer:
KODENSHI KOREA CORP
Datasheet:
![PIC-1018SMB](/images/no-image3.png)
Part Number:
Description:
INFRARED RECEIVER MODULE
Manufacturer:
ETC
Datasheet:
![PIC-2058SMB](/images/no-image3.png)
Part Number:
Description:
INFRARED RECEIVER MODULE
Manufacturer:
ETC
Datasheet:
![PIC-2503](/images/no-image3.png)
Part Number:
Description:
Photo IC(photodiode with signal processing)
Manufacturer:
KODENSHI KOREA CORP
Datasheet:
![PIC12045S](/images/manufacturer_photos/0/3/374/kodenshi_tmb.jpg)
Part Number:
Description:
(PIC-1204x) OPTICAL-RECEIVER OUTPUT PHOTO IC
Manufacturer:
Kodenshi
Datasheet:
![TC1014-2.7VCT](/images/manufacturer_photos/0/4/440/microchip_technology_inc__tmb.jpg)
Part Number:
Description:
Manufacturer:
Microchip Technology Inc.
Datasheet:
![TC1014-5.0VCT](/images/manufacturer_photos/0/4/440/microchip_technology_inc__tmb.jpg)
Part Number:
Description:
Manufacturer:
Microchip Technology Inc.
Datasheet:
![TC1055-2.5VCT](/images/manufacturer_photos/0/4/440/microchip_technology_inc__tmb.jpg)
Part Number:
Description:
Manufacturer:
Microchip Technology Inc.
Datasheet:
![TC1055-2.7VCT](/images/manufacturer_photos/0/4/440/microchip_technology_inc__tmb.jpg)
Part Number:
Description:
Manufacturer:
Microchip Technology Inc.
Datasheet:
![TC1055-2.8VCT](/images/manufacturer_photos/0/4/440/microchip_technology_inc__tmb.jpg)
Part Number:
Description:
Manufacturer:
Microchip Technology Inc.
Datasheet:
![TC1055-4.0VCT](/images/manufacturer_photos/0/4/440/microchip_technology_inc__tmb.jpg)
Part Number:
Description:
Manufacturer:
Microchip Technology Inc.
Datasheet: