Forum: Mikrocontroller und Digitale Elektronik I2c Problem with stm32 after reboot


von Ines L. (ines_l)


Lesenswert?

Hello,
we use the stm32g081kb to communicate with a i2c capable nfc Chip from 
nxp, the ntag i2c. After soldering on a new tag ic chip everything works 
fine. We can read the field detect and reading/ writing the config 
registers is working properly. After i unplug the vcc from the pcb or 
the usb cable from the stm32 the i2c Connection to the nfc Chip doesn‘t 
work properly after reconnecting the pcb to vcc. Somehow the i2c writes 
the TXDR and rxdr values in the First to configuration Registers and 
therefore the Chip and the Communication doesn’t work anymore. The Slave 
and the Master are both powered by the mcu vcc. I am really lost what 
could be the problem here? Thank you for your help!
best regards,
ines

von Sebastian W. (wangnick)


Lesenswert?

Mmh. Initially it was working fine, and now not anymore? What is now 
different from when it was working? That is still unclear to me after 
reading your description.

Also, schematics might help to receive decent support on the matter.

KR, Sebastian

von Peter D. (peda)


Lesenswert?

Ines L. schrieb:
> the i2c Connection to the nfc Chip doesn‘t
> work properly

How you detect, that the I2C failed. Was always a NACK returned by the 
slave or failed the master to do a certain step.

von Ines L. (ines_l)


Lesenswert?

Than you for your responses, I figured it out now.

Our I2C when first initialized worked fine, but the second time and so 
on, when reading and writing data to/from the chip, the first two bytes 
sent/received were the address and not the data itself. Apparently our 
Chip couldn't handle the I2C fast mode. Setting it to standard mode 
(100kHz) solved the problem and now it works just fine.

von Sebastian W. (wangnick)


Lesenswert?

Thanks for the feedback, and good to hear that you sorted it out!

KR, Sebastian

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.