How to make it work when CyU3PSpiSetConfig() called repeatedly to change the settings?

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

cross mob
cumac_1314066
Level 1
Level 1

How to make it work when CyU3PSpiSetConfig() called repeatedly to change the settings?

the example code as the following, but it not work.

example code:

CyU3PSpiConfig_t spiConfig;

spiConfig.wordLen    = 10;

CyU3PSpiSetConfig (&spiConfig, NULL);

CyU3PSpiSetSsnLine (CyFalse);

CyU3PSpiTransmitWords (addr, addrbytecnt);

spiConfig.wordLen    = 8;

CyU3PSpiSetConfig (&spiConfig, NULL);

CyU3PSpiTransmitWords (data, DataByteCount);

CyU3PSpiSetSsnLine (CyTrue);

0 Likes
1 Solution

Hi,

Yes it is possible to change SPI configurations dynamically. PFA firmware which is used to change the SPI config wordlength using control center. You have to send the vendor command and use wIndex field to set the desired wordlength. Changes will be highlighted in the debug prints.

Thanks & Regards
Abhinav

View solution in original post

0 Likes
6 Replies
abhinavg_21
Moderator
Moderator
Moderator
50 likes received 25 likes received 10 likes received

Hi,

Which transfer mode are you using.

If the DMA mode is used, the DMA channel(s) need to be reset after each fresh CyU3PSpiSetConfig API

call.

Please refer to the FX3API Guide section 5.32.4.7 for further reference.

Thanks & Regards

Abhinav

0 Likes

Hi,

using SPI reg mode.

How to do for SPI reg mode to fresh CyU3PSpiSetConfig API call?

0 Likes

Hi,

Are you able to change the SPI configuration for the first time. I tried and changed the clock, it worked fine. I am sending the vendor command in which I am calling SpiInit2(), which is re-configuring the Spi clock.

I am attaching the firmware, you can take it as reference.

Thanks & Regards

Abhinav

0 Likes

Hi Abhinav,

It's not work when call the CyU3PSpiSetConfig() repeatedly to change the SPI word length in a function call.

Could you provide the example code for changing different SPI Word length dynamically?

0 Likes

Hi, Abhinav,

Any update?

Is the FX3 HW SPI not support for changing different SPI Word length in the SSL active interval dynamically?

0 Likes

Hi,

Yes it is possible to change SPI configurations dynamically. PFA firmware which is used to change the SPI config wordlength using control center. You have to send the vendor command and use wIndex field to set the desired wordlength. Changes will be highlighted in the debug prints.

Thanks & Regards
Abhinav

0 Likes