i2c pull up resistor situation

These little "Digistump" Velleman boards with an ATTiny85 on them are handy, but because they're intended to be programmed directly over USB compromises have to be made:

The 1.5k pullup on the ADC input pin "D-" can be worked around. Trying to run low-speed software i2c over pin "D+" and PB5/nRES doesn't seem to work with the stock pull-ups that come on many "breakout boards" pre-built for i2c devices due to the inline resistor/diode combination on D-. Looking for advice on if that's possible and set of appropriate values to bodge in as I don't have the time to cut-n-try!

I'm trying to get 2 software/bit-bang i2c devices running off it and pins PB0 and PB2 and pins PB4 and PB5 look like my only plausible options for the pairs with the ADC on PB3 spoken for, and the resistor and LED on PB1.

Frustratingly the Chinese knock-offs of the Digistump (and Velleman is a fashion of that) don't come with PB5/nRES enabled as an IO, stock, it's still configured as a reset pin, and have to use another programmer to set the fuses to enable it.

Reply to
bitrex
Loading thread data ...

Correction, one of the devices is not strictly i2c, it's a dumb two-wire serial protocol for the "tm1637" display controller. If it were "real" i2c it would be easy as one would not respond to the other's address and could hang them on the same pins as two independent slaves and wouldn't interfere with each other.

Reply to
bitrex

Sorry, but I'm not following what the problem is. You say D+ and PB5 can't be used because of the 66 ohm resistor and the Zener diode on the D+ line. I assume the Zener part number is a typo and should be BZT52C3V6 for a 3.

6 volt zener. Otherwise it is a 36 volt Zener and is completely out of the loop. Still, the 3.6 volt zener should not cause problems since it doesn' t draw much current until the signal level is at least 2.5 volts or higher. If you are pairing this signal with PB5 that means you are using J1 and s o the resistor is out of the loop. Maybe your problem is elsewhere?
--

  Rick C. 

  - Get 1,000 miles of free Supercharging 
  - Tesla referral code - https://ts.la/richard11209
Reply to
Ricketty C

Ah crap, yeah those are Zeners. I'm used to seeing the other symbol I misinterpreted that at first glance as Schottkys, I should have checked the part number.

Right, that may be the problem, the signal for a 5 volt bus is getting clamped.

Reply to
bitrex

These two symbols for Zener and Schottky are too much alike I never use that one for Zener in my own work so my brain just filled the rest in I guess. there should be a law!

Reply to
bitrex

B
g

to

n
e
r

s a

's

o

PB5

be

and

not

ignal

Technically I don't think that is a valid symbol at all. The Zener symbol uses 45 degree angle tips and the Schottky has angular curls a bit like the letter S. So this symbol is for an inside out tunnel diode or bidirection al step recovery diode.

I don't know that it is clamped. The part number is actually for a 36 volt part. It depends on which is wrong, the part number or the intention of u sing a 36 volt part.

USB is a 5 volt signaled bus, right? Or are the signal levels only 3.3 vol ts? I can't think why they are using 3.6 volt Zeners.

--

  Rick C. 

  + Get 1,000 miles of free Supercharging 
  + Tesla referral code - https://ts.la/richard11209
Reply to
Ricketty C

re

USB

ing

em to

ion

ate

d

tor

is a

it's

to

nd PB5

ld be

r and

d not

signal

he

ed

g

l uses 45 degree angle tips and the Schottky has angular curls a bit like t he letter S. So this symbol is for an inside out tunnel diode or bidirecti onal step recovery diode.

lt part. It depends on which is wrong, the part number or the intention of using a 36 volt part.

olts? I can't think why they are using 3.6 volt Zeners.

USB signalling is 3.3V, the zeners (some have used blue leds instead) is a hack to do bit banged low speed 1.5Mb/s USB with an MCU running on ~5V

Reply to
Lasse Langwadt Christensen

are

USB

ying

eem to

tion

iate

nd

stor

n is a

it's

r to

and PB5

uld be

er and

ld not

s signal

the

I

ked

ng

se

I

mbol uses 45 degree angle tips and the Schottky has angular curls a bit lik e the letter S. So this symbol is for an inside out tunnel diode or bidire ctional step recovery diode.

volt part. It depends on which is wrong, the part number or the intention of using a 36 volt part.

3 volts? I can't think why they are using 3.6 volt Zeners.

s a hack to do bit banged low speed 1.5Mb/s USB with an MCU running on ~5V

You are using J1 to connect your two-wire devices, no? Remove R4 and D+ is now free to rise. Or remove the Zener diodes. Is that not an option?

You really have not explained very much about what is going on with your de sign.

--

  Rick C. 

  -- Get 1,000 miles of free Supercharging 
  -- Tesla referral code - https://ts.la/richard11209
Reply to
Ricketty C

"

le

D+

on

Zener

hould

al

this

Zener

for a

r the

only

and

t not an

Wait... If the high is 0.7*Vcc, shouldn't the low be below 0.3*Vcc?

The 0.7 and 0.3 factors are just to account for variations in the threshold in the receiver over process, voltage and temperature. The actual variati on should not be that much. 0.7 * 5 volts is 3.5 volts. What voltage is t he Zener actually clamping at? With 66 ohm series resistors I would expect the output to be at least 3.5 volts if not closer to 4 volts. The BZT52C

3V6 has a minimum of 3.4 volts at 5 mA and the 66 ohm resistors will pass m ore like 20 mA at that voltage.

Check the Marking code for the part to verify it is a BZT52C3V6 and not a B ZT52C36 or whatever. Better yet scope it in operation. I don't think this is your problem.

--

  Rick C. 

  -+ Get 1,000 miles of free Supercharging 
  -+ Tesla referral code - https://ts.la/richard11209
Reply to
Ricketty C

Do you see any "hacks" I could use to get two two-wire bit-bangers running on this thing with 0.7*5 volt Vcc high threshold without an external shifter? I'm not seeing it, unfortunately :(

Reply to
bitrex

Series diode would probably work to bring it up above the threshold if I keep it slow, I guess.

Reply to
bitrex

Right, I have one two-wire bit-banger on PB0, PB2. another on PB4, PB5. With the Zener on PB4 when there's a pull-up on the bus after it that line doesn't rise high enough to trigger the 0.7* 5 volt Vcc logic threshold on the i2c device to trigger it reliably. The Zeners and resistors there are as Lasse says, they're for the hack-a-USB programming interface.

I'm testing out a thing on perfboard so I'm pulling the module and re-programming it from time to time, if I pull those it probably borks the USB programming capability.

I think a 1N4148 in series between the pull-up and the Zener at the input to D+/PB4 should allow it to trigger the threshold at least well enough so I can get on with testing.

Reply to
bitrex

Nah, scratch that then we don't hit the ~0.4 volt minimum when it pulls down.

Looks like some kind of transistor level shifting with a 3.3 volt aux supply may be the only way...

Reply to
bitrex

Zoop! Using ~4.7k pull-ups on the line along with a BAT54 schottky after the pull-up but before the Zener, in series, gives that line about a

0.25 volt boost above the Zener voltage, high enough to trigger the 5V i2c device, but low enough to still pull it down below the logic low threshold.

Well, thanks for listening to me think out loud I stumbled my way there eventually. Didn't really want to go track down a level-shifter or come up with something just to test some two-wire devices.

Reply to
bitrex

"

le

D+

on

Zener

hould

al

this

Zener

for a

r the

only

and

t not an

just remove the zeners, it'll probably work without. The supply is only ~4.

5V with the diode in the USB supply and the PC transceivers can probably ha ndle 3.6V before the ESD diodes turn on

else just make a usb extender with the zeners

Reply to
Lasse Langwadt Christensen

Despite Rickman's objections bodging in a BAT54 in series after the pull-up on that line does seem to allow the bus to pull up and down sufficiently to trigger the 5 volt i2c device reliably.

Easier than pulling the (really small) Zeners on the board and I don't particularly want to risk the USB not working properly, don't have too many of these "development boards" on hand and C-19 still means they take a while to get.

Reply to
bitrex

d.

ds"

ible

y D+

de on

d

t Zener

should

gnal

g this

t

st

e Zener

ls

t

y for a

or the

ls only

.

R4 and

hat not an

  1. > >>> With the Zener on PB4 when there's a pull-up on the bus after it that
s
l
s

~4.5V with the diode in the USB supply and the PC transceivers can probabl y handle

I don't have an objection to your "bodge". I just don't think the problem was the Zeners. Do a little math using the data sheet, which I've already done for you. Better yet, take some measurements. I'm pretty sure you wil l find the signal without your "bodge" was not being limited by the Zener.

You said you added a 4.7 kohm pullup. What did you have before? Where is the board powered, J2 or USB? That USB diode might be significant. There is a lot of missing data and measurements are your friend. But you have it working... well enough anyway. So that is likely all you wanted.

--

  Rick C. 

  +- Get 1,000 miles of free Supercharging 
  +- Tesla referral code - https://ts.la/richard11209
Reply to
Ricketty C

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.