English
Language : 

PIC16F1829LIN Datasheet, PDF (44/74 Pages) Micon Design Technology Corporation – 20-Pin, 8-bit Flash LIN/J2602 Microcontroller
PIC16F1829LIN
5.3 PORTC Registers
PORTC is an 8-bit wide, bidirectional port. It functions
the same as described in the “PIC16(L)F1825/1829
Data Sheet” (DS41440) with the following differences:
• One bit is dedicated to the LIN transceiver and
one bit is not available. No pins are associated
with this function. Only RC<5:0> are available on
pins. The corresponding data direction register is
TRISC. The TRISC bits must be set as ‘1xxx
xxxx’.
• The PORTC Data Latch register (LATC) is also
memory mapped. Read-modify-write operations
on the LATC register read and write the latched
output value for PORTC.
Note:
On a Power-on Reset, RC<7:6> and
RC<3:0> are configured as analog inputs
and read as ‘0’.
EXAMPLE 5-2: INITIALIZING PORTC
banksel PORTC
CLRF PORTC
banksel LATC
CLRF LATC
banksel TRISC
MOVLW 0FFh
; Initialize PORTC by
; clearing output
; data latches
; Alternate method
; to clear output
; data latches
; Value used to
; initialize data
; direction
5.3.1 ANSELC REGISTER
The ANSELC register (Register 5-12) is used to
configure the Input mode of an I/O pin to analog.
Setting the appropriate ANSELC 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 ANSELC bits has no effect on digital
output functions. A pin with TRIS clear and ANSELC 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 ANSELC bits default to the Analog
mode after Reset. To use any pins as
digital general purpose or peripheral
inputs, the corresponding ANSEL bits
must be initialized to ‘0’ by user software.
5.3.2
PORTC FUNCTIONS AND OUTPUT
PRIORITIES
Each PORTC pin is multiplexed with other functions. The
pins, their combined functions and their output priorities
are briefly described here. For additional information,
please refer to Table 1-1 and Table 1-2.
When multiple outputs are enabled, the actual pin
control goes to the peripheral with the lowest number in
the following lists.
Analog input and some digital input functions are not
included in the list below (see Table 5-2). These input
functions can remain active when the pin is configured
as an output. Certain digital input functions override
other port functions and are included in the priority list.
TABLE 5-2: PORTC OUTPUT PRIORITY
Pin Name
Function Priority(1)
RC0
RC1
RC2
RC3
P1D(2)
P1C(2)
P1D(2)
P2B(2)
CCP2(2)
P1C(2)
P2A(2)
RC4
MDOUT
SRNQ
C2OUT
P1B
RC5
RC6(3)
RC7(3)
CCP1/P1A
Not available
PWRGD
Note 1:
2:
3:
Priority listed from highest to lowest.
Pin function is selectable via the APFCON0 or
APFCON1 register.
RC6 is not available to a pin. RC7 is internally
connected to the PWRGD signal from the LIN
transceiver.
DS41673A-page 44
Preliminary
 2012 Microchip Technology Inc.