PIC18F24J11 MICROCHIP [Microchip Technology], PIC18F24J11 Datasheet - Page 135

no-image

PIC18F24J11

Manufacturer Part Number
PIC18F24J11
Description
28/44-Pin, Low-Power, High-Performance USB Microcontrollers with nanoWatt XLP Technology
Manufacturer
MICROCHIP [Microchip Technology]
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
PIC18F24J11-I/ML
Manufacturer:
MICROCHIP
Quantity:
49 000
Part Number:
PIC18F24J11-I/SO
Manufacturer:
Microchip Technology
Quantity:
1 960
10.2
PORTA is a 7-bit wide, bidirectional port. It may
function as a 5-bit port, depending on the oscillator
mode selected. Setting a TRISA bit (= 1) will make the
corresponding PORTA pin an input (i.e., put the
corresponding output driver in a high-impedance
mode). Clearing a TRISA bit (= 0) will make the
corresponding PORTA pin an output (i.e., put the
contents of the output latch on the selected pin).
Reading the PORTA register reads the status of the
pins, whereas writing to it, will write to the port latch.
The Data Latch (LATA) register is also memory mapped.
Read-modify-write operations on the LATA register read
and write the latched output value for PORTA.
The other PORTA pins are multiplexed with analog
inputs, the analog V
parator voltage reference output. The operation of pins,
RA<3:0> and RA5, as A/D converter inputs is selected
by clearing or setting the control bits in the ANCON0
register (A/D Port Configuration Register 0).
Pins, RA0 and RA3, may also be used as comparator
inputs by setting the appropriate bits in the CMCON reg-
ister. To use RA<3:0> as digital inputs, it is also
necessary to turn off the comparators.
All PORTA pins have TTL input levels and full CMOS
output drivers.
The TRISA register controls the direction of the PORTA
pins, even when they are being used as analog inputs.
The user must ensure the bits in the TRISA register are
maintained set when using them as analog inputs.
 2011 Microchip Technology Inc.
Note:
PORTA, TRISA and LATA Registers
On a Power-on Reset (POR), RA5 and
RA<3:0> are configured as analog inputs
and read as ‘0’.
REF
+ and V
REF
- inputs and the com-
PIC18F46J11 FAMILY
EXAMPLE 10-2:
CLRF
MOVLB
MOVLW
MOVWF
MOVLW
MOVWF
LATA
0x0F
0x0F
ANCON0
0xCF
TRISA
; Initialize LATA
; to clear output
; data latches
; ANCONx register not in
; Access Bank
; Configure A/D
; for digital inputs
; Value used to
; initialize data
; direction
; Set RA<3:0> as inputs
; RA<5:4> as outputs
INITIALIZING PORTA
DS39932D-page 135

Related parts for PIC18F24J11