SPI with no CS. Problem with PE

cancel
Showing results for 
Search instead for 
Did you mean: 

SPI with no CS. Problem with PE

3,516 Views
zohargolan1
Contributor II

Hi All,

I am using processor expert to generate SPI on K20 device . I am accessing more than 16 devices so I am using 5 chip select signals. Those signals are GPIOs and are not driven directly by the SPI block.

When I am trying to setup a read access, I am first preparing a buffer for the read using SPI_RecieveBlock() and than starting the transmit and receive using the SPI_SendBloc().

The problem is the transaction is never finished. I can see the internal SPI interrupt happening for the first transmitted character, but not for the receive character and not for the second transmit and receive characters.

Is it possible to use the SPI with GPIOs as chip selects? Otherwise, how would I attack this problem?

Any comment will be appreciated

Zohar

12 Replies

1,166 Views
sys
Contributor III

Hi all,

I'm having the same problem, is there a workaround while waiting the PE upgrade?

When will be released the upgrade Marek?

Thanks!

Regars

Sandro

0 Kudos

1,166 Views
mstroven
Contributor III

Any hope for a fix from NXP?

0 Kudos

1,166 Views
marek_neuzil
NXP Employee
NXP Employee

Hello,

The PEx team has already fixed the issue in the driver but the PEx update has not been released yet. The fix will be available in the Processor Expert for Kinetis 3.0.3 update package.

Best Regards,

Marek Neuzil

1,166 Views
piotrdzierzak
Contributor II

Thank you Marek.

Could you tell us when the 3.0.3 update of PEx for Kinetis will be released?

0 Kudos

1,166 Views
mstroven
Contributor III

Thank you Marek.  Can you tell us when the 3.0.3 update might be forthcoming?

1,166 Views
marek_neuzil
NXP Employee
NXP Employee

Hello Zohar,

I don't know your configuration of the SPI device but the Slave Select pin must be used in some configuration. You can use an external demultiplexor (for selection of the slave device) but the selection must be driven by the Slave Select pin of the Master SPI device (e.g. the Slave Select pin can drive the enable input of the external demultiplexor).

See for example the following configuration when the CPHA = 0. The Slave Select pin must be used for initialization of data transfer (the master and slave device place the first bit of data when the master assert the Slave Select signal), see the following timing diagram.

pastedImage_0.png

Please note, that the toggling of the Slave Select pin can necessary for every byte of data (depend on the configuration and the Slave device). You can find detailed description of SPI functionality in the Functional description chapter of the SPI device in the Reference Manual of the K20 derivative.

Best Regards,

Marek Neuzil

0 Kudos

1,166 Views
mstroven
Contributor III

I was told that the SPI peripheral in the KE02, KE04, and KE06 is a completely different macrocell - inherited from the S09 and S12 series - than the one in the K20 part.  There KE family reference manual states the following:

"30.2.4 SS — Slave Select

When the SPI is enabled as a slave, this pin is the low-true slave select input. When the SPI is enabled as a master and mode fault enable is off (MODFEN is 0), this pin is not used by the SPI and reverts to other functions (based on chip configuration). When the SPI is enabled as a master and MODFEN is 1, the slave select output enable bit determines whether this pin acts as the mode fault input (SSOE is 0) or as the slave select output (SSOE is 1). "

Unfortunately, PEx is not affording us the option to disable use of the SS output.

0 Kudos

1,166 Views
marek_neuzil
NXP Employee
NXP Employee

Hello,

I have verified the SPIMaster_LDD component behavior on MKE06Z128 and the Slave Select pin is not allocated properly (MODFEN bit is always set in the initialization code and therefore the Slave Select pin is always used by the SPI device). The Slave Select Output Enabled (SSOE bit) functionality selection is also not supported.

I have reported this issue to the Processor Expert development team.

Best Regards,

Marek Neuzil

1,166 Views
carloshass
Contributor II

Marek,

Does the Pex team answered you?

You have some bug report number?

1,166 Views
mstroven
Contributor III

Thank you Marek!

0 Kudos

1,166 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Zohar,

Yes, we can use the GPIO as the chip select of SPI.

While "  please be attention that GPIO is slow module, which exists delay when register was set or cleared. If customer want to use GPIO pin as SPI chip select, the GPIO pin toggle frequency should be slower than 2 MHz. "

The detail information please refer to here :

SPI with no CS. Problem with PE

Hope it helps



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

Have a great day,
Alice

0 Kudos

1,166 Views
mstroven
Contributor III

Hello Zohar,

I am having the same problem using PEx for the Kinetis KE06Z.  If you use the "peripheral init" Component, you can initialize the SPI device with the Slave Select line disabled, but you then have to implement your own low-level driver for SPI read and write.  If you use the high-level SPI component, you don't get the option to turn off Slave select.  The refence manual for the MKE0x series shows that it's totally possible to run the SPI peripheral in Master mode without the Slave Select.  (You can then define GPIO pins for you various select lines.)