What's the difference between SpiDataWidth and SpiEEMaxLenght

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

What's the difference between SpiDataWidth and SpiEEMaxLenght

跳至解决方案
8,179 次查看
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,961 次查看
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,159 次查看
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,056 次查看
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,962 次查看
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 项奖励
回复