SPI is not working with Infineon current sensor TLI4970

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
ujur007
Posts: 1
Joined: Wed Jun 23, 2021 4:40 am

SPI is not working with Infineon current sensor TLI4970

Post by ujur007 » Wed Jun 23, 2021 4:47 am

Hi,

I am working with SPI on the ESP32 Pico kit to interface the current sensor TLI4970.

I have tried like SoftSPI and SPI(HSPI & VSPI) with the configuration as shown in the example
vspi = SPI(2, baudrate=80000000, polarity=0, phase=0, bits=8, firstbit=0, sck=Pin(18), mosi=Pin(23), miso=Pin(19))
The problem is that the correct data is not being received. It is either 0xFF or 0x00. One of the things I am not quite clear is about CS pin in SPI. What I have done is that I have tried to manually turn on the pin.

I tried the same example on esp32-wroom kit with the same result.
p5 = PinPin.(5, OUT)
p5.on()

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: SPI is not working with Infineon current sensor TLI4970

Post by Roberthh » Wed Jun 23, 2021 6:11 am

Usually the CS active state is a low level. p5.on() sets p5 to a high level. So better use p5.value(0) or p5(0) to set it to a low level, and p5.value(1) or p5(1) for a high level.

User avatar
jcf
Posts: 60
Joined: Wed Mar 03, 2021 11:14 am

Re: SPI is not working with Infineon current sensor TLI4970

Post by jcf » Fri Sep 30, 2022 9:03 am

@ujur007
Have you got your sensor to work?
I have just now looking at a TLI4790 I had lying around and was wondering if there is a lib for it.

Post Reply