This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

I2C

hi to all from last two 3 day's i strucked with some the problem. i have already done the i2c routine for AT24c04. Which works fine i can read from that and can write in. now i am going to use the LCD and printing the string on that i also developed small VB6 application to send the string to LCD. now what i tring to do the string which i passing from PC should be printed to LCD and to be stored in EEPROM. But the problem is that the string is printing on LCD but not get stored to EEPROM.
EX.ABCDEFGHIJKLMNOP is the string which i pass to LCD it properly printing on LCD.but not get stored in EEPROM. When i read EEPROM it show's me the A C D F H J L N P these parameter get stored in eeprom.
before this project i have complited lot much EEPROM contain instrument in which i can READ and WRITE EEPROM Without any problem.and still working so nicely.
canany one tell me what is the peoblem.

Parents
  • The original code maybe didn't perform several back-to-back write operations
    yes!!!!
    the delay timing as per data sheet is 4.7 µsec and i am using the 24MHz Crystal for and provided 5 NOP so it is much much greater than they said.so i am not lucky from last 2 years i work a lot for this if there is some mistake (but i dont think so) i am ready to learn.

Reply
  • The original code maybe didn't perform several back-to-back write operations
    yes!!!!
    the delay timing as per data sheet is 4.7 µsec and i am using the 24MHz Crystal for and provided 5 NOP so it is much much greater than they said.so i am not lucky from last 2 years i work a lot for this if there is some mistake (but i dont think so) i am ready to learn.

Children
  • Is the full code in assembler or did you inline the NOP instructions?

    Have you verified that your 5 nop really resulted in > 4.7us pause, when compiling with the current version of the compiler?

  • OK, so the "luck" in this case was that you hadn't exercised the flawed part of the code before!

    So, again, the fact that it's been "working" for 2 years doesn't guarantee that it's bug-free - just that the bugs haven't manifested themselves yet!

    As Erik keeps saying, testing doesn't prove the absence of bugs - just that you haven't managed to find them yet!

  • so i am not lucky from last 2 years i work a lot for this if there is some mistake (but i dont think so) i am ready to learn.

    This is why you use test cases during development. They can be used to examine the behavior of the code in case of circumstances that rarely occur otherwise.

    It is a good idea to test all possible code paths this way, especially error detection and error recovery.