Electronic Components Datasheet Search
  New Zealand  ▼
ALLDATASHEET.CO.NZ

X  

PIC24FJ128GA310 Datasheet(PDF) 177 Page - Microchip Technology

Part # PIC24FJ128GA310
Description  64/80/100-Pin, General Purpose, 16-Bit Flash Microcontrollers with LCD Controller and nanoWatt XLP Technology
PDF  406 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  MICROCHIP [Microchip Technology]
Direct Link  http://www.microchip.com
Logo MICROCHIP - Microchip Technology

PIC24FJ128GA310 Datasheet(HTML) 177 Page - Microchip Technology

Back Button PIC24FJ128GA310 Datasheet HTML 173Page - Microchip Technology PIC24FJ128GA310 Datasheet HTML 174Page - Microchip Technology PIC24FJ128GA310 Datasheet HTML 175Page - Microchip Technology PIC24FJ128GA310 Datasheet HTML 176Page - Microchip Technology PIC24FJ128GA310 Datasheet HTML 177Page - Microchip Technology PIC24FJ128GA310 Datasheet HTML 178Page - Microchip Technology PIC24FJ128GA310 Datasheet HTML 179Page - Microchip Technology PIC24FJ128GA310 Datasheet HTML 180Page - Microchip Technology PIC24FJ128GA310 Datasheet HTML 181Page - Microchip Technology Next Button
Zoom Inzoom in Zoom Outzoom out
 177 / 406 page
background image
 2010-2011 Microchip Technology Inc.
DS39996F-page 177
PIC24FJ128GA310 FAMILY
11.4.5
CONSIDERATIONS FOR
PERIPHERAL PIN SELECTION
The ability to control Peripheral Pin Selection intro-
duces several considerations into application design
that could be overlooked. This is particularly true for
several common peripherals that are available only as
remappable peripherals.
The main consideration is that the Peripheral Pin
Selects are not available on default pins in the device’s
default (Reset) state. Since all RPINRx registers reset
to ‘111111’ and all RPORx registers reset to ‘000000’,
all Peripheral Pin Select inputs are tied to VSS and all
Peripheral Pin Select outputs are disconnected.
This situation requires the user to initialize the device
with the proper peripheral configuration before any
other application code is executed. Since the IOLOCK
bit resets in the unlocked state, it is not necessary to
execute the unlock sequence after the device has
come out of Reset. For application safety, however, it is
best to set IOLOCK and lock the configuration after
writing to the control registers.
Because the unlock sequence is timing-critical, it must
be executed as an assembly language routine in the
same manner as changes to the oscillator configura-
tion. If the bulk of the application is written in ‘C’, or
another high-level language, the unlock sequence
should be performed by writing in-line assembly.
Choosing the configuration requires the review of all
Peripheral Pin Selects and their pin assignments,
especially those that will not be used in the application.
In all cases, unused pin-selectable peripherals should
be disabled completely. Unused peripherals should
have their inputs assigned to an unused RPn/RPIn 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 con-
figuration, or inside the main application routine)
depends on the peripheral and its use in the application.
A final consideration is that Peripheral Pin Select func-
tions neither override analog inputs nor reconfigure
pins with analog functions for digital I/O. If a pin is
configured as an analog input on device Reset, it must
be explicitly reconfigured as digital I/O when used with
a Peripheral Pin Select.
Example 11-3 shows a configuration for bidirectional
communication with flow control using UART1. The
following input and output functions are used:
• Input Functions: U1RX, U1CTS
• Output Functions: U1TX, U1RTS
EXAMPLE 11-3:
CONFIGURING UART1
INPUT AND OUTPUT
FUNCTIONS
Note:
In tying Peripheral Pin Select inputs to
RP63, RP63 need not exist on a device for
the registers to be reset to it.
// Unlock Registers
asm volatile(
"MOV
#OSCCON,
w1
\n"
"MOV
#0x46,
w2
\n"
"MOV
#0x57,
w3
\n"
"MOV.b
w2,
[w1] \n"
"MOV.b
w3,
[w1] \n"
"BCLR OSCCON,#6") ;
// or use C30 built-in macro:
// __builtin_write_OSCCONL(OSCCON & 0xbf);
// Configure Input Functions (
Table 11-2))
// Assign U1RX To Pin RP0
RPINR18bits.U1RXR = 0;
// Assign U1CTS To Pin RP1
RPINR18bits.U1CTSR = 1;
// Configure Output Functions (
Table 11-4)
// Assign U1TX To Pin RP2
RPOR1bits.RP2R = 3;
// Assign U1RTS To Pin RP3
RPOR1bits.RP3R = 4;
// Lock Registers
asm volatile
("MOV
#OSCCON,
w1
\n"
"MOV
#0x46,
w2
\n"
"MOV
#0x57,
w3
\n"
"MOV.b
w2,
[w1]\n"
"MOV.b
w3,
[w1]\n"
"BSET
OSCCON,
#6" ;
// or use C30 built-in macro:
// __builtin_write_OSCCONL(OSCCON | 0x40);



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100  ...More


Datasheet Download

Go To PDF Page


Link URL



Does ALLDATASHEET help your business so far?  [ DONATE ] 

About Alldatasheet   |   Advertisement   |   Contact us   |   Privacy Policy   |   Link to Datasheet    |   Link Exchange   |   Manufacturer List
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com