No chance for errors when CS tied to ground then?
Not really, even the datasheet says you can tie CS to ground.
The real reason you might want to use a separate CS pin, is if you wanted to use the same microcontroller pins for something else too. When the display sees CS high, it ignores the data pins.
I am going for a tiled graphics processor, i hope the UART input will be fast enough for a simple game.
You should be able to use 2Mbaud for example; that translates to 200,000 bytes per second. Even higher baud rates are possible too.
Or you can use SPI at say 25 MHz; that translates to 3,125,000 bytes per second.
I was reading this PIC32 datasheet and read about the : Parallel Master Port, i wonder how it can help me ?
The Parallel Master Port documentation for PIC32 microcontrollers is
here.
The 28-pin PIC32MX170F256B has 8 PMP data pins, and 2 address pins.
The 44-pin PIC32MX170F256D has 8 PMP data pins, and 10 address pins.
The 64-pin PIC32MZ1024EFG064 has 8 PMP data pins, and 16 address pins.
The 100-pin PIC32MZ1024EFG100 has 16 PMP data pins, and 16 address pins.
I have looked at the PMP, but I don't see any way the address pins are useful here.
When reading from or writing data via the PMP, it can do the RD/WR strobe. However, the 28/44/64-pin chips have only 8 PMP data pins, so it can only be used in 8-bit parallel mode; you'd need the 100-pin PIC32MZ to have 9 or 16 parallel bits.
On 28-pin PIC32MX170F256B, the PMP data pins are 20,19,18,15,14,13,12,11, read strobe is pin 21, and write strobe is pin 22.
On 44-pin PIC32MX170F256D, the PMP data pins are 10,9,8,1,44,43,42,41, read strobe is pin 11, and write strobe is pin 14.
On 64-pin PIC32MZ1024EFG-064, the PMP data pins are 58,61,62,63,64,1,2,3, read strobe is pin 53, and write strobe is pin 52.
On 100-pin PIC32MZ1024EFG-100, the PMP data pins are 91,94,98,99,100,3,4,5, 88,87,86,85,79,80,77,78, read strobe is pin 9, and write strobe is pin 8.
Look at figures 13-16 and 13-17 on page 34 to see the timing outline. (The RD/WR strobes would be inverted for display communications, but that is just a register value change.) The timing is somewhat restricted, as the peripheral bus clock is the system clock SYSCLK, SYSCLK/2, SYSCLK/4, or SYSCLK/8. For the ILI9341,
B≃t
ast can be zero,
M≃t
wrl is 15ns or longer, and
E≃t
wrh is 15ns or longer; the repeated process must take 66ns or longer.
If you run at 50 MHz (maximum for PIC32MX170F256), using PBCLK=SYSCLK gives a 50MHz peripheral clock, with each cycle taking 1000/50MHz = 20ns. Using 1 cycle for
B, 2 cycles for
M, and 1 cycle for
E should work. (Remember, the total cycle must take at least 66ns for ILI4988.)
If you run at 200 MHz (maximum for PIC32MZ1024), the maximum peripheral clock is 100 MHz (PBCLK=SYSCLK/2). Then, each cycle takes 10ns, and we could use 1 cycle for
B, 4 cycles for
M, and 2 cycles for
E should work. (1/3/2 might also work, perhaps even 1/2/2, depending on how the PIC32 feeds the data to the PMP; there is bound to be some latency there too.)
DMA to the PMP (data register) is supported, and not very complicated.
My worry is that since this is a separate module in PIC32, there are internal wait states, making the timing a bit of a trial-and-error thing. One must examine the generated pulse trains and their timing with an oscilloscope. I only have an Analog Discovery 2, which has at best 30 MHz bandwidth, and really isn't sufficient for this. An oscilloscope with 100MHz or 200MHz bandwidth scope, even a DS1054Z, would help a lot.
If instead of PMP, on PIC32MX170F256, you use GPIO port B, you can have up to 16 bits in parallel. While there is no direct hardware support for generating the write strobe, or time the DMA transfers, I believe one can work around that by using additional two pins, one of which is an interrupt pin. The interrupt pin triggers at falling edge, causing the DMA to set the port B data. At its rising edge, the display will latch that data. So, the interrupt pin, an input, is essentially the WR strobe to the display then, but also the DMA trigger. To generate the 1000MHz/66ns ≃ 15 MHz signal needed, I was thinking of using a SPI clock pin, because the PIC32MX170F256 have two SPIs. Then, another DMA channel can feed dummy data to generate the desired number of sets of 8 pulses. Alternatively, a SPI data pin could be used to generate a non-50%-50% pulse train. I don't like the idea of using PWM for this, because the exact number of pulses generated is relatively important; the display will see extra "garbage" data if we send more pulses than we have DMA data for.
So, in summary, the PMP can generate the wait states and write strobes for you, although the timing might take a bit of work to get right. It is quite useful with DMA, if it has sufficient data bits for you.
Because
I want to play with 9-bit parallel transfers, I'd have to use either the 100-pin PIC32MZ for PMP, or use GPIO port B on PIC32MX170F256B/D or PIC32MZ1024EFG064. I prefer the latter, that's all.