BMOW title
Floppy Emu banner

Explaining 4K 60Hz Video Through USB-C Hub

USB-C offers exciting new capabilities, including external monitors connected through the USB port. USB-C converters to DisplayPort or HDMI are common and inexpensive. USB-C hubs with external monitor support are also common, but understanding their capabilities and limitations can be extremely confusing. Some are Mac-compatible and some aren’t. Some need driver software. Supported resolutions and refresh rates vary widely. Some are advertised as “not for gaming use”. There are mentions of alt mode and dual mode and more. Prices range from $20 to over $300 for what look like very similar features. What’s going on here?

This is the guide to high-resolution video over USB-C that I wish I’d had. If you’re hoping to connect a high-res external display to your USB-C equipped computer, read on.

 
Forget About HDMI

Lesson 1 is to focus on DisplayPort video connections, and forget about HDMI. You’ll never find a USB-C hub that offers better video capabilities through its HDMI port than through its DisplayPort, but you will find hubs that offer better DisplayPort resolution and refresh rates. I strongly suspect most hubs with an HDMI port are actually implemented internally as a DisplayPort, with an integrated DisplayPort to HDMI converter. This is because DisplayPort video can be carried more efficiently on the USB-C connection than HDMI for the same resolution and refresh rate.

DualMode DisplayPort++ connectors are able to function as HDMI connectors with a simple passive adapter (it does 3.3V to 5V level conversion). Regular DisplayPort connectors can’t do this, and require an active HDMI adapter with more built-in smarts. Otherwise I’m not aware of any difference between these two DisplayPort types.

 
Bandwidth Tradeoffs – It’s All About The Lanes

The 24 pin USB-C connector is the key to understanding. The diagrams below are from techdesignforums.com.

USB-C connectors have four differential pairs called “lanes” for carrying high speed data. There’s also a fifth differential pair D+ and D-, that carries old-style USB 2.0 data.

Let’s look at what happens when DisplayPort is added into the mix:

USB 3.1 Gen 2 only uses two of the four lanes, as shown in the top two rows of this table. The other two lanes are essentially wasted (they will be used by USB 3.2). These two lanes can be repurposed to carry a native DisplayPort signal, using what’s called DisplayPort Alternate Mode, as shown in the middle table rows. In this case the USB-C connector functions like a DisplayPort connector with a different shape and some extra wires for USB data. There’s no loss of USB 3.1 performance. To the computer and the external monitor, this looks exactly like a regular DisplayPort connection.

Two lanes for DisplayPort provide enough bandwidth for one external monitor at up to 4K 30Hz. That’s OK for watching movies, but a 30 Hz Windows or MacOS desktop experience is painful. To keep a 60 Hz refresh rate, you need to step down to 2K or lower resolution.

If you want 4K 60Hz, 5K, or multiple external monitors, then you’ll need to use DisplayPort Alternate Mode with all four lanes for DisplayPort data, as shown in the bottom rows of the table. To the computer and the external monitor, this still looks exactly like a regular DisplayPort connection. But now there are no lanes remaining for USB 3.1 data. There’s only the old D+/D- pair providing slower USB 2.0 data. That means any USB-C hub using this technique for 4K60 video can’t have any USB 3.1 ports on it.

External DisplayPort monitors can also be supported using zero dedicated lanes for DisplayPort Alternate Mode, with one of two approaches. If the computer’s USB-C port has Thunderbolt 3 capability, then DisplayPort data can be encapsulated within the Thunderbolt data stream. The video data becomes just one more type of packetized data multiplexed with everything else. Thunderbolt 3 has enough bandwidth to support multiple 4K60 video connections this way, with enough bandwidth remaining for USB 3.1 data too.

This is great, but Thunderbolt 3 hubs are expensive, and the computer must have Thunderbolt 3 capability, and many computers don’t. This also looks different to the computer – unlike DisplayPort Alternate Mode, there are no native DisplayPort signals and no direct connection to the computer’s GPU. It’s not clear to me whether there’s a performance penalty for treating video this way, or if it’s all handled magically by the chipset with no loss of performance. My hunch is there’s no performance penalty. If you know more, please tell me.

 
DisplayLink

The other method of supporting external monitors with zero dedicated lanes is DisplayLink. This technology compresses the video data on the host side, sends it over a USB 3.1 connection as generic data, and reconverts it to video on the other end using a special chip like the DL-6950. Conceptually it’s like a remote desktop connection for sharing your work computer’s screen when you’re logged in from home, except everything happens locally on your desktop.

DisplayLink is nice for squeezing high-resolution video over a lower-bandwidth connection like USB, or for supporting multiple high-res external monitors without Thunderbolt. But if you have any alternative, I think DisplayLink is best avoided. Here are some disadvantages:

  • Host-side driver software is required. Driver availability and compatibility for Mac/Linux is spotty to non-existent. This is why some USB-C hubs are advertised as not Mac-compatible.
     
  • The driver software can slow your computer. It implements a virtual graphics card performing on-the-fly compression of video data, which adds some CPU overhead.
     
  • When the computer is very busy or there’s a lot of other USB traffic, video artifacts will appear. You’ll see pixelation, stuttering, frame dropouts, and other problems. This is why some USB-C hubs are advertised as “not for gaming use”.

USB-C hubs utilizing DisplayLink work fundamentally differently than the others, but you probably wouldn’t realize that from reading the product descriptions and technical specs on Amazon or Newegg. If you don’t know what you’re looking for, it’s easy to buy a DisplayLink-based hub without realizing it, and suffer its shortcomings unnecessarily.

 
TL;DR – What are the Options?

Putting all this knowledge together, we can group USB-C hubs into four categories based on how they treat video. Here are some examples in each category.

 
4 Lanes for Video

These support external monitors up to 4K60, or possibly 5K, but can only provide USB 2.0 data. That’s not the fastest, but it’s enough for keyboards and mice and basic printers. They should work on any computer that supports DisplayPort Alternate Mode, and typically cost around $30.

Cable Matters 201046 $38 – 1x DisplayPort, power, ethernet, 1x USB2
Cable Matters 201055 $58 – 2x DisplayPort, power, ethernet, 2x USB2
Monoprice 24274 $28 – 1x DisplayPort, power
Cable Matters 201026 $20 – 1x DisplayPort, power
Baseus B07P713FPD $25 – 1x DisplayPort, power

 
2 Lanes for Video

These support external monitors up to 4K30 as well as USB 3.1 data. Many are advertised as simply “4K” without mentioning the refresh rate. They should work on any computer that supports DisplayPort Alternate Mode, and typically cost around $30-$150.

HooToo HT-UC001 $34 – 1x HDMI, 3x USB3, power, card reader
OmniMaster B07KRMRJZD $55 – 1x HDMI, 1x mini DisplayPort, power, ethernet, 2x USB3, card reader, mic
Anker AK-A83310A1 $40 – 1x HDMI, 3x USB3, ethernet
Vava VA-UC006 $45 – 1x HDMI, 3x USB3 Ports, power, ethernet, card reader
StarTech DK30C2DAGPD $114 – 2x DisplayPort (switchable 2 or 4 lanes), power, ethernet, 2x USB2/3

 
0 Lanes for Video – DisplayLink

These support multiple external monitors up to 4K60, or possibly 5K, as well as USB 3.1 data. But they generally are only compatible with Windows computers, not Macs or Linux machines, and they have other performance drawbacks. They cost around $150-$200.

Plugable UD-3900 $89 – includes 1x HDMI, 1x DVI
Plugable UD-ULTC4K $193 – includes 2x DisplayPort, 1x HDMI
Plugable UD-6950H $149 – includes 2x DisplayPort, 2x HDMI
SIIG JUDK0811S1 $199 – includes 2x DisplayPort, 2x HDMI

 
0 Lanes for Video – Thunderbolt 3

These support two external monitors up to 4K60, or possibly 5K, as well as USB 3.1 data. They should work on any computer that has Thunderbolt 3 support. They are the most expensive option, with a typical cost around $250 to $300.

OWC OWCTB3DK12PSG $249 – includes 1x mini DisplayPort, 1x Thunderbolt display
Plugable TBT3-UDV $249 – includes 1x DisplayPort, 1x Thunderbolt display
Cable Matters 107014 $239 – includes 1x HDMI, 1x Thunderbolt display
Kensington SD5200T $239 – includes 1x DisplayPort, 1x Thunderbolt display
Elgato 10DAA4101 $250 – includes 1x DisplayPort, 1x Thunderbolt display
Belkin F4U095tt $296 – includes 1x DisplayPort, 1x Thunderbolt display
CalDigit TS3 $310 – includes 1x DisplayPort, 1x Thunderbolt display

 
The Liars

Finally, we have an interesting category of off-brand USB-C hubs costing around $30 that claim 4K60 video support and USB3.1 data support. Search Amazon and you’ll find quite a few of these. Based on knowledge of USB-C and DisplayPort, we now know this is impossible without using DisplayLink or Thunderbolt 3. These products are all lying about their capabilities! They are very likely DisplayPort Alternate Mode designs using four lanes. They may have blue USB ports labeled “USB 3.1”, but as many of the reviews attest, they only provide USB 2.0 data speeds.

Koopman B07J4XSSXV $24 – 1x HDMI, power, 1x USB
WBPINE HUB3-1 $20 – 1x HDMI, power, 1x USB
Koopman B07M5DMYKY $32 – 1x HDMI, power, 3x USB
NEWPOWER B07PQ5GZK1 $30 – 1x HDMI, power, 3x USB

What’s been your experience with external monitors connected by USB-C? Leave a note in the comments.

 

Read 4 comments and join the conversation 

Floppy Emu May Feature Update

New features are blooming like May flowers for the Floppy Emu disk emulator. This firmware update has something for everyone!

Lisa

The emulated rotation speed of Lisa floppy disks can now be manually adjusted within a range of +/- 6 percent. This only affects the TACH signal that the Lisa uses to sense the drive speed – it has no effect on the actual bit rate which remains 500 Kbps. The speed adjustment is set after selecting “Lisa floppy” as the emulation mode. Adjustments may help some Lisa owners with hardware different from my test system and who reported disk speed errors.

Apple II

  • Smartport disk images can now have descriptive names like “SMART0-game-archive.PO”. So long as the filename begins with “SMART” plus a unit digit 0 through 3 it will be used for that Smartport unit. The rest of the name is ignored.
  • Added support for 40-track / 160K 5.25 inch disks
  • bug fix: NIB disks can now be ejected normally

All computers with Floppy Emu Model C

The OLED display will be dimmed after 30 seconds of inactivity. Any disk I/O or user interaction will return it to normal brightness.

 
Download the new firmware:

Mac/Lisa firmware: mac-lisa-0.8F-F14
Apple II firmware for Floppy Emu Model B and C: apple-II-0.2I-F25
Apple II firmware for Floppy Emu Model A: apple-II-0.2I-F22

Read 1 comment and join the conversation 

More AVR ICSP Footprints

I’m continuing to research options for alternative programming headers for AVR microcontrollers, building on the ideas I discussed earlier. For one-time programming purposes, the standard 3 x 2 pin 0.1 inch header is just… too big. I’m on the hunt for something that’s smaller, and that can be used on a bare footprint without actually soldering a header. The mockup above shows a 1.5 x 1.5 inch board with the options I’m considering, along with size references from a 32-pin AVR, an 0805 resistor, and a through-hole resistor.

A – The standard 3 x 2 footprint for 0.1 inch pin header.

B – 3 x 2 pin 0.1 inch footprint with zig-zag or lock hole spacing. This helps temporarily hold a header in place through friction.

C – 3 x 2 footprint for 0.05 inch pin header. It’s a lot smaller, but the hole spacing is tiny.

D – 3 x 2 pin footprint with zig-zag spacing for 0.05 inch pin header.

E – 3 x 2 pin footprint for pogo pins with 0.05 inch spacing. It’s nearly the same as C, except the drill holes are smaller. It’s designed for something like the Pogo Key, where the tips of pogo pins snap into the holes, but unlike C the pins don’t actually pass through the holes.

F – An alternative footprint for E. Two positions are holes to help align and stabilize the Pogo Key, and the other four positions are one-sided pads, so more of the PCB’s bottom side is available for other traces and components.

G – 6 x 1 pin footprint for pogo pins with 0.05 inch spacing, inspired by the Pogo ISP Micro. It’s essentially a Pogo Key with a linear layout instead of rectangular.

H – An alternative footprint for G. Two positions are holes to help align and stabilize the pogo pin adapter, and the other four positions are one-sided pads, so more of the PCB’s bottom side is available for other traces and components.

I – 6 x 1 pin footprint with zig-zag spacing for 0.05 inch pin header. Example

J – An alternative footprint for I. The six pins are split into groups of four and two, to prevent backwards insertion of the header.

KTag-Connect 6-pin no-legs version.

Here’s a look at the bottom side of the board. No surprises here, but just a visual reminder that the footprints using pads leave more empty space on the bottom for other purposes than the footprints using holes.

Is using pads better than using holes? I’m not sure. Pads leave the PCB’s bottom more open, but the signal routing for pads may require extra vias for switching between layers that wouldn’t be needed for holes, so it’s not a clear win. Holes also provide something for pogo pins to grip, and are the only way to use 0.05 inch header pins.

Is 0.05 inch spacing clearly better than 0.1 inch spacing? The footprints based on 0.05 inch spacing are obviously smaller, but the holes/pads are so closely spaced that there’s no room to squeeze a trace between them. The larger 0.1 inch spaced footprint is permeable to unrelated signal routing, so although it’s large, it’s not always a major impediment to board layout. The 0.05 inch spaced footprints are like walls that blocks all other signal traces.

I also see a risk of accidentally shorting neighboring holes/pads with the 0.05 inch spaced footprints. The copper of one is only about 10 mils away from its neighbor. If the programmer pins are slightly misaligned as they are lowered onto the board, a pin could land in the empty space between two holes/pads and cause a brief short circuit.

Are 6 x 1 linear footprints better than 3 x 2 rectangular ones? This is hard to answer. They’re the same total area. My first intuition was that 6 x 1 would be easier to fit into otherwise wasted space around the edges of the board. But after looking at it visually, I have an easier time imagining tucking that 3 x 2 into an unused spot than the 6 x 1.

 
And a Word About Tag Connect

Several people replied to my earlier post to say they’re happily using the Tag Connect cable. From what I’ve read elsewhere, they seem to have a loyal following. Its footprint K is arguably among the best of the options shown here. Yet I’ve almost totally ruled out the Tag Connect, for a reason that you might find silly.

The problem I have with Tag Connect is that it’s a cable and a pogo pin holder combined into a single unit. It’s designed to replace the existing cable on your AVR programmer, rather than attach to the end of the cable as with the other options discussed here. That means you have to purchase different versions of the Tag Connect cable depending on what programmer you have – one version fits the AVR ISP mkII, another fits the Atmel ICE, etc. If you’ve got a USBasp programmer, you’re out of luck, or will have to design your own adapter.

I own both an AVR ISP mkII and an Atmel ICE, so in theory I’d need to buy two different Tag Connect cables. If I wanted to have something assembled and programmed by a third party, I’d also have to worry about what model of programmer they have and whether a Tag Connect cable exists for it. The result would be a lot of hassle and equipment duplication, compared to any of the other options, where I could just snap an adapter onto the end of the existing programming cable.

Perhaps I could design my own adapter board for the generic Tag Connect cable, so any programmer’s 3 x 2 pin female header could plug into my adapter, and Tag Connect’s 3 x 2 pin female header could plug into another socket on the adapter. But this would result in twice the total cable length, which might impact signal quality and reduce the maximum possible bit rate for programming. Edit: I see that Tag Connect sells an adapter board like this for other MCUs, so maybe it’s fine and signal degradation isn’t a problem.

If Tag Connect sold something similar to the Pogo Key but with alignment pins, it would be a great option. But as things stand with the integrated cable, it complicates programming for anybody with multiple different programmers or who contracts third party programming with unknown programmer hardware.

Read 7 comments and join the conversation 

Take a Tour of BMOW Labs

They say you can tell a lot about a person by looking at his work-space. I thought it would be fun to take a break from stuffing boxes today, and make a short video tour of the BMOW Lair. I’ve mentioned before that it’s not a large space – just a single room about 150 square feet / 14 square meters. All BMOW engineering development, order fulfillment, and storage is crammed into this one room. It used to be a home study, but BMOW projects and supplies have slowly taken over and there’s barely any free floorspace left. So come on, take a look inside…

Be the first to comment! 

Alternative AVR Programming Header Ideas

That ubiquitous six pin header for in-circuit programming of Atmel AVR microcontrollers – it’s the standard, but it’s not a great standard where size and cost are a concern. Can I do better?

Programming most AVRs requires a six wire interface, with a clock, serial in, serial out, reset, power, and ground. It’s common to include a 3 x 2 pin 0.1 inch header on any AVR-based board. Typically a keyed box header is used to prevent accidental backwards cable attachment, like the header on the Adarfruit breakout board shown above, but sometimes bare 3 x 2 pin 0.1 inch headers are used.

That’s fine for hobbyist work or building a prototype, but when building larger numbers of AVR-based boards, the 3 x 2 pin 0.1 inch header has two significant drawbacks. The first is the component cost and related assembly cost for a header that will only ever be used once, for a few seconds during manufacturing. It’s not a huge cost, but it’s still a factor when trying to minimize the cost per unit – why throw away money? The second drawback is the relatively large physical size of the 3 x 2 pin 0.1 inch connector. For small boards containing mostly surface mounted parts, the ICSP header can complicate layout and routing, or require enlarging the PCB.

Ideally we want a programming connector with these attributes:

  • zero per-unit cost
  • small footprint, preferably one-sided
  • keyed to prevent backwards cable connections
  • holds cable firmly attached to the board

Here are some options to consider.

 
Empty Footprint 0.1 inch

The simplest option is keep the standard 3 x 2 pin 0.1 inch header footprint, but don’t actually solder a header into it. When it’s time to do programming, place a 3 x 2 header in the holes, and apply some sideways finger pressure to ensure the pins make solid contact with the hole plating. It’s low tech, but it works.

A small optimization is to use a 3 x 2 pin 0.1 inch lock header footprint, where the holes for the individual pins are very slightly offset instead of appearing in a perfect grid. This helps hold the header in place temporarily with friction, so finger pressure normally isn’t needed. It’s what I do for Floppy Emu programming, as shown here:

This approach eliminates the cost of an otherwise-useless programming header, but it’s still too big and doesn’t prevent backwards insertion. And even with the lock header footprint, it’s not great at holding the cable in place for extended periods of development or debugging. The pins often slide out of the holes.

 
Empty Footprint 0.05 inch

A second option is to use an empty 0.05 inch header footprint, which reduces the required board area to just 25% of original. That’s great, and this might be a good solution. But most AVR programmers have a 0.1 inch cable, so a 0.1 inch to 0.05 inch adapter will need to be built or purchased. That’s a minor drawback, but it only needs to be done once.

0.05 inch pin headers are fairly delicate. Would they hold up to hundreds of insertions and removals, with the added forces of finger pressure or lock headers?

This solution is also not keyed to prevent backwards cable insertion, nor does it grip the cable tightly.

 
Empty Non-Rectangular Footprint 0.05 inch

If I’m contemplating building a 0.1 inch to 0.05 inch adapter anyway, there’s no reason the 0.05 inch end needs to retain the standard 3 x 2 layout. I could do something with 4 pins in one row and 2 pins in a second row, or any other kind of irregular pin spacing that would prevent backwards cable insertion. Maybe a 7 pin single row design, with one of the pins removed. This would make the footprint area slightly larger than a 3 x 2 layout, but it might be worth it to prevent accidental backwards connections.

 
Pogo Pins

Any kind of footprint with plated-through holes will hinder routing and component placement on both sides of the board. Spring-loaded pogo pins provide an alternative approach, making it possible to build a one-sided programming interface with exposed pads, similar to this:

With 0.05 inch spaced pogo pins this allows for the smallest footprint of all, but the pogo pins need to be held against the board with one hand during programming, making it awkward to use. It’s OK for a programming operation lasting a few seconds, but not for anything longer.

This simple AVR ICSP pogo pin adapter from Tindie shows one such approach:

It’s nice, but there’s nothing to help align the cable or prevent backwards connections.

For a fancier solution, there are pogo pin cables from Tag-Connect that include alignment pins and optional locking legs to hold the cable firmly on the board:

But when you include the area needed for the alignment pin holes, the Tag-Connect footprint is essentially the same area as the standard 3 x 2 pin 0.1 inch header footprint, and the size advantage is lost. And with the version of the Tag-Connect cable that has locking legs, the required footprint area is even larger. Look at this beast:

 
Conclusion

So what’s the best option? I don’t think any of them is a clear winner – they all have advantages and disadvantages. I really like the idea of pogo pins and exposed PCB pads, but the required alignment pin holes mostly negate the space savings, and I don’t like the idea of always needing one hand to hold the cable in place. For my purposes, I think the non-rectangular footprint with 0.05 inch headers is worth exploring further. I’ll see what I can cobble together for testing.

Read 9 comments and join the conversation 

Daisy Chainer Testing

Good news: the Daisy Chainer for Floppy Emu is finished, and working nicely in all my tests. With the Daisy Chainer, a mix of real and emulated disk drives can be combined into a single Apple II daisy chain for maximum flexibility. The real drives can be attached before or after the Floppy Emu.

I have a few Daisy Chainer boards available for sale now. Send me an email if you’re interested in getting one (use the Contact link at the page’s upper-right).

Not-so-good news: newly-assembled Daisy Chainer boards are a pain to test, and this is something I didn’t account for. A true functional test requires connecting the board to a Floppy Emu, an Apple II, and a variety of other disk drives, and then running through many different permutations of daisy chain configuration and disk emulation modes. It requires 15 minutes or more. That’s OK for a few hand-assembled units, but there’s no way I can do that for a larger production run.

To support faster testing, I’ve designed two special test boards that plug into the male and female DB19 connectors on the Daisy Chainer. These will enable some automated loopback testing of the main board using its own microcontroller. It won’t be a perfect test, but combined with some other automated tests for things like pin-to-pin solder shorts it should detect most likely assembly defects.

The problem is that in order to support the automated testing with the special test boards, I need to make some modifications to the Daisy Chainer PCB. I’ve finished that work, but I’m waiting for PCB delivery and then I need to assemble a second prototype. So it will probably be at least a month until full production of more Daisy Chainers is possible.

This is the first time I’ve ever been forced to redesign a PCB not because there was a problem with the device itself, but simply because the device was difficult to test efficiently. Lesson learned: when designing anything that you expect to build more than 10 units of, planning for testing should be an integral part of the design process.

Read 2 comments and join the conversation 

Older Posts »