How to transfer 2D array data to SPIM

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

cross mob
lock attach
Attachments are accessible only for community members.
YaIs_283501
Level 3
Level 3
First like given

I created a sample program that transfers data of two-dimensional array to SPIM, but I have not performed the assumed operation.

2 bytes of data is transferred when setting the following to transfer 1 byte.

/* Step3 :CyDmaTdSetConfiguration - Configures the TD: */

CyDmaTdSetConfiguration(DMA_TD[0], 1 , DMA_TD[0] , DMA_TX_M__TD_TERMOUT_EN | CY_DMA_TD_INC_SRC_ADR );

Transfer setting of data larger than 2 bytes operates as expected.

How can I fix it?

P.S.

I am trying the above thing because I am planning to make image data of the graphic LCD(LS027B7DH01A) operate with DMA.

Attach the operation waveform.

0000.JPG

0 Likes
1 Solution
0 Likes
4 Replies
EvPa_264126
Level 7
Level 7
500 replies posted 250 replies posted 100 likes received

can it be transmitted as one-dimensional?

uint8 *array;

.......

CyDmaTdSetConfiguration(DMA_TD[0], (HEIGHT*WIDTH) , DMA_TD[0] , DMA_TX_M__TD_TERMOUT_EN | CY_DMA_TD_INC_SRC_ADR );

CyDmaTdSetAddress(DMA_TD[0], LO16((uint32)&array[0]), LO16((uint32)SPIM_TXDATA_PTR)); 

.....

void main()

{

array = data_buf;

...............

0 Likes
lock attach
Attachments are accessible only for community members.

Thank you for your reply.

I transfered from a two-dimensional array to a one-dimensional array.

It is possible to transfer all data in both 2D array and 1D array without problems.

The problem is one byte of DMA transfer at a time.

Currently 1 byte transfer is made according to the following settings,

but 2 bytes are transferred at a time as shown in the attached picture.

CyDmaTdSetConfiguration(DMA_TD[0], 1 , DMA_TD[0] , DMA_TX_M__TD_TERMOUT_EN | CY_DMA_TD_INC_SRC_ADR );

0004.JPG

0 Likes

only picture
Test.png

0 Likes

Thank you for the analysis.

0 Likes