PIC16C781T-I/SO Microchip Technology, PIC16C781T-I/SO Datasheet - Page 28

IC MCU CMOS 8BIT 1K 20MHZ 20SOIC

PIC16C781T-I/SO

Manufacturer Part Number
PIC16C781T-I/SO
Description
IC MCU CMOS 8BIT 1K 20MHZ 20SOIC
Manufacturer
Microchip Technology
Series
PIC® 16Cr

Specifications of PIC16C781T-I/SO

Core Processor
PIC
Core Size
8-Bit
Speed
20MHz
Peripherals
Brown-out Detect/Reset, POR, PWM, WDT
Number Of I /o
13
Program Memory Size
1.75KB (1K x 14)
Program Memory Type
OTP
Ram Size
128 x 8
Voltage - Supply (vcc/vdd)
4 V ~ 5.5 V
Data Converters
A/D 8x8b; D/A 1x8b
Oscillator Type
Internal
Operating Temperature
-40°C ~ 85°C
Package / Case
20-SOIC (7.5mm Width)
For Use With
AC164028 - MODULE SKT PROMATEII 20SOIC/DIP
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
Eeprom Size
-
Connectivity
-
Other names
PIC16C781TI/SO
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 PIC16C781T-I/SO