Skip to main content

SPI 9-bit mode

11 months ago

SPI 9-bit mode

Posted byFirefox200540 points 5 replies
0 upvotes

Hi,

is it possible to add prior bit to the actual 8-bit SPI mode for the slave to indicate if the byte has to be interpreted as data or command?

It would be nice if there is a sample application. I could not find any...

Best regards

11 months ago

PM_Dialog

嗨Firefox2005,

Could you please help us to understand what you want to accomplish? My apologies but it’s not clear for me what is your requirement.

Thanks , PM_Dialog

11 months ago

Firefox2005 40 points

Hi,

thanks for your reply.

Normal SPI operation/bitflow:

D7, D6, D5, D4, D3, D2, D1, D0

Custom SPI operation/bitflow:

Special Bit, D7, D6, D5, D4, D3, D2, D1, D0

So basically I just want to transfer 9 bit of data instead of 8 bit, but in SDK there is only described an 8, 16, 32 bit mode. D7 to D0 is the actual data which is transfered. The special bit should just indicate the slave if the data is a command byte or a data byte. The slave devices offers a normal "4-wire mode (SPI + Data/Command-GPIO) or a "3-wire mode" which saves the additional Data/Command-GPIO and includes the information of this GPIO in the additional bit which needs to be transmitted in the SPI stream when "3-wire" is selected.

If it is not clear I can share confidential information via E-Mail.

11 months ago

PM_Dialog

嗨Firefox2005,

Thanks for your detailed response. However, only 8, 16 or 32 bit mode is supported by the SDK.

Thanks, PM_Dialog

11 months ago

Firefox2005 40 points

There needs to be a solution. I think this is popular requirement for example when it comes to drive LCD displays. Would it be possible to bitbang the first additional bit into the data transfer?

11 months ago

PM_Dialog

嗨Firefox2005,

As mentioned in my previous comment only 8, 16 or 32 bit mode is supported by the SDK. Bitbanging the first additional bit into the data transfer, it might be possible but there isn’t any example or guideline for how to do it. It is also not supported in the SPI driver, so you should do your own implementation on this.

Thanks, PM_Dialog