Bug with the IIC

Status
Not open for further replies.

Jeff1111

New Member
Hello,
I have programmed a uC MC9S08QG8. I try to communicate with a EEPROM 24LC04B/P, but I can write and Read only when I'm on step by step (sure). When i let the program going to his own speed, something don't work. I have look after the speed of transmission, but nothing hapened. No errata, what else?
And It works in step by step!!!
Any idea?
 
I2C should only run at 400kHz. is your micro generating the I2C bus too fast? Also have you allowed 10ms for the EEPROM to program? Most people (including me) forget this step and when you go to read back the EE memory it comes out as FFs
 
I2C should only run at 400kHz. is your micro generating the I2C bus too fast? Also have you allowed 10ms for the EEPROM to program? Most people (including me) forget this step and when you go to read back the EE memory it comes out as FFs

No, it's not! I have try with many different speed.

What do you mean by that? when I start the uC? Or between a write and a read?
 
The datasheet should tell you the minimum write time for the E2. Normally you give it your address then your data, then you have to wait at least 6ms for the internals of the E2 to actually program the memory location, so you need to implement a delay after each write cycle
 
You mean this time: Bus free time: Time the bus must be free before a new transmission can start "Min 1300ns" -> 1.3us???
 
It works! I put a delay of 100us after each transmission and it was ok! Thank you for all! have a good day!
 
Hmmm. Obviously something is working, but I think 100us is too short. You need 6ms (ideally 10ms) for the E2 to write to memory.
 
But in the datasheet, nothing take more than 5us. one think is in [ms] and it is "Max time write".
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…