cancel
Showing results for 
Search instead for 
Did you mean: 

stm32 i2c transmitter mode flags doubt

iam-charan
Visitor

why need to monitor txe flag and btf flag to transfer data after each byte.

txe says data register is empty,

btf  and txe says need monitor after last byte. according to reference manual.

but my question is how should i know i get ack after sending 1 byte .in this case which should i check txe,btf.

if i check txe if txe==1 i send 2nd byte then how should i know i get ack for byte1.

if txe indicate about ack flag received/not ,then why should compulsory use btf flag at end of last byte to check wait untill btf==1 before stop condition.

 

 

 

 

 

1 REPLY 1
TDK
Super User

> but my question is how should i know i get ack after sending 1 byte .in this case which should i check txe,btf.

The reference manual goes over the details here.

If you only want to send 1 data byte, BTF will be set after the first byte is sent and you need to generate a stop condition. TXE will also be set but it is not what you want to check.

TDK_0-1762172912063.png

 

If you feel a post has answered your question, please click "Accept as Solution".