Parallel Master Port

24
National Yunlin University of Science and Technology Parallel Master Port (PMP) 04/12 蔡蔡蔡

Transcript of Parallel Master Port

National Yunlin University of Science and Technology

Parallel Master Port(PMP)04/12

蔡宗穎

何謂 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.( 圖一 )

圖一

PMP MODULE OVERVIEW

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).

Legacy PSP Mode

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

從圖表找出對應的位置

解說• A380 轉成二進位 1010 0011 1000 0000• 200 轉成二進位 10 0000 0000 • FF 轉成二進位 1111 1111

PSP EXAMPLE

• PSP 程式中開啟 .LIST 的檔案• 如 :• setup_pmp(PAR_ENABLE|PAR_STOP_IN_IDLE|

PAR_CS_00|PAR_PTRDEN_ENABLE|PAR_PTWREN_ENABLE , 0x40FF);

顯示出• 003BE: MOV #A380,W4• 003C0: MOV W4,600• 003C2: CLR 602• 003C4: MOV #40FF,W4• 003C6: MOV W4,60C

Goals

• 找出互相對應的腳位,並且啟動功能就可以進行傳輸的目的。