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

Thread: Isolate USB on Teensy 4.0?

  1. #1

    Isolate USB on Teensy 4.0?

    Hi.
    I'm currently designing a board who will have a T4 on it for a synthesizer project.
    I want to galvanically isolate the USB to get rid of groundloops or/and noise from my audio output.

    I have been reading some topics on isolation on earlier Teensy versions who use full speed USB (12Mbit/s). A working IC for that solution
    could be the the ADuM3160 or ADuM4160.

    However, the T4 uses USB high speed (480Mbit/s)? Is it possible to lower that in software to USB full speed?
    Or is the only "easy" way atm to limit it on the computer side to 12Mbit/s?

  2. #2
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    6,573
    I'd just use a 12Mbit hub. Maybe you find one with "isolation" (don't know if they exist?) or at least with external power.

  3. #3
    Senior Member
    Join Date
    Feb 2015
    Location
    Finland
    Posts
    172
    Since I happen to have both a Teensy 4 and an ADuM3160 USB isolator, I tested it.

    Teensy 4 works and programs fine with the USB isolator in 12 MBit/s (full speed) mode; no changes necessary. Just stick the isolator in between, and Teensy and the USB port will negotiate an USB 2.0 full speed (12 Mbit/s) connection.

    (ADuM3160 isolators often have a switch to select between 1 Mbit/s and 12 Mbit/s mode; mine does. In the 12 Mbit/s mode, it has a blue LED lit. I can't tell what the Chinese instructions on the backside say about the switch. It's a cheapie off eBay, but its schematic is clearly off the ADuM3160/4160 datasheet. The only thing "iffy" about it is the DC-DC converter, but it happens to be a MornSun one on mine, which seems to be a widely used, cheap but quite okay brand, as far as I know. I don't know much, though.)

    With 64-byte chunks, USB serial echoes slightly over 200,000 bytes per second (from the host to the Teensy 4 and back, over the USB isolator, power provided by an isolated DC-DC converter on the ADuM3160).
    This is obviously automatically limiting itself to USB full speed (12 Mbit/s). Without the isolator, using the exact same code (with no USB quirks or settings, just a plain Serial echo test), basically just yanking out the isolator, making no effort to even tell the Teensy code what it should do; and 64-byte chunks/messages, I get about 400,000 bytes per second. (With longer messages, you can get better bandwidth, but for now there is something in the USB stack that causes issues.)

    So, I'd say using an isolator is absolutely fine. T4 will automagically use full speed, no tricks or settings necessary. Just make sure you stay within the lower power budget (typically 300mA instead of full 500mA), or use an ADuM3160 isolator like the one Olimex sells that can inject power from a wall wart to the device side; and that the bandwidth suffices for your needs.

    Note: The host is a HP EliteBook 830 G3 running Linux. I tested both AC-connected and battery operation; both worked absolutely fine.

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    21,493
    Sadly, the only one I've tested so far (and the only one I've found that's affordable) I can confirm does *NOT* work.

    https://hifimediy.com/high-speed-usb-isolator-480Mbps

    However, their 12 Mbit/sec model does work nicely with Teensy 3.x.


    Or is the only "easy" way atm to limit it on the computer side to 12Mbit/s?
    This is on my to-do list. In theory, the PFSC bit in the USB1_PORTSC1 ought to do it. In practice, this hasn't been tested, and there are probably many subtle bugs in the USB code for running as 12 MBit/sec speed (which is the real reason it's on my to-do list...) since Teensy 4.0's USB code has really only been tested at 480 Mbit/sec speed.

  5. #5
    Thanks for the replies and the testing Nominal Animal!

    So it seems to "work" running and forcing 12Mbits/s, at least programming and serial com if i just "stick" an ADuM3160/4160 in between?
    Does it work for you Paul with the 12Mbit model (I can see it uses the ADuM4106)?

    12Mbit/s is totally fine for my application. Power is already separated and I'm only looking for a solution that i can put on a board.

  6. #6
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    21,493
    Good to hear 12 Mbit/sec is working. Maybe my fears of so little testings are a bit on the paranoid side.

Posting Permissions

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