Helpful ReplyPMP tutorial

Post
friesen
Super Member
2008/10/24 20:50:27
After some sweat and (almost) tears figuring out the pmp, I though I would leave some of what I learned, and leave this open for comments and corrections.

1.  The PMP is a module similar to the UART in that it is a separate module that runs by itself once set.

2.  The PMADDR register is similar to the LATx register in that a bit set to the PMADDR is a pin high or low.  This is in the case that the corresponding PMAEN bit is set to enable the pin.(Like the TRISx)

3.  The real purpose of the PMADDR is to drive the address lines of a memory chip, however it can be used for any purpose.

4.  Writing a byte to the PMIN1 is like writing a bit to the UART in that the module takes it from there and does what your configuration tells it to do.

5.  The PIC32 reference here http://ww1.microchip.com/downloads/en/DeviceDoc/61128D.pdf
actually has more general info than the pic24 data sheet.

6.  To drive a 6800 style interface,  use CS1 or CS2 to drive the RS line on the LCD and set the PMADDR to drive them.  Don't enable the chip select functions or this won't work.  Use the PMRD to drive the enable.

7.  Make sure to check the busy bit in the PMMODE register or you will walk all over unfinished business.

8.  You need to use the PMD0..7 lines to drive the data lines on the LCD.

9.  The WAITXX states are number of clock cycles delayed as defined in Figure 13-14: in the PMP reference.

10.  (Not sure about this)  The total clock cycles used by this module from start to finish will be 4 plus extra wait states defined.

11.  The IRQM register allows an interrupt to be generated at the end of the read/write cycle. 
DarioG
Scheisse Menschen
RE: PMP tutorial 2008/10/25 01:49:17
Thank you for this, Friesen!
poppy2008
Starting Member
RE: PMP tutorial 2008/11/18 20:40:55
thank you so much Friesen, nice information,
now i am working with exp16 dev board .lcd sample programs,and  cofused how to config the registers, after seeing this thread  i found the answer,once again thank you.
 
 
kuldeep
New Member
RE: PMP tutorial 2008/12/09 22:02:40
i have some  queries about PMP port,As you said it is like UART what is the speed of transfer means bus speed, i want to interface  tft controller to mcu with bus speed of 40Mhz and wait signal to tell MPU about its wait cycles (opposite signal on MPU required is READY) but i did not find any Ready signal on PMP port to extend read/write timings.
 
 
Kuldeep singh
friesen
Super Member
RE: PMP tutorial 2008/12/10 05:16:09
I am not sure I totally understand your question but you set the overall speed using the wait states set in pmmode.  I think you would have to create your own ready signal.  Really I think all this module is going to do is allow data to be sent plus the wait states all in the background, if you wish.
RISC
Super Member
RE: PMP tutorial 2008/12/10 16:03:34
Hi,

You may want to check the PIC24F code example showing how to drive LCD with the PMP I/F :
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=2656

More code examples here : http://www.microchip.com/codeexamples

regards
kuldeep
New Member
RE: PMP tutorial 2008/12/12 03:09:00
if i have to handle wait signal in software than what about read/write signals generated by pmp module as i have to extend read/write cycle till wait is present,more over i am unable to understand pmp advantage over normal i/os,is it only automatic read/write signal generation or else ?
 
kuldeep
friesen
Super Member
RE: PMP tutorial 2008/12/12 06:05:03
You can use the PMP two ways.  You can use it like a UART and load a byte during an interrupt or you can load it byte by byte.  The advantage is that the module is doing the work for you including the read/write strobe.  I don't really know exactly how many cycles you will save by using this module but I would say it is significant.  For example, if you have all wait states set to the max, the module will do all the waits and misc for you, which could be quite a few cycles, then set an interrupt when finished.  Either way when you figure out the overhead in getting the bytes to the module, you are ahead.

I think you misunderstand the wait states.  You program the wait states, and the module does as programmed.

I think microchip needs to rewrite the pic24 pmp manual.  It is similar to doing a crossword puzzle with half the clues.
kuldeep
New Member
RE: PMP tutorial 2008/12/13 00:27:03
 i do not misunderstood wait signal i am talking about hardware wait states if i made GPIO as ready signal and my tft controller apply wait to ready gpio of pic now i have to extend wr/rd signal till wait is there from tft controller,think about variable wait states as in real life fix wait states have no meaning at all, i am thinking the case of minimum waits or either zero wait sate and you are thinking totally on opposite end

kuldeep
post edited by kuldeep - 2008/12/13 00:32:03
friesen
Super Member
☄ Helpfulby Abraxas 2015/08/10 17:56:24
RE: PMP tutorial 2008/12/13 07:25:06
Which controller are you using?

When you write a byte to the module you can't do any more with it.  I am not sure what your lcd does and if it has a ready pin or something, but if that is the case, I don't think the pmp can directly detect something like that.  Most of my experience with lcd is with FSTN 128x64 modules.  I typically write to them with a small delay so I don't have to read their ready state.  I set up a buffer that I read out from in one loop.
kuldeep
New Member
RE: PMP tutorial 2008/12/14 22:02:21
I personally think so, it is not possible to interfere with pmp once it is set,the controller i am using s1d13513 from epson,mb86291 from fujitsu, first i was thinking about pic24 but now i realised it is not possible with pic24 due to less mips now i shifted to pic32
want to exploit pmp port of pics for this job but now,i have to change wiring plan i will use pmp  for latching address and data line and meanage wr/rd in software ,now the next question arises is it possible to latch 32bit address and 32bit data with two chipselects cs1 and cs2 each operating with demultiplexed 16bit address and 16bit data.
 
 
kuldeep
kuldeep
New Member
RE: PMP tutorial 2008/12/14 23:44:27
i think it is possible with cs1 and cs2 and 14pin address lines, 28bit  address  and 32bit data can be latched in 4 to 6cyles
rest will be done in software great........ why it did not come to my mind earlier
 
kuldeep
S123
New Member
Re: RE: PMP tutorial 2014/10/14 02:31:57
My problem is just about how to set values  1 or zero   to the control pins like CS1,CS2,EN using PMP module specifically. I does not respond as expected.
RISC
Super Member
Re: RE: PMP tutorial 2014/10/15 14:45:22
Hi,
Look at post #6. You'll find many examples which apply to EXPLORER16 for various PIC cores (PIC24F, dsPIC33F, dsPIC33EP..).
Explorer16 has a 2 line x 16 LCD module which is often driven using PMP in the code examples or application notes (sometimes the standard I/O ports are used).
Regards
karan123
Super Member
Re: RE: PMP tutorial 2016/04/17 18:49:45
Hello, 
 
This link may helpful for you . 
 

 
--
karan
post edited by karan123 - 2016/04/17 18:52:41
DarioG
Scheisse Menschen
Re: RE: PMP tutorial 2016/04/18 02:11:28
retry with your link Karan...