What's the difference between SpiDataWidth and SpiEEMaxLenght

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

What's the difference between SpiDataWidth and SpiEEMaxLenght

ソリューションへジャンプ
8,177件の閲覧回数
simon98
Contributor III

Hi NXP Team,

i'm developing a project using MBDT on S32K358 board.

I was wondering waht's the difference between SpiDataWidth and SpiEbMaxLenght when configuring the Spi peripheral.

 

Thanks,

Simon

0 件の賞賛
返信
1 解決策
7,959件の閲覧回数
VaneB
NXP TechSupport
NXP TechSupport

Hi @simon98 

In the transmission I made, I set SpiDataWidth to 8 bits, which matches the size of each data element I am transmitting. I also defined SpiEbMaxLength as 100, which represents the maximum number of data elements that can be transmitted in a single operation.

VaneB_0-1742837801906.png

Although I transmitted an array of 10 data elements, each 8 bits wide, since SpiEbMaxLength was set to 100, I have the capacity to transmit up to that limit. In this case, since I only sent 10 data elements, we did not reach the maximum allowed, but if necessary, I could transmit up to 100 data elements in a single operation without any issues.

元の投稿で解決策を見る

0 件の賞賛
返信
3 返答(返信)
8,157件の閲覧回数
VaneB
NXP TechSupport
NXP TechSupport

Hi @simon98 

The SpiDataWidth parameter represents the frame size in terms of the number of bits. For MCAL, the maximum frame size is 64 bits, as it is designed to be compliant with AUTOSAR 4.7, according to the "Specification of SPI Handler/Driver" documentation provided by AUTOSAR.

The SpiEbMaxLength refers to the maximum number of data elements that can be stored in the external buffer.

 

BR, VaneB

0 件の賞賛
返信
8,054件の閲覧回数
simon98
Contributor III
Hi VaneB,

I've tried to send a 3 byte data buffer setting up a data store memory of 3 elements uint8 on MBDT.
I've configured the SpiDataWidth = 8 and SpiEbMaxLength = 1000 (as the MBDT spi example):

I've found out that it transmit corrrectly a frame with 3 bytes... So i'm a bit confused over the real purpose of these two configuration parameters...

For example if i need to send a frame with 3 byte of data, a possible configurations that would come to mind could be

SpiDataWidth = 24
SpiEbMaxLength = 3

but i don't understand why it works even with the example configuration.

Could you explane me with a practical example how these works?

Thanks,
Simon
0 件の賞賛
返信
7,960件の閲覧回数
VaneB
NXP TechSupport
NXP TechSupport

Hi @simon98 

In the transmission I made, I set SpiDataWidth to 8 bits, which matches the size of each data element I am transmitting. I also defined SpiEbMaxLength as 100, which represents the maximum number of data elements that can be transmitted in a single operation.

VaneB_0-1742837801906.png

Although I transmitted an array of 10 data elements, each 8 bits wide, since SpiEbMaxLength was set to 100, I have the capacity to transmit up to that limit. In this case, since I only sent 10 data elements, we did not reach the maximum allowed, but if necessary, I could transmit up to 100 data elements in a single operation without any issues.

0 件の賞賛
返信