How to use DMA for displaying data on ili9341 320x240 lcd through spi?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
AyKo_4382201
Level 2
Level 2
10 replies posted 5 replies posted 5 questions asked

Hi all,

I'm using CYBLE-416045-02 mcu and in my application I'm displaying output in ili9341 320x240 lcd using Spi. But due to other tasks data transfer speed is not enough.

Hence we decided to use Dma peripheral to flush the  data into to lcd through spi. But I dont know how should I manage the cmd/data pin of the lcd as this pin needs to be clear for sending command byte and set when sending data bytes. So my question is how to solve this problem and please provide me an sample project if you have where lcd is getting driven using Dma through spi.

Thankyou

0 Likes
1 Solution
BragadeeshV
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hi AyKo_4382201​,

We don't have a sample project as per your request but this is possible. For initiating a SPI transfer you can do the following:

1. Set or clear DC pin using firmware appropriately based on if it is command or data.

2. Set up the source and destination of the DMA transfer.

3. Enable the Tx Channel DMA to trigger the DMA.

DMA is typically triggered using the TX FIFO level of the SPI.

You can refer the code example for SPI master - DMA  :

PSoC Creator:  https://www.cypress.com/documentation/code-examples/ce221120-psoc-6-mcu-spi-master

ModusToolbox 2.x : GitHub - cypresssemiconductorco/mtb-example-psoc6-spi-master-dma: This example demonstrates the use ...

Would it be possible for you to evaluate the performance of parallel interface using Segger emWin Graphics library?

GitHub - cypresssemiconductorco/emwin: Segger emWin graphics library for PSoC 6 MCU devices

Regards.

Bragadeesh

Regards,
Bragadeesh

View solution in original post

0 Likes
3 Replies
BragadeeshV
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hi AyKo_4382201​,

We don't have a sample project as per your request but this is possible. For initiating a SPI transfer you can do the following:

1. Set or clear DC pin using firmware appropriately based on if it is command or data.

2. Set up the source and destination of the DMA transfer.

3. Enable the Tx Channel DMA to trigger the DMA.

DMA is typically triggered using the TX FIFO level of the SPI.

You can refer the code example for SPI master - DMA  :

PSoC Creator:  https://www.cypress.com/documentation/code-examples/ce221120-psoc-6-mcu-spi-master

ModusToolbox 2.x : GitHub - cypresssemiconductorco/mtb-example-psoc6-spi-master-dma: This example demonstrates the use ...

Would it be possible for you to evaluate the performance of parallel interface using Segger emWin Graphics library?

GitHub - cypresssemiconductorco/emwin: Segger emWin graphics library for PSoC 6 MCU devices

Regards.

Bragadeesh

Regards,
Bragadeesh
0 Likes

Hi,

I know we have to set or clear cmd/data pin based on if it is command or data, but that requires cpu intervention. And we are using Dma so that we can just fill a buffer and start the Dma so that cpu is free to do other tasks.

0 Likes

You can offload the CPU while performing the SPI transfer, example transferring 1 KB data without intervention. CPU has to be used for setting the cmd/ data pin.

Regards,

Bragadeesh

Regards,
Bragadeesh
0 Likes