??? 04/05/07 15:41 Read: times |
#136690 - Stuck in no ACK Responding to: ???'s previous message |
Asif Ali said:
It really worked and now i have came to know that the MCu is stucked in Ack, well sir (its my habit to say sir), well does any one know that how to over come that ACK ?
the code is this ACK: SETB SDA BACK: SETB SCK JB SDA,LEDX ;if SDA is high then go to LEDX LABEL EXIT: CLR SCK ;if SDA is low then clear the SCK RET ;Go back LEDX: CLR LED ;Clear the LED pin for tracking SJMP BACK ;Go back to BACK and check it again DareDevil Dear Asif, You never want to sit in a loop waiting for ACK. If the eeprom does not want to ACK you, then you let higher code handle it. The most common cause is that the bus was busy, or the eeprom did not get addressed (ie did not respond to the 0xA0 address). By all means use an LED to show what is happening, but just let it set/clr the LED and then bring your CLK low and return. Let your calling code handle the no_ACK situation. David |