Skip to main content
PYF.1
Associate
March 1, 2023
Question

How to respond NACK to Master

  • March 1, 2023
  • 2 replies
  • 999 views

Hello everyone,

I have a application on STM32L5xx, I configuration I2C1 to slave mode,

when slave receive first unwanted command code, I want to response NACK to master. I judge the command code in AL_SMBUS_SlaveRxCpltCallback call back function, and set NACK bit at CR2 register but unfortunately cannot success.

This topic has been closed for replies.

2 replies

Bubbles
ST Employee
March 2, 2023

Hi @PYF.1​ ,

to get the ACK control, you need to configure slave byte control mode. The settings are SBC=1, RELOAD=1, NBYTES=1. NOSTRETCH=0. The slave byte control is a whole chapter in the reference manual.

BR,

J

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.
PYF.1
PYF.1Author
Associate
March 3, 2023

Hi JUUDO,

Thanks for your answer, here I ignore the RELOAD=1, now I could control the ACK at eacch byte

determine response ACK/NACK to master

BR

PYF