Skip to main content
HL?�t
Associate II
Oct 22, 2018 12:02 PM UTC
Question

3-wire SPI (SSC) configuration

Hi

I want to read out a sensor, which has an SSC interface, as depicted in the image attached. The IC is a TLE5012B (https://www.infineon.com/dgdl/Infineon-Angle_Sensor_TLE5012B-UM-v01_02-en-UM-v01_02-EN.pdf?fileId=5546d46146d18cb40146ec2eeae4633b) and I'm not really sure how I should configure the interface. MOSI and MISO are shorted together. So when I want to receive data, I first need to send a command, then I go into the receive mode, such that MOSI needs to be HI-Z, but how can I achieve this?

This topic has been closed for replies.

7 replies

waclawek.jan
Super User
Oct 22, 2018 2:32 PM UTC

You did not tell us your STM32 model, but generally, in SPI chapter of RM, focus on parts talking about BIDIMODE = 1.

On some DISCO boards, there are ST magnetometer/accelerometer MEMS of which some communicate in this way, so you can go for some inspiration there.

JW

HL?�t
HL?�tAuthor
Associate II
Oct 22, 2018 3:14 PM UTC

Hi JW, thank you. I use an STM32F410CBU6 for this, where I configurated it in the CubeMX tool from ST. I will have a look at this BIDIMODE.

https://www.st.com/resource/en/datasheet/stm32f410cb.pdf

APasy
Visitor II
Jan 10, 2019 11:49 AM UTC

Hello, did you manage to make a connection with STM? If so, can you give an example of the work? I will be very grateful!

APasy
Visitor II
Jan 28, 2019 10:01 AM UTC

Problem solved. I connect TLE5012B and STM32L011 with 2k resistor between MISO and MOSI SPI PINs. MISO "force(without resistor)" connected with "DATA" on TLE. I ported arduino library to LL library.

Dzor
Associate
Aug 27, 2020 6:18 AM UTC

Either jump MOSI MISO using a resistor, or use Half-duplex master mode in CubeMX

MMico.2
Visitor II
Jun 13, 2023 9:56 AM UTC

Hi, I have the same issues like you, can you share the project in order to understand which error I'm making? Thank you so much

Dzor
Associate
Jun 19, 2023 2:30 PM UTC

 

The trick is that you need to switch between sending and receiving. Order of operations matters, as SPI needs to be disabled before last word read is started.

Here is an example.  This is reading two words (data+safety) sent by tle5012b. https://github.com/dzid26/StepperServoCAN/blob/480f6fc05f474a96692b800cf3340507b985d360/firmware/src/BSP/tle5012.c#L41-L5

It is using Standard Library, but it should be similar with "HAL". I created also a CubeMX reference setup https://github.com/dzid26/StepperServoCAN/blob/main/firmware/StepperServo.ioc, but I don't actively use it.