English
Language : 

PIC16F193X Datasheet, PDF (103/418 Pages) Microchip Technology – 28/40/44-Pin Flash-Based, 8-Bit CMOS Microcontrollers with LCD Driver and nanoWatt Technology
PIC16F193X/LF193X
6.6.1 ANSELE REGISTER
The ANSELE register (Register 6-22) is used to
configure the Input mode of an I/O pin to analog.
Setting the appropriate ANSELE bit high will cause all
digital reads on the pin to be read as ‘0’ and allow
analog functions on the pin to operate correctly.
The state of the ANSELE bits has no affect on digital
output functions. A pin with TRIS clear and ANSEL set
will still operate as a digital output, but the Input mode
will be analog. This can cause unexpected behavior
when executing read-modify-write instructions on the
affected port.
The TRISE register (Register 6-21) controls the PORTE
pin output drivers, even when they are being used as
analog inputs. The user should ensure the bits in the
TRISE register are maintained set when using them as
analog inputs. I/O pins configured as analog input always
read ‘0’.
Note:
The ANSELE register must be initialized to
configure an analog channel as a digital
input. Pins configured as analog inputs will
read ‘0’.
REGISTER 6-21: TRISE: PORTE TRI-STATE REGISTER
U-0
—
bit 7
U-0
U-0
U-0
R-1
R/W-1
R/W-1
R/W-1
—
—
—
TRISE3
TRISE2(1)
TRISE1(1)
TRISE0(1)
bit 0
Legend:
R = Readable bit
u = bit is unchanged
‘1’ = Bit is set
W = Writable bit
x = Bit is unknown
‘0’ = Bit is cleared
U = Unimplemented bit, read as ‘0’
-n/n = Value at POR and BOR/Value at all other Resets
bit 7-4
bit 3
bit 2-0
Unimplemented: Read as ‘0’
TRISE3: RE3 Port Tri-state Control bit
This bit is always ‘1’ as RE3 is an input only
TRISE<2:0>: RE<2:0> Tri-State Control bits(1)
1 = PORTE pin configured as an input (tri-stated)
0 = PORTE pin configured as an output
Note 1: TRISE<2:0> are not implemented on the PIC16F1933/1936/1938/PIC16LF1933/1936/1938. Read as ‘0’.
REGISTER 6-22: ANSELE: PORTE ANALOG SELECT REGISTER
U-0
—
bit 7
U-0
U-0
U-0
U-0
R/W-1
R/W-1
R/W-1
—
—
—
—
ANSE2(2)
ANSE1(2)
ANSE0(2)
bit 0
Legend:
R = Readable bit
u = bit is unchanged
‘1’ = Bit is set
W = Writable bit
x = Bit is unknown
‘0’ = Bit is cleared
U = Unimplemented bit, read as ‘0’
-n/n = Value at POR and BOR/Value at all other Resets
bit 7-3
bit 2-0
Unimplemented: Read as ‘0’
ANSE<2:0>: Analog Select between Analog or Digital Function on Pins RE<2:0>, respectively
0 = Digital I/O. Pin is assigned to port or digital special function.
1 = Analog input. Pin is assigned as analog input(1). Digital input buffer disabled.
Note 1:
2:
When setting a pin to an analog input, the corresponding TRIS bit must be set to Input mode in order to allow external
control of the voltage on the pin.
ANSELE register is not implemented on the PIC16F1933/1936/1938/PIC16LF1933/1936/1938. Read as ‘0’
© 2008 Microchip Technology Inc.
Preliminary
DS41364A-page 101