Parallel Master Port
Transcript of Parallel Master Port
何謂 PMP
• The Parallel Master Port (PMP) module is a parallel 8-bit I/O module, specifically designed to communicate with a wide variety of parallel devices, such as communication peripherals, LCDs, external memory devices and microcontrollers.( 圖一 )
PMCON Register
• A key bit is PMPEN, which is used to reset the module as well as enable or disable the module.
• When the module is disabled, all the associated I/O pins revert to their designated I/O function.( 圖二 )
PMMODE Register
• The Parallel Master Port Mode register contains bits that control the operational
modes of the module. Master/Slave mode selection, as well as configuration options for both modes, are set by this register.( 圖三 )
PMADDR Register
• In Master modes, the register functions as PMADDR.( 圖四 )
• the Parallel Port Address register It contains the address to which outgoing data is to be written to, as well as the chip select control
bits for addressing parallel slave devices.
PMAEN Register
• The Parallel Master Port Address Enable register controls the operation of address and chip select pins associated with this module.
• I/O or other peripheral modules associated with the pins.( 圖五 )
SLAVE PORT MODES
• 8-bit data bus• 2 address lines (Addressable mode only)• 3 control lines (read, write and chip select)• Selectable polarity on all control lines
• To use the PMP as a slave, the module must be enabled the mode must be set to one of the two possible Slave modes (PMMODE<9:8> = 01 or 00).
PMP Example
• PMP 程式中開啟 .LIST 的檔案• 如 :• setup_pmp(PAR_ENABLE|PAR_STOP_IN_IDLE|
PAR_CS_00|PAR_PTRDEN_ENABLE|PAR_PTWREN_ENABLE|PAR_MASTER_MODE_2, 0x00FF);
顯示出• 00248: MOV #A380,W4• 0024A: MOV W4,600• 0024C: MOV #200,W4• 0024E: MOV W4,602• 00250: MOV #FF,W4• 00252: MOV W4,60C
PSP EXAMPLE
• PSP 程式中開啟 .LIST 的檔案• 如 :• setup_pmp(PAR_ENABLE|PAR_STOP_IN_IDLE|
PAR_CS_00|PAR_PTRDEN_ENABLE|PAR_PTWREN_ENABLE , 0x40FF);