SPI transfer with a KL03

キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

SPI transfer with a KL03

ソリューションへジャンプ
690件の閲覧回数
javierhernande1
Contributor IV

Hello,

I need to perform a SPI communication with a slave device with a KL03 mcu.

I need to adjust 3 register.

First step is programming 0xF register as 0x000000 for reset, the delay 300ms.

Second step is programming 0x1 register as 0x45E15 then delay 30ms

Last step is programming 0x3 register as 0x0FFDC

I need to perform 3 txTranfers? or is possible in one transfer?

And, Is there any function to wait on ms?

Best regards

printf("\n\r SPI Master Start...\n\r");
 /*
 * userConfig.enableStopInWaitMode = false;
 * userConfig.polarity = kSPI_ClockPolarityActiveHigh;
 * userConfig.phase = kSPI_ClockPhaseFirstEdge;
 * userConfig.direction = kSPI_MsbFirst;
 * userConfig.dataMode = kSPI_8BitMode;
 * userConfig.txWatermark = kSPI_TxFifoOneHalfEmpty;
 * userConfig.rxWatermark = kSPI_RxFifoOneHalfFull;
 * userConfig.pinMode = kSPI_PinModeNormal;
 * userConfig.outputMode = kSPI_SlaveSelectAutomaticOutput;
 * userConfig.baudRate_Bps = 500000U;
 */
 SPI_MasterGetDefaultConfig(&userConfig);
 srcFreq = SPI_MASTER_CLK_FREQ;
 SPI_MasterInit(SPI_MASTER, &userConfig, srcFreq);
/* Init Buffer*/
 for (i = 0; i < BUFFER_SPI; i++)
 {
 srcBuff[i] = i;
 }
/*Start Transfer*/
 xfer.txData = srcBuff;
 xfer.dataSize = BUFFER_SIZE;
 SPI_MasterTransferBlocking(SPI_MASTER, &xfer);
ラベル(1)
1 解決策
536件の閲覧回数
nxf56274
NXP TechSupport
NXP TechSupport

Hi,

You can use "nop" to write a delay function by yourself. You should perform three transfers

Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

元の投稿で解決策を見る

1 返信
537件の閲覧回数
nxf56274
NXP TechSupport
NXP TechSupport

Hi,

You can use "nop" to write a delay function by yourself. You should perform three transfers

Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------