cancel
Showing results for 
Search instead for 
Did you mean: 

I2C communication is not working between ST25R3916B and MCU STM32G0B1RT6N

Dilip
Associate III

Hi I am using ST25R3916B as NFC reader and it is interfaced with STM32G0B1RT6N via I2C lines. I am not able to communicate with reader IC . I have checked I2C_EN line is connected to VDD_D voltage output from reader IC. it is 2.05V and SCL and SDA lines are pulled  up to 3.3V with 10K resistor.

Pls help me where i am doing wrong

This discussion is locked. Please start a new topic to ask your question.
31 REPLIES 31

Hi Ulysses

Pls see below SCL and SDA signals. I am not getting any ACK from NFC reader IC though it is showing there is some device on 50h address. I am using address 50h as mentioned in the datasheet . I have lift shifted 0X28 to get the 50h as it was expected in HAL.

 

Dilip_1-1753949390545.png

Thanks 

Dilip

Hi,

0x50 vs 0x28 is an effect of different interpretation if the direction bit is regarded to belong to the address or not. Digital waveforms look about right. As there is no ACK, you should now look into the analog using two scope probes to see if the device really does not react at all or if the data is incorrectly sampled due to analog (non-optimal pull-ups, etc.).

BR, Ulysses

Hi Ulysses, 

Pls see below analog waveforms also along with digital decode for these waveforms. This also looks good and no pull up issue here. Right?

Dilip_0-1753969385243.png

Thanks 

Dilip

 

Hi, 

looking at it again: You are using the wrong device address. The address is 0x50 - also Saleae should display it as such. Typically on STM32 you need to use (0x50<<1) = 0xA0 as they include the direction bit.

BR, Ulysses

Hi Ulysses, 

Thanks for your suggestions. I have implemented the address 0XA0. In this it is showing that it is writing to register but while reading back same register, it is showing FF. See below snap shot of  digital decode and analog waveform. Can you pls suggest what else need to be done?

Dilip_0-1754042620888.png

 

 

Hi, 

as per DS you need to use a repeated Start condition. Here you are showing Stop condition followed by Start condition.

Maybe also refer to https://community.st.com/t5/st25-nfc-rfid-tags-and-readers/errors-while-compiling-the-fw-stsw-st25r011-of-the-st25r3916/m-p/69192?lightbox-message-images-69200=9653i4AD55C02C4B0012C

 

Ulysses

Hi Ulysses , 

What do you mean by repeated start condition. I dont understand. Can you pls explain in detail, how to implement it  and where it is mentioned in datasheet?

Hi,

in the DS look for "Repeated Start", the diagrams in chapter "I2C" interface and the I2C spec. Repeated Start is a Start condition without previous Stop condition.

Ulysses

Thanks Ulysses. I have looked into the datasheet. It says repeated start for register space B reading . I am just reading register space A . Do you think it is needed for reading the register space A also. If yes, can you pls help me how to implement that in the software code?

 

Thanks 

Dilip

Brian TIDAL
ST Employee

Hi,

Reading space A or space B register on I²C behaves the same way regarding the repeated start. See figure 24 in the ST25R3916B datasheet.

The code supporting I²C is available in the X-CUBE-NFC6 package and the ST25R Embedded library (files i2c.h and i2c.c). These packages provide the RFAL NFC communication stack, the ST25R3916B driver, and some demos. Using the X-CUBE-NFC6 package (or the ST25R Embedded library) is encouraged rather than developing code from scratch.

Rgds

BT

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.