Need pseudo code to check ACK or NAK and to generate ACK or NAK i2c communication

Thread Starter

anukalp

Joined Jul 28, 2018
158
I am looking pseudo code to check ACK or NAK and generate ACK or NAK in i2c communication

upload_2019-10-12_11-33-17.png

as given in diagram The master issues Start, then sends the slave address and slave sends a single ACK or NAKa after receiving 8 bits

Code:
void main (void)

{
    //How to write a pseudo code to check ACK or NAK and to  generate ACK or NAK

}
 

Attachments

Last edited:

BobaMosfet

Joined Jul 1, 2009
2,113
Well, take a close look at what the SCL and SDA voltage levels are in the drawing you provide. That will give you a pretty good idea of when to raise or lower the value of a signal pin if you're trying to do i2c all by yourself.
 
Top