Hot!PMP of PIC32MX

Author
uestc14302017
New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2017/12/18 00:44:03
  • Location: 0
  • Status: offline
2018/06/12 19:41:28 (permalink)
0

PMP of PIC32MX

I was trying to use PMP of the device PIC32MX795F512 to access to peripherals,but there was not WR/RD signal generated when I called the WR/RD function,and I cannot enable PMCS2 , only PMCS1 works

here is my code of SFR configuration and WR/RD function;

SFR configuration:
PMCON = 0x878B;// Configure the addressing and polarities
PMMODE = 0x2E40;// Configure the mode
PMAEN = 0xFFFF;// Enable all address and Chip Select lines

WR/RD functions:
void PCLWR(uint16_t addr,uint16_t data)
{
PMADDR=addr;
PMDOUT=data;
}

uint16_t PCLRD(uint16_t addr)
{
uint16_t val;
PMADDR=addr;
val=PMDIN;
return val;
}
#1

2 Replies Related Threads

    aschen0866
    Super Member
    • Total Posts : 4355
    • Reward points : 0
    • Joined: 2006/01/08 22:18:32
    • Location: San Diego
    • Status: offline
    Re: PMP of PIC32MX 2018/06/13 10:52:08 (permalink)
    0
    uestc14302017
    I was trying to use PMP of the device PIC32MX795F512 to access to peripherals,but there was not WR/RD signal generated when I called the WR/RD function,and I cannot enable PMCS2 , only PMCS1 works

    here is my code of SFR configuration and WR/RD function;

    SFR configuration:
    PMCON = 0x878B;// Configure the addressing and polarities
    PMMODE = 0x2E40;// Configure the mode
    PMAEN = 0xFFFF;// Enable all address and Chip Select lines

    WR/RD functions:
    void PCLWR(uint16_t addr,uint16_t data)
    {
    PMADDR=addr;
    PMDOUT=data;
    }

    uint16_t PCLRD(uint16_t addr)
    {
    uint16_t val;
    PMADDR=addr;
    val=PMDIN;
    return val;
    }


    If you enable all 16 address lines, then you won't be able to use PMCS1(PMA14) and PMCS2(PMA15).  If this PIC32 is a PMP master, both read and write operations should be done through PMDIN not PMDOUT. In the master mode, it is a good idea to check the BUSY bit in PMMODE before writing to PMADDR and PMDIN.
    #2
    uestc14302017
    New Member
    • Total Posts : 5
    • Reward points : 0
    • Joined: 2017/12/18 00:44:03
    • Location: 0
    • Status: offline
    Re: PMP of PIC32MX 2018/06/13 20:52:21 (permalink)
    0
    aschen0866
    uestc14302017
    I was trying to use PMP of the device PIC32MX795F512 to access to peripherals,but there was not WR/RD signal generated when I called the WR/RD function,and I cannot enable PMCS2 , only PMCS1 works

    here is my code of SFR configuration and WR/RD function;

    SFR configuration:
    PMCON = 0x878B;// Configure the addressing and polarities
    PMMODE = 0x2E40;// Configure the mode
    PMAEN = 0xFFFF;// Enable all address and Chip Select lines

    WR/RD functions:
    void PCLWR(uint16_t addr,uint16_t data)
    {
    PMADDR=addr;
    PMDOUT=data;
    }

    uint16_t PCLRD(uint16_t addr)
    {
    uint16_t val;
    PMADDR=addr;
    val=PMDIN;
    return val;
    }


    If you enable all 16 address lines, then you won't be able to use PMCS1(PMA14) and PMCS2(PMA15).  If this PIC32 is a PMP master, both read and write operations should be done through PMDIN not PMDOUT. In the master mode, it is a good idea to check the BUSY bit in PMMODE before writing to PMADDR and PMDIN.




    You mean that I have to disable PMA15&PMA14(like this :PMAEN = 0x3FFF;) to use PMCS1&PMCS2?
    #3
    Jump to:
    © 2018 APG vNext Commercial Version 4.5