English
Language : 

PIC32MX440F256H-80I Datasheet, PDF (463/646 Pages) Microchip Technology – 64/100-Pin General Purpose and USB 32-Bit Flash Microcontrollers
PIC32MX3XX/4XX
20.3.13 BUFFERED SLAVE MODE
INITIALIZATION
The Buffered Slave mode initialization properly
prepares the PSP port for communicating with an
external master device.
The following steps should be performed to properly
configure the PSP port:
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 PSP interrupt by setting interrupt
enable bit PMPIE = 1.
5. Enable the PMP slave port by setting control bit
ON = 1.
EXAMPLE 20-5: BUFFERED PARALLEL SLAVE MODE INITIALIZATION
IEC1CLR = 0x0004
//Disable PMP
PMCON = 0x0000
//Stop and Configure
PMMODE = 0x1800
//Configure PMMODE
IPC7SET = 0x001C;
//Priority level=7
IPC7SET = 0x0003;
IFS1CLR = 0x0004;
//subpriority=3
//Same as...
//IPC7SET=0x001F
//Clear PMP flag
IEC1SET = 0x0004;
//Enable PMP int
PMCONSET = 0x8000;
//Enable PMP
© 2008 Microchip Technology Inc.
Preliminary
DS61143E-page 461