USB connector switch

Looking at the different datasheets and documentation the USB connection can be switched between the Renesas and ESP32 processor (default) This can be done with the U2 and U6 analog switch. Looking at the schematics I am confused.

The SJ1 should be connected to make the switch, but it seems that Renesas P408 could also be used for that. The P408 is defined in variant.cpp with offset 21 but there is no D21 defined in pin_arduino.h. I have not seen this documented somewhere else (yet... maybe I missed it) but Is the P408 link still correct?

In the schematics, I see what looks to be 0 resistors connecting the USB to ESP and RA4 N and P pins.
USBCON
If R21, R53, R54 and R55 are zero, what is the use of U2 and U6? If not resistors what are they?

regards,
Paul

1 Like

Schematic including U2 & U6:

Is there a note somewhere else that R21, R53, R54 and R55 are "Do Not Fit"?

there is 0 next to the resistors

Wondered about that also but I looked with the interactive viewer (bottom page of https://docs.arduino.cc/hardware/uno-r4-wifi). It seems that they are populated just below U2 and U6. Also looking at my board I "think" I see them (but it is too small for my eyes to be 100% sure :smile: )

regards,
Paul

That just indicates that they are zero-ohm links.

As @paulvha said, if zero-ohm links were fitted in those positions they would, indeed, render U2 & U6 useless, and connect the USB DP & DN directly to both the ESP and the Renesas!

https://docs.arduino.cc/tutorials/uno-r4-wifi/cheat-sheet#usb-bridge

Again, if those zero-ohm links are fitted, then that cannot work!

R21 & R53 short-circuit U2;
R54 & R55 short-circuit U6.

Correction:
R21 & R54 short-circuit U2;
R53 & R55 short-circuit U6.

Maybe this makes it clearer:

R21 & R54 short-circuit U2:

R53 & R55 short-circuit U6:

Thanks. That would explain P408... The document states to use D40, it is just there is no D40 and there is NO offset 40 defined in variant.cpp. P408 is on offset 21 in the table.

Next to that, I wonder what happens if you pull P408 low while JS1 is connected..... I expect you to destroy at least P408 port if not worse....

it is pin 21

exactly... offset is 21 not even, D21as it does not exist. That is the easy part to fix in my mind with better documentation.

The hardware is more concerning:
Are these resistors bypassing U2 and U6 already?

What if you set P408 LOW and have Js1 connected.. you then connect +5V through P408 to GND.. I expect P408 port is destroyed and maybe more..
You should do NOT that... but an error is easily made. There is NO warning about this and could have been avoided with resistor(s).

regards,
Paul

If they are as shown in that schematic, then they would.

If they are as shown in that schematic, then both the ESP and the Renesas would be connected direct to the USB DP & DN.

So either that schematic is wrong, or those resistors are (or should be) not actually fitted.

Just to show the locations. With a bit of luck and magnifier, (and much better eyes then mine) you might be able to spot R21 and R53
R21
r21_location
R53
R53_location
R54
R54_location
R55
R55_location

it is something forgotten in the schematics. it is not on the board.
https://docs.arduino.cc/hardware/uno-r4-wifi

I hope so, but it hard to see. It looks that something is in place on the left-hand sides of U2 and U6
R-loc

It has to be - or it just wouldn't work!

How does that link help? There's no schematics on the page.

Scroll all the way down in Resources.

2 Likes

sorry, I didn't notice it didn't add #resources

the interactive PCB viewer is good

1 Like

There's something wrong there: those resistors are underneath the U2 and U6 chips!
You can't do that with SMD!

eg, The 3D viewer shows R21 cutting through a leg of U2:

Somebody didn't run DRC

1 Like

So, on the PCB view...

Here's U2:

And R54 & R21 are right underneath it:

image

So it must be a case that they fit either U2 or (one of?) R54 & R21.

Similarly for U6 and R53 & R55.

1 Like

Thanks, I agree with you. As a last test now also having done a cold ohm/resistance measurement, there is only a 5 Mega-ohm (thus NO) connection to either ESP or RA4 between USB pins.

That leaves 3 issues:

  1. The schematics need to be updated to reflect "do not populate"
  2. The documentation needs to be updated to reflect that 21 instead of 40 should be used for SW USB switch.
  3. The documentation needs to include a warning NOT to apply the USB HW and SW switch at the same time, as pulling P408 LOW will cause a short circuit causing serious damage.

regards,
Paul

1 Like