English
Language : 

PIC32MX440F256H-80I Datasheet, PDF (461/646 Pages) Microchip Technology – 64/100-Pin General Purpose and USB 32-Bit Flash Microcontrollers
20.3.6 SLAVE MODE
20.3.6.1 Considerations for Slave Mode
• Do not enable or disable the module during any
read or write operation
• Because of the asynchronous nature of the read
and write operations, it is highly recommended
that the user rely on the PSP status bits prior to
any read or write operation.
The PMP module provides 8-bit (byte) legacy Parallel
Slave Port functionality as well as new Buffered and
Addressable Slave modes.
20.3.7 MODE SELECTION
The three Master modes are selected using
MODE<1:0> bits (PMCON<9:8>). Legacy Slave mode
is selected by configuring MODE<1:0> bits = 00; Buff-
ered and Addressable Slave modes are selected by
configuring MODE<1:0> = 01. Additionally, Buffered
Slave mode requires bits INCM<1:0>
(PMMODE<12:11>) = 11.
TABLE 20-8: Slave Mode Selection
Slave Mode
PMCON
MODE<1:0>
PMMODE
INCM<1:0>
Legacy
00
Buffered
00
Addressable
01
x = don’t care
11
x = don’t care
All Slave modes support 8-bit data only and the associ-
ated module control pins are automatically dedicated to
the module when any of these modes are selected. The
user only need to configure the polarity of the PMCS1,
PMRD and PMWR signals.
TABLE 20-9: Slave Mode Pin Polarity
Configuration
CONTROL PMCON Active-High Active-Low
PIN Control Bit Select
Select
PMRD
RDSP
1
0
PMWR
WRSP
1
0
PMCS1
CS1P
1
0
20.3.8 LEGACY PARALLEL SLAVE MODE
In Legacy Slave mode, an external device can asyn-
chronously read and write data using the 8-bit data
bus PMD<7:0>, the read PMRD, write PMWR, and
chip-select PMCS1 inputs.
PIC32MX3XX/4XX
Figure 20-8: Legacy Slave Mode Interface
Master
D<7:0>
CS
RD
WR
PIC32MX3XX/4XX
Slave
PMD<7:0>
PMCS1
PMRD
PMWR
20.3.9 LEGACY SLAVE CONFIGURATION
The Legacy Slave mode configuration is determined
automatically and dedicated to the PSP module when
the Legacy Slave mode is selected. The user only need
to configure the polarity of the PMCS1, PMRD and
PMWR signals.
The following example illustrates which control bits are
to be set for Legacy Slave mode configuration:
• Configure Legacy Slave mode bits -
MODE<1:0> (PMMODE<9:8>) = 00
• Select PMRD “active-low” pin polarity -
RDSP (PMCON<0>) = 0.
• Select PMWR “active-low” pin polarity -
WRSP (PMCON<1>) = 0.
• Select PMCS2, PMCS1 “active-low” pin polarity -
CS2P (PMCON<4>) = 0 and CS1P
(PMCON<3>) = 0.
20.3.10 SLAVE PORT INITIALIZATION
The Legacy Slave mode initialization properly prepares
the PMP port for communicating with an external mas-
ter device.
1. If interrupts are used, disable the PMP interrupt
by clearing the interrupt enable bit PMPIE
(IEC1<2>) = 0.
2. Stop and reset the PMP module by clearing the
control bit ON (PMCON<15>) = 0.
3. Configure the desired settings in the PMCON
and PMMODE control registers.
4. If interrupts are used:
a) Clear interrupt flag bit PMPIF
(IFS1<2>) = 0.
b) Configure the PMP interrupt priority bits
PMPIP<2:0> (IPC7<4:2>) and interrupt sub
priority bits PMPIS (IPC7<1:0>.
c) Enable PMP interrupt by setting interrupt
enable bit PMPIE = 1.
5. Enable the PMP slave port by setting control bit
ON = 1.
© 2008 Microchip Technology Inc.
Preliminary
DS61143E-page 459