PIC18F25J50 MICROCHIP [Microchip Technology], PIC18F25J50 Datasheet - Page 154

no-image

PIC18F25J50

Manufacturer Part Number
PIC18F25J50
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:
PIC18F25J50-I/SO
Manufacturer:
MICROCHIP
Quantity:
1 001
Part Number:
PIC18F25J50-I/SP
Manufacturer:
MICROCHIP
Quantity:
1 001
Part Number:
PIC18F25J50-I/SS
Manufacturer:
MICROCHIP
Quantity:
1 001
Part Number:
PIC18F25J50T-I/SO
Manufacturer:
MICROCHIP
Quantity:
1 001
Part Number:
PIC18F25J50T-I/SS
Manufacturer:
MICROCHIP
Quantity:
1 001
PIC18F46J50 FAMILY
Choosing the configuration requires the review of all
PPSs and their pin assignments, especially those that
will not be used in the application. In all cases, unused
pin-selectable peripherals should be disabled com-
pletely. Unused peripherals should have their inputs
assigned to an unused RPn pin function. I/O pins with
unused RPn functions should be configured with the
NULL peripheral output.
The assignment of a peripheral to a particular pin does
not automatically perform any other configuration of the
pin’s I/O circuitry. In theory, this means adding a pin-
selectable output to a pin may mean inadvertently
driving an existing peripheral input when the output is
driven. Users must be familiar with the behavior of
other fixed peripherals that share a remappable pin and
know when to enable or disable them. To be safe, fixed
digital peripherals that share the same pin should be
disabled when not in use.
Along these lines, configuring a remappable pin for a
specific peripheral does not automatically turn that
feature on. The peripheral must be specifically config-
ured for operation and enabled, as if it were tied to a
fixed pin. Where this happens in the application code
(immediately following device Reset and peripheral
configuration or inside the main application routine)
depends on the peripheral and its use in the
application.
A final consideration is that the PPS functions neither
override analog inputs nor reconfigure pins with analog
functions for digital I/O. If a pin is configured as an
analog input on a device Reset, it must be explicitly
reconfigured as a digital I/O when used with a PPS.
Example 10-7
communication with flow control using EUSART2. The
following input and output functions are used:
• Input Function RX2
• Output Function TX2
DS39931D-page 154
provides a configuration for bidirectional
EXAMPLE 10-7:
;*************************************
; Unlock Registers
;*************************************
MOVLB 0x0E
BCF
MOVLW 0x55
MOVWF EECON2, 0
MOVLW 0xAA
MOVWF EECON2, 0
BCF
;***************************
; Configure Input Functions
; (See Table 9-13)
;***************************
MOVLW 0x00
MOVWF RPINR16, BANKED
;***************************
; Configure Output Functions
; (See Table 9-14)
;***************************
MOVLW 0x05
MOVWF RPOR1, BANKED
;*************************************
; Lock Registers
;*************************************
MOVLW 0x55
MOVWF EECON2, 0
MOVLW 0xAA
MOVWF EECON2, 0
; Write Protect PPS (if desired)
BSF
Note:
;***************************
; Assign RX2 To Pin RP0
;***************************
;***************************
; Assign TX2 To Pin RP1
;***************************
INTCON, GIE
PPSCON, IOLOCK, BANKED
PPSCON, IOLOCK, BANKED
If the Configuration bit, IOL1WAY = 1,
once the IOLOCK bit is set, it cannot be
cleared, preventing any future RP register
changes. The IOLOCK bit is cleared back
to ‘0’ on any device Reset.
CONFIGURING EUSART2
INPUT AND OUTPUT
FUNCTIONS
 2011 Microchip Technology Inc.
; for unlock sequence
; PPS registers are in
BANK 14
; Disable interrupts
; Turn off PPS Write Protect

Related parts for PIC18F25J50