Funky I2C edge with slew control enabled - Page 1
Forum section: electronics / general

author: uer166
author_rank: Super Contributor
timestamp: October 01, 2016, 03:14:45 am
content: I'm doing a project involving a PIC24FJ64GA102 talking to a MPL3115A2 altimeter over I2C. The altimeter is the only slave device.There are 1K pullups, and the traces from altimeter to mcu are ~5mm long.When initially setting up the I2C driver, I scoped the start condition and got this:Now that doesn't look particularly good, so I tried without slew control and got:Much better without slew control. So any ideas why there's so much ~100MHz oscillation when it's enabled?Isn't the point of slew control is to reduce EMI and ringing? Seems like it would make it worse in this case.It will probably work either way, but haven't tried yet. This is going into a gadget that absolutely cannot afford having flipped bits in the I2C bus data.

author: rx8pilot
author_rank: Super Contributor
timestamp: October 01, 2016, 03:28:20 am
content: Your pull-up may be a bit heavy - interfering with the slew rate control. How difficult is it to try a 3k so see if it changes?

author: T3sl4co1l
author_rank: Super Contributor
timestamp: October 01, 2016, 03:30:03 am
content: Heh, they made a slew rate control that manages to control nothing at all...Possibly you've terminated the pin incorrectly. The period may be characteristic of trace length. The trace may not be properly terminated, matched or dampened. A resistor or ferrite bead (right at the pin) may do it, or some R+C dampers on the trace (probably at the far end).Tim

author: uer166
author_rank: Super Contributor
timestamp: October 01, 2016, 03:44:29 am
content: Quote from: rx8pilot on October 01, 2016, 03:28:20 amActually that was one of my first thoughts too. I wacked a 10k in (didn't have any 3k), got this with the slew control:So definitely better, but not even close to a nice smooth ramp-down that I expected.

author: uer166
author_rank: Super Contributor
timestamp: October 01, 2016, 03:47:06 am
content: Quote from: T3sl4co1l on October 01, 2016, 03:30:03 amHmm I've never actually encountered I2C termination anywhere. Are there any recommendations/resources for that?More importantly, is even necessary? Without the slew rate control it's a pretty nice (albeit fast) edge.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: October 01, 2016, 04:15:08 am
content: Well.. if the pin worked to spec, termination wouldn't be needed, which is the point.They're running that "slew rate control" pretty hot, by the looks of it.Oh, obvious dumb things should be gotten out of the way first -- your grounding, bypass and layout is good, right?Tim

author: rx8pilot
author_rank: Super Contributor
timestamp: October 01, 2016, 04:18:40 am
content: Can you show the schematic and layout?

author: uer166
author_rank: Super Contributor
timestamp: October 01, 2016, 04:37:22 am
content: Quote from: rx8pilot on October 01, 2016, 04:18:40 amSure. Schematic doesn't say cap values, but the C12 and C11 are 10uF X7R and the rest are all 1uF X7R. The groundplane is mostly solid.Relevant part of schematic:Relevant part of layout (highlighted traces are SCL/SDA):

author: AndyC_772
author_rank: Super Contributor
timestamp: October 01, 2016, 06:12:03 am
content: Given how short your I2C bus is, I'd turn off the slew rate control and be done with it. Don't spend any more time on a feature which doesn't work, that you don't need.Is there any reason why you're using routed power instead of a proper power plane?

author: uer166
author_rank: Super Contributor
timestamp: October 01, 2016, 06:20:09 am
content: Quote from: AndyC_772 on October 01, 2016, 06:12:03 amYeah that's what I'm gonna do, I was just curious if anyone had a similar issue.The reason for routed power is so I can use a cheap 2-layer board.Thanks for the suggestions everyone.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: October 01, 2016, 02:53:30 pm
content: Grounding and supply are as good as they're going to get!Tim

author: Andy Watson
author_rank: Super Contributor
timestamp: October 01, 2016, 03:34:40 pm
content: Quote from: T3sl4co1l on October 01, 2016, 02:53:30 pmBut does that include the scope probe? I would be interested to know how the probe was grounded.

author: uer166
author_rank: Super Contributor
timestamp: October 01, 2016, 08:22:43 pm
content: Quote from: Andy Watson on October 01, 2016, 03:34:40 pmIt was grounded with one of those short spring leads into a ground via in the vicinity of the altimeter. So should be pretty good and low impedance.