| ??? 05/28/07 22:53 Read: times |
#139950 - do you have some other version of code? Responding to: ???'s previous message |
Jan Waclawek said: How do you know that?
You don't check whether the memory ACKs ALL the written bytes, i.e. command, address... Philippe Latu said:
I check control byte Ack, then address byte Ack, and ... then I get no Ack for data byte. Jan Waclawek said:
I can't see that in the version of code I downloaded... Did you modify it to do these checks? The only changes I did to the code are related to timing with inline nop instrucions calls. Here is the function to check ACKs. /* wait for ACK to data recieved by slave * returns 0 on error: SDA should be low after ACK and * i should be greater than 0 */ bit i2c_getack(void) { unsigned char i = 0xff; SDA_H(); // Slave device has to pull down SDA nop(); SCL_H(); // during one clock cycle i2c_delay(); while (SDA_IN() && --i) // waiting for SDA to go low ; SCL_L(); return !SDA_IN() && i; } I just posted a new version with 2 pcf8591 functions for adc and dac. they are working fine. Jan Waclawek said:
Can't you go for the edge-by-edge version, simply stepping through the whole data transfer one-by-one, and see what happens directly on the lines (attaching 2 LEDs)?
JW I'll try to get scope captures tomorrow. Thanks for your patience and time. |
| Topic | Author | Date |
| I2C eeprom 24c02 byte write stuck in ack | 01/01/70 00:00 | |
| timing | 01/01/70 00:00 | |
| timing | 01/01/70 00:00 | |
| what\'s the problem, exactly? | 01/01/70 00:00 | |
| timing | 01/01/70 00:00 | |
| how do you know that? | 01/01/70 00:00 | |
| How do you know that? | 01/01/70 00:00 | |
| do you have some other version of code? | 01/01/70 00:00 | |
| do you have some other version of code? | 01/01/70 00:00 | |
| A work around For That | 01/01/70 00:00 | |
| work around For That | 01/01/70 00:00 | |
| Well in my guess, you have same problem:-) as mine | 01/01/70 00:00 | |
| Polling the 24C02 EEPROM for ready | 01/01/70 00:00 | |
| OOPS wrong logic | 01/01/70 00:00 | |
| I thought that I should try your code | 01/01/70 00:00 | |
| Polling the 24C02 EEPROM for ready | 01/01/70 00:00 | |
| great, but do not forget to mention | 01/01/70 00:00 | |
| The Clock | 01/01/70 00:00 | |
addition - show the full picture - 'edit' to above | 01/01/70 00:00 | |
| i2c function signatures | 01/01/70 00:00 | |
| hello friend | 01/01/70 00:00 |



