Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 6 of 6

Thread: bitbang i2c without pullup resistors?

  1. #1

    bitbang i2c without pullup resistors?

    Howdy,

    I just figured out that I made a couple of extra-dumb mistakes in this board I designed.

    Mistake #1: I ran the i2c pins from my Teensy 3.2 to my accelerometer backwards! Clock is data, data is clock. D'oh!

    Mistake #2: I neglected to add pullup resistors on the i2c lines.

    Sorry, I'm new at this board-designing stuff. :/

    Anyway, it looks like I could maybe hack around mistake #1 by
    using an I2C bit-banging library, at least to do some testing of the
    rest of the board, but it's going to be a bit of work.

    So before I get into that, my QUESTION for y'all is: am
    I doomed to failure anyway because of mistake #2?
    And should I therefore give up on this board and just
    get started on the next one?

    Yrs noobishly,
    -mykle-

    p.s. I maybe also made mistake #3 when I only used one of
    the two decoupling caps shown in the datasheet for the acc.
    Actually I was copying the schematic of the Teensy Prop Shield,
    figuring Paul knows what he's doing. In retrospect, adding
    that 10-cent part would have give me one less thing to worry about ...

  2. #2
    Senior Member
    Join Date
    Feb 2018
    Location
    Corvallis, OR
    Posts
    330
    Quote Originally Posted by mykle View Post
    Howdy,

    I just figured out that I made a couple of extra-dumb mistakes in this board I designed.

    Mistake #1: I ran the i2c pins from my Teensy 3.2 to my accelerometer backwards! Clock is data, data is clock. D'oh!

    Mistake #2: I neglected to add pullup resistors on the i2c lines.

    Sorry, I'm new at this board-designing stuff. :/

    Anyway, it looks like I could maybe hack around mistake #1 by
    using an I2C bit-banging library, at least to do some testing of the
    rest of the board, but it's going to be a bit of work.

    So before I get into that, my QUESTION for y'all is: am
    I doomed to failure anyway because of mistake #2?
    And should I therefore give up on this board and just
    get started on the next one?

    Been there, done that. I got past the problem at the prototype stage by finding a convenient place to cut the traces and do an "X" set of jumpers to switch the signals. I've also added pull-ups by finding a convenient spot to scrape off the solder mask, solder in a 4K 0806 SM resistor and connect the other end to a convenient +3.3 trace or via.

    If this is a personal-use prototype, and the cuts and jumpers work, you can harden the fix a bit by painting over with clear nail polish. If this is a pre-production prototype, the fix can get you past the first hurdle and let you debug the rest of the hardware and software. When I started doing PCB layouts, I had a lot of prototypes with fixes like this. Thirty years later, I still get a pin or two wrong now and then. The fixes are more difficult now with fine-pitch SM parts, 8-mil traces, and 74-year-old eyes. If you plan to do many more boards in the future, invest in a decent binocular microscope. It will save you many hours of frustration in the future.

    If you have your Teensy in a socket, near the Teensy pads on your PCB may be a good place to cut and jump. The pins are on 0.1" centers and there is 3.3V available on several pins. If you don't want to connect to a 3.3V pin, you can always set an unused output to HI and use that for the 3.3V side of the pull-ups.

    I would advise trying the hardware fix before spending the time to do a software I2C implementation. That software can be tricky for devices that require clock extension.

  3. #3
    Quote Originally Posted by mborgerson View Post
    Been there, done that. I got past the problem at the prototype stage by finding a convenient place to cut the traces and do an "X" set of jumpers to switch the signals. I've also added pull-ups by finding a convenient spot to scrape off the solder mask, solder in a 4K 0806 SM resistor and connect the other end to a convenient +3.3 trace or via.
    Thanks, this was exactly the same wisdom my friend Tom gave me.
    Fixing it in software always seems easier to me, but actually the hardware hack wasn't sooooo hard.
    Took an hour & looks grody, but it's up and running!
    Thanks very much.
    -m-

  4. #4
    Senior Member
    Join Date
    Jul 2020
    Posts
    918
    Little tip about PCB prototypes - ensure every important signal has at least one via not covered by a component -
    these make convenient points to stick a thin wire in for either 'scope/LA probing or for making mods. Basically
    free test-points.

  5. #5
    Senior Member
    Join Date
    Feb 2018
    Location
    Corvallis, OR
    Posts
    330
    Quote Originally Posted by MarkT View Post
    Little tip about PCB prototypes - ensure every important signal has at least one via not covered by a component -
    these make convenient points to stick a thin wire in for either 'scope/LA probing or for making mods. Basically
    free test-points.
    Excellent point. I've gone so far as to add a label to the silkscreen for things like SCK, MOSI, MISO, etc. etc. The vias generally take less than half the PCB area of a normal test point. Some of my smaller vias would only handle a #30 wire-wrap wire whereas a normal test point was large enough for something much larger.

  6. #6
    That is a great idea! Thanks for the advice. I'll add that to my to-do list for the next board.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •