1k5 k pull-up on D-

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
spiff
Rank 1
Rank 1
Posts: 24
Joined: Tue Apr 17, 2007 1:00 am
Location: Virum, Denmark
Contact:

1k5 k pull-up on D-

Post by spiff » Tue Mar 17, 2009 12:00 am

I have been developing a few different things based on AVR-USB, and I am currently enhancing my C64 USB keyboard. I have been changing the schematics according to the one suggested by ObDev (with zener-diodes). The reason I want to use this version is to have a 5V supply for the uController.

Now, one thing that puzzles me; the 1.5K pull-up on D- which goes to +5V. Is this OK? On the other schematics it goes to 3.3V.

I suppose this means that 1.13mA is flowing in the pull-up to ground (through the zener diode), and this approach is therefore not really feasible in terms of suspend mode (max allowed 500uA per the USB spec).

Are my observations correct, or am I missing something?

Grendel
Rank 4
Rank 4
Posts: 167
Joined: Sat Dec 16, 2006 9:53 pm
Location: Oregon, USA
Contact:

Post by Grendel » Tue Mar 17, 2009 9:06 am

I use a 2k2 resistor to 5V, works fine, uses less power. Shouldn't be a problem since you need a self powered device to met the specs for suspend. Leakage over the Zeneres is probably neglegtable if you use 3V6 ones.

Most (non OTG) hosts will do nothing if you draw 5-10mA during suspend tho.

spiff
Rank 1
Rank 1
Posts: 24
Joined: Tue Apr 17, 2007 1:00 am
Location: Virum, Denmark
Contact:

Post by spiff » Tue Mar 17, 2009 11:06 pm

Thanks for your reply.

Grendel wrote:I use a 2k2 resistor to 5V, works fine, uses less power. Shouldn't be a problem since you need a self powered device to met the specs for suspend. Leakage over the Zeneres is probably neglegtable if you use 3V6 ones.

Why do I need a self-powered device to meet the specs for suspend?

Even for an old AVR like the ATmega16, going to sleep mode should easily allow the current draw of the MCU to drop below 100uA. And with newer PicoPower devices it could be below 1uA.

Grendel wrote:Most (non OTG) hosts will do nothing if you draw 5-10mA during suspend tho.

Yeah, I am aware of this. I just wanted to know whether it should be possible to live up to this part of the spec. If I used a 3.3V supply from an LDO, and got rid of the zeners, I suppose it would be possible to go below the 500uA.

Grendel
Rank 4
Rank 4
Posts: 167
Joined: Sat Dec 16, 2006 9:53 pm
Location: Oregon, USA
Contact:

Post by Grendel » Wed Mar 18, 2009 3:15 am

Well, first, the 500uA are really only 300uA -- a host has 15k pull-downs on D- & D+, you get a 16.5k base load to Vterm; 200uA.

If you want timely wakeup you should only use Standby (note that INT0 can only be used as a level ISR) -- ~150uA if you also shut everything else down (BOD, AC, ADC ...) An LDO is not only expensive (~$7, at least the one I looked at @ DigiKey), but also has a GND current of up to 200uA, 550uA already. Plus, you can't issue a remote wakeup to the host since you would have to get out of standby for that.

IMHO it's way too much a hassle to meet the specs. But if you do, let us know :)

spiff
Rank 1
Rank 1
Posts: 24
Joined: Tue Apr 17, 2007 1:00 am
Location: Virum, Denmark
Contact:

Post by spiff » Sat Mar 21, 2009 11:21 am

First, thanks for your reply. I'm not trying to get into an argument here, but simply understanding where the limitations are. Since the electrical performance and error correction is not up to spec anyway with AVR-USB, the device will never be fully compliant anyways, but it is always nice to take conscious decisions about where the design is not up to spec.

Grendel wrote:Well, first, the 500uA are really only 300uA -- a host has 15k pull-downs on D- & D+, you get a 16.5k base load to Vterm; 200uA.

That is new to me. What I don't understand is why they specify 500uA for the device if the host consumes some of that.

Grendel wrote:If you want timely wakeup you should only use Standby (note that INT0 can only be used as a level ISR) -- ~150uA if you also shut everything else down (BOD, AC, ADC ...)

I agree there is not much fun in shutting down the uController in a way where it cannot be woken up again :wink:

Grendel wrote:An LDO is not only expensive (~$7, at least the one I looked at @ DigiKey), but also has a GND current of up to 200uA, 550uA already. Plus, you can't issue a remote wakeup to the host since you would have to get out of standby for that.

There are plenty of cheap LDOs (<$2.5 on DigiKey), and also with a much lower quiescent current. Usually the GND current is with a much higher load than what we are looking at here. The parameters change a lot if you don't require too much power in the operational state. For instance if the circuit operates at <50mA, this could be used:
http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=LM2936Z-3.3-ND

Grendel wrote:IMHO it's way too much a hassle to meet the specs. But if you do, let us know :)

As stated earlier, I just want to have considered it, and actively decided to let it slide. There is a high probability that I will end up with the same conclusion: "It's way too much a hassle to meet the specs."

But I'm getting sidetracked here. Can someone tell me what the requirements for the pull-up on D- is. As I see it, a pull-up to 5V is not the same as a pull-up to 3.3V. Perhaps this is the reason a 2.2K is fine when it pulls up to 5V?

Grendel
Rank 4
Rank 4
Posts: 167
Joined: Sat Dec 16, 2006 9:53 pm
Location: Oregon, USA
Contact:

Post by Grendel » Sun Mar 22, 2009 7:47 am

spiff wrote:
Grendel wrote:Well, first, the 500uA are really only 300uA -- a host has 15k pull-downs on D- & D+, you get a 16.5k base load to Vterm; 200uA.

That is new to me. What I don't understand is why they specify 500uA for the device if the host consumes some of that.

Side effect of USB 2.0 HS -- USB 2.0 spec, chapt. 7.1.1.3: "On downstream facing ports, RPD resistors (15 kΩ ±5%) must be connected from D+ and D- to ground." This in addition w/ the permanent 1.5k low speed ID pull up resistor on D- (Rpu) makes for a 16.5k load. It doesn't matter for 2.0 HS since Rpu is disconnected after HS mode was negotiated during attach.

spiff wrote:But I'm getting sidetracked here. Can someone tell me what the requirements for the pull-up on D- is. As I see it, a pull-up to 5V is not the same as a pull-up to 3.3V. Perhaps this is the reason a 2.2K is fine when it pulls up to 5V?

Yes :)

christian
Objective Development
Objective Development
Posts: 1443
Joined: Thu Nov 09, 2006 11:46 am

Re: 1k5 k pull-up on D-

Post by christian » Sat Apr 11, 2009 6:49 pm

Just a note: Please use 1k5, not 2k2. The current through the zeners is so high that you are close to the threshold voltage with 2k2.

oliver
Posts: 1
Joined: Tue Jan 08, 2013 10:24 pm

Re: 1k5 k pull-up on D-

Post by oliver » Tue Jan 08, 2013 10:29 pm

I'm by far no electrical engineer, nor have I yet to successfully use V-USB ;)

But I noticed I found a schematic using 2k2 on 5V. Now the hardware recommendation does list 1k5 on 5V and it is repeated here.
Now I would have expected, without doing any maths, that actually 2k2 would be better on 3.3V if 1k5 is recommended on 5V.

So to quench my curiosity, I did do some math ;)

With
5 V and 2k2 ohm, we get 2.3 mA going through the resistor.
5 V and 1k5 ohm, we get 3.3 mA going through the resistor.
3.3 V and 2k2 ohm, we get 1.5 mA going through the resistor.
3.3 V and 1k5 ohm, we get 2.2 mA going through the resistor.

However my skill lacks here onto what thus goes through the Zener(s). Purely based on the current fly through the resistor, on 5V 2k2 ohm would be better, but appearantly we want more current to flow through the resistor so less flows through the zener?

blargg
Rank 3
Rank 3
Posts: 102
Joined: Thu Nov 14, 2013 10:01 pm

Re: 1k5 k pull-up on D-

Post by blargg » Fri Dec 13, 2013 8:17 pm

Sorry to revive this but I'd like to answer this hanging question: the voltage drop across the zener diode depends on the current going through it.

Image

As you go to the left (increasing reverse voltage across the zener), not much flows, until you reach a point where current increases significantly and the graph drops down steeply. If you limit the current with a 2k2 resistor, you'll stay near the top of the drop-off, where the voltage drop across the zener is less. For the ones used, this apparently puts the voltage too close to the USB threshold and risks not being recognized. The red circled region is where you want to be, which gives the specified Vz. This requires putting Iz (current) through the zener.

AHorneffer
Posts: 6
Joined: Sun Dec 10, 2017 4:23 pm

Cautionary tale (Re: 1k5 k pull-up on D-)

Post by AHorneffer » Thu Dec 06, 2018 2:08 pm

Hi blargg

Thanks for the explanation, I now understand the problems I had.
Maybe as a cautionary tale for others (Even though most of us probably only read that when it is too late, like I did): when choosing the zener diodes for my latest project I didn't pay attention to the power rating of the diodes. On my breadboard where I used a 1k pull-up resistor (don't ask, I guess I thought "meh the computer shouldn't be so picky") they worked fine. But on the PCB where I used a 1.5k pull-up it didn't work. It turned out that they are only rated for the 3.6V at 69mA. So with a 1.5K pull-up I only had about 1.6V over the zeners and with the 1k about 2.4V. Still below specs, but works well enough with my computer.

Post Reply