SPIMaster_LDD Slave Select Always Enabled

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SPIMaster_LDD Slave Select Always Enabled

970 Views
ttahut
Contributor III

Hello, I have the SynchroMaster component using the SPIMaster_LDD configured in my project with the Slave Select enabled for the component.  I do see SPI data being transmitted when I send data using SyncCAN_SendBlock().  The problem is, the Slave Select line is always low (enabled state)- even when I am not transmitting data.  Do I have to enable/disable this pin on my own even though I have set the SPIMaster component to take control of it?  If so, how do I toggle this bit?

I running this through CodeWarrior on the FRDM-KL25Z board.

Thanks for any help.

Tom

Tags (2)
0 Kudos
4 Replies

606 Views
marek_neuzil
NXP Employee
NXP Employee

Hello,

the SS pin toggling depend on the settings of CPHA bit (see the functional description of the SPI in the KL25P80M48SF0RM reference manual). When the CPHA bit is set to 0 the Chip select toggling is enabled and the SPI slave select work according to your requirement. You can see the settings of SPIMaster_LDD component on the following screenshot and the result (signals) on digital osciloscope snapshot (first channel - Chip select pin, second channel clock pin).

SPIMaster settings.png

F0000TEK.BMP.bmp

I have also attached the application that I have created in CW MCU 10.6.3.

Best Regards,

Marek Neuzil

0 Kudos

606 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hi Tom,

The simple method  is configuration the "select pin " as GPIO, when transmit data, configuration it to low ,when not to transmit , high.

Use  the "BitIO" component,  use the "ClrVal" and "SetVal" set the pin to 0 and 1 .

pastedImage_0.png


Have a great day,
Alice

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

0 Kudos

606 Views
ttahut
Contributor III

Alice- Yes that works.  But I guess I don't understand the reason the Slave Select setting is in the component if I have to toggle it on my own anyways.

In fact I got rid of the SynchroMaster because it is too slow and went straight to the SPIMaster_LDD component.  The Slave Select is in SPIMaster_LDD as well but the BitIO works as you would expect.

Thanks for your help.

0 Kudos

606 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hi Tom,

About the "chip select toggling " on KL2x family , there is a bug , so I recommend you configuration the pin to GPIO.

The detail introduce you can refer to here :   SPI Chip select toggles between bytes , please see the talking of   xiangjun.rong  .

BR

Alice

0 Kudos