This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi,
I am using TM4C1290NCPDT controller for one my product and I am almost done with the development. The product is about programming EEPROM using I2C protocol. At the initial stage of development I have faced a lot of issue, but thanks to e2e ti community by reading the solution of different threads i have found my answers. Now during the final testing stage I have found a bug in my device.
Bug description: I used to detect the communication error with the EEPROM using NACK status and found that once the communication error is detected then the next time with correct communication also the I2C module behaves strangely. For this I have found a solution that after every single operation I used to reset the peripheral and initialize my I2C setting everytime. The device is working fine, but my question is, Is this a valid solution for the specified problem ? or is there any other solution.?
My friend - you've explained & detailed your issue so well - yet your subject line "TM4C: TM4C" conveys "NO HINT" of what your intriguing post contains!
Having been active here (and multiple other forums) for some time - such poorly implemented "Headlines" (Subjects, here) do NOT attract the "best/brightest!" due to the "blind/useless repetition" and complete absence of post's objective! (this reporter does not meet that "qualification" - arrives out of curiosity & the attempt to assist...)
You may quickly/easily "Edit your Subject line by returning to "edit" that opening post - and creating a more "artful & descriptive Headline!" (i.e. MINUS such "brain-dead" repetition ... such ALWAYS helps - just as adding "Urgent" insures FEW will "read your post!"
To your topic - I don't recall that such, "Reset & Initialize" ... "After every single operation" is required. At least for our LX4F (several K units in the field) and our 4C123 (just under 200) we do NOT follow such "after every" protocol. (while it cannot hurt - it is cumbersome)
Might your board suffer "Power Supply Issues" or severe noise - either of which may render the MCU's I2C module - or Slave - (somewhat) confused? In addition - our LONG experience - teaches that relying upon MCU's internal pull-up Rs proves, "Fool's Gold" - REAL (external) pull-ups perform FAR BETTER & PROVE ROBUST! (MCU pull-ups are necessarily "high in value" - cause signal reflections & rounded edges - neither good - and EASILY AVOIDED!)
You don't provide the "Number of such boards" which present w/this issue - that's important - is it not? (guards against dreaded, "Single Board Anomaly")
Is it possible that the particular EEPROM you've chosen proves causative - have you substituted others - as "eased/quick" confirming check? We have used I2C for similar (external EEPROMs, ADCs, Temp Sensors, and GPIO Extenders) and thus far - have found NO NEED for "Reset & Initialize" after each/every I2C transaction!
Thank you - you note the power supplies as, "Not being an issue" - yet are "other peripherals" likely to be "as sensitive" as "I2C ones?" (which are "famed" for sensitivity to noise issues...)
You don't note the "frequency" of such disturbance. (i.e. is it once out of 20, 50, or 100 I2C transactions?)
How many devices share the I2C bus? What is the greatest distance between MCU and (most distant) I2C Slave? Is that (most distant) device the one which "errs" most often?
Are there "high speed traces" running near & parallel to your 2 I2C signal lines? What about "noise" or "power switching" - which may cause spikes & transients (both known to impact I2C and/or other "sensitive" inputs.)
And - as always - scope caps taken very near to the "most distant" I2C Slave would prove of high value...
Jijo Thomas6 said:The I2C is dedicated to a single device. The greatest distance between MCU and I2C slave is 0.75 Mtr. Every device is having the same issue.
Some clarification required: you first note "single I2C device" - but then use the words, "every device" (has the same issue!) When you speak to "every device" might you mean, "Other identical Boards?" If not - I cannot tell if there is just one I2C Slave on your board...
The fact that you are 0.75 meters (I2C separated) - and running 400KHz (noted in a separate posting) - to me - provides a strong indicator that this "combined" Distance & Speed proves the (likely) cause of your issue.
One thing (may) save you - even at that "excessive distance" and "very high speed!" That would be "your use of the MCU's internal pull-up resistors" - if used - your "replacement w/4K7-10K EXTERNAL resistors" - may "Save your day!" Although still - shorter separation & lower speed can ONLY HELP!
As always - when such troubles arise - moving to slower speeds (and where possible) shorter and more direct MCU <- > Slave separation - increases the robustness of your I2C transactions! Note that your high speed is negated by the "too often" requirement to "sit idle" while you execute (repeated) Peripheral Resets...