2 Byte (16 bit) data transfer using DMA to SPIM on Psoc 5 problem

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.
Anonymous
Not applicable

Hi

I am trying to config my DMA to send my buffer to SPIM.

I configured my DMA and SPIM.

They work with standard 8 it data transfer but do not work with 16 bit config.

would you please take a look at my code and let me know where is the problem.

I already tried both uint8 and uint16 for my buffer definition.

non of them work.

Regards

0 Likes
1 Solution

Hello ,

What I meant is to use SPIM_BSPIM_sR16_Dp_u0__16BIT_F0_REG  as destination register instead of SPI_TXDATA_PTR. Yes, the SPI_TXDATA_PTR is not defined as SPIM_BSPIM_sR16_Dp_u0__16BIT_F0_REG for PSoC3/5LP. However you can use the register SPIM_BSPIM_sR16_Dp_u0__16BIT_F0_REG as the destination register as given in the following snippet.

/* From the memory to the SPIM */

    CyDmaTdSetAddress(txTD, LO16((uint32)txBuffer), LO16((uint32) SPIM_BSPIM_sR16_Dp_u0__16BIT_F0_REG));

Please try this.

Thanks,

Hima

View solution in original post

7 Replies
AnkitaS_51
Employee
Employee
100 likes received 50 likes received 25 likes received

DMA_TX_BYTES_PER_BURST is having a value 2u, thus have you tried changing the BUFFER_SIZE to 16

0 Likes
Anonymous
Not applicable

Hi

Yes, I did, but still it does not work.

0 Likes

Hello,

Can you use the destination address pointer as SPIM_BSPIM_sR16_Dp_u0__16BIT_F0_REG instead of SPIM_TXDATA_PTR.

Thanks,

Hima

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

I'm trying to do the same but i can't get the SPI to transfer anything, i checked changing SPI_TXDATA_PTR with SPI_BSPIM_sR16_Dp_u0__16BIT_F0_REG and still nothing (SPI_TX_DATA_PTR is defined as SPI_BSPIM_sR16_Dp_u0__16BIT_F0_REG when configuring the SPI to transfer 16bits words anyway), attached is my test project, i got this working with 8bit words but still can't make it work with 16bit.

Regards

0 Likes

Hello ,

What I meant is to use SPIM_BSPIM_sR16_Dp_u0__16BIT_F0_REG  as destination register instead of SPI_TXDATA_PTR. Yes, the SPI_TXDATA_PTR is not defined as SPIM_BSPIM_sR16_Dp_u0__16BIT_F0_REG for PSoC3/5LP. However you can use the register SPIM_BSPIM_sR16_Dp_u0__16BIT_F0_REG as the destination register as given in the following snippet.

/* From the memory to the SPIM */

    CyDmaTdSetAddress(txTD, LO16((uint32)txBuffer), LO16((uint32) SPIM_BSPIM_sR16_Dp_u0__16BIT_F0_REG));

Please try this.

Thanks,

Hima

lock attach
Attachments are accessible only for community members.

Hi,

I might be doing something silly but i'm still unable to make it work, the project so far is attached, updated to Creator 4.2.

Regards

lock attach
Attachments are accessible only for community members.
cadi_1014291
Level 6
Level 6
25 likes received 10 likes received 10 likes given

Got it working, i had to change also the SPI_RXDATA_PTR to SPI_BSPIM_sR16_Dp_u0__16BIT_F1_REG, find the project attachedpastedImage_0.png