Skip to main content
HL?�t
Associate II
October 22, 2018
Question

3-wire SPI (SSC) configuration

  • October 22, 2018
  • 4 replies
  • 6179 views

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.

4 replies

waclawek.jan
Super User
October 22, 2018

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
October 22, 2018

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
January 10, 2019

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
January 28, 2019

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
August 27, 2020

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

MMico.2
Visitor II
June 13, 2023

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
June 19, 2023

 

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.