English
Language : 

PIC16F193X Datasheet, PDF (99/418 Pages) Microchip Technology – 28/40/44-Pin Flash-Based, 8-Bit CMOS Microcontrollers with LCD Driver and nanoWatt Technology
PIC16F193X/LF193X
6.5.1 ANSELD REGISTER
The ANSELD register (Register 6-17) is used to
configure the Input mode of an I/O pin to analog.
Setting the appropriate ANSELD 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 ANSELD 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.
Note:
The ANSELD register must be initialized
to configure an analog channel as a digital
input. Pins configured as analog inputs will
read ‘0’.
REGISTER 6-16: TRISD: PORTD TRI-STATE REGISTER(1)
R/W-1/1
TRISD7
bit 7
R/W-1/1
TRISD6
R/W-1/1
TRISD5
R/W-1/1
TRISD4
R/W-1/1
TRISD3
R/W-1/1
TRISD2
R/W-1/1
TRISD1
R/W-1/1
TRISD0
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-0
TRISD<7:0>: PORTD Tri-State Control bits
1 = PORTD pin configured as an input (tri-stated)
0 = PORTD pin configured as an output
Note 1: TRISD is not implemented on PIC16F1933/1936/1938 devices, read as ‘0’.
2: PORTD implemented on PIC16F1934/1937/1939/PIC16LF1934/1937/1939 devices only.
REGISTER 6-17: ANSELD: PORTD ANALOG SELECT REGISTER(2)
R/W-1/1
ANSD7
bit 7
R/W-1/1
ANSD6
R/W-1/1
ANSD5
R/W-1/1
ANSD4
R/W-1/1
ANSD3
R/W-1/1
ANSD2
R/W-1/1
ANSD1
R/W-1/1
ANSD0
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-0
ANSD<7:0>: Analog Select between Analog or Digital Function on Pins RD<7: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:
3:
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.
ANSELD register is not implemented on the PIC16F1933/1936/1938. Read as ‘0’.
PORTD implemented on PIC16F1934/1937/1939/PIC16LF1934/1937/1939 devices only.
© 2008 Microchip Technology Inc.
Preliminary
DS41364A-page 97