Serial cable voltage should actually be 3.0V, with mod!
#1
I recently (early January) got my ANSI keyboard PBP, including the serial console cable I ordered. Based on other threads I knew the cable had an incorrect 5V signal level, but I wanted to investigate the situation a bit more myself.

So I looked at the schematics and RK3399 SoC datasheet, and realized that the UART signal voltage isn't 5V, but it isn't 3.3V either, as other threads have said... It's actually supposed to be 3.0V!

If you trace the signal from the headphone jack through the schematic, it leads you to the lower right corner of page 10:

[Image: uart-page10-lower-right.png]

This helpfully shows this group of pins on the SoC can be configured as 1.8V or 3.0V, but based on the connection of pin APIO4_VDD to 3.0V (see green circle) and a quick look at the datasheet, I concluded that in the PBP the correct voltage is 3.0V. These UART signals do go through U7002 to switch the jack between headphone and serial modes, but that does nothing to convert voltages.

I double-checked the voltage with a voltmeter on the PBP's TX line, which also indicated 3.0V.

My next question was whether the SoC could tolerate 3.3V on these pins, but I checked the datasheet and it indicates a maximum of 3.15V:

[Image: rk3399-gpio.png]

So not only is 5V too high, but so is 3.3V!

Unfortunately, 3.0V isn't a standard voltage for USB serial cables, and I didn't find any commercially available (but I didn't look too hard). And since I already had the 5V one from Pine64, I decided to mod it!

Here's the schematic of my mod. Original is in pencil; my changes are in blue:

[Image: pbp-uart.png]

There are conceptually two changes:
  1. Previously, the receive line had a 4.7K pullup resistor to 5V. I changed this to use a voltage divider that pulls up to 3V and has roughly the same impedance as the original, using an 8.2K resistor to 5V and a 12K resistor to ground. You could probably get away with leaving the 4.7K resistor in and just adding a 7K resistor to ground instead.
  2. I added a voltage divider on the transmit line to create 3V output signals using a 240 ohm series resistor and a 360 ohm resistor to ground.
The resistor values aren't super critical, but the ratios should be kept the same to ensure the right voltage.

The resulting cable shouldn't interfere with boot or WiFi, and it doesn't for me I verified that it works fine even at the crazy high 1.5Mbit/s speed used by the PBP, and the signals look pretty clean on a scope too.

Signal going from USB cable to PBP:

[Image: SDS00020.png]

And from PBP to USB cable:

[Image: SDS00021.png]




STEPS FOR THE MOD:

1. Pry the plastic of the USB connector end open with a screwdriver or spudger. It's friction fit but a bit tight. Twisting the cable strain relief may help get it open.

2. Remove the 4.7K surface mount pullup resistor, which was originally in the red circle:

[Image: IMG_1081.jpeg]

3. Wire the four new resistors in like this, making sure to insulate wires that cross using heat shrink tubing (black in the picture):

[Image: pbp-uart-wiring.png]

[Image: IMG_1084.jpeg]

I also cut out the red wire since it isn't needed and was getting in the way.

3. Insulate the resistor pairs with heat shrink tubing (blue in the picture) to ensure they don't short to each other or the metal crystal can to their left:

[Image: IMG_1085.jpeg]

4. Squeeze the plastic case back together.


Good luck! Seriously though, Pine64 needs to ship the proper cable!!!
  Reply
#2
This is super informative! Since we get instructions on how to fix the cable, I'm going to place a copy of this into Tutorials.
  Reply
#3
wait the minute, but this means, that owners of RockPro64 were exposing their boards to risk of damage all the time, since the Pi-2 bus UART pins are connected to the same 1.8/3.0V APIO4 domain. and the USB/UART adapter sold is 3.3/5V. did I understand it right and what @tllim can tell?

PS. Funny, the schematics states that SDMMC0 domain is also 1.8/3.0V, but that would be plainly stupid, right, it's probably a typo, since SD cards expect 3.3V at the beginning of operation. it was not enough for rockchip to introduce an insane 1.5Mbaud/s baud rate, it yet needed to set UART2 into an uncommon voltage.
  Reply
#4
It is possible that those 100R resistors give enough margin for a 0.3v difference in I/O voltage but, given the probelms people are observing with the 5v cable currently sold for PBP, they are not enough for the 2v difference if you use the official Pinebook UART cable.

Either way, this is a a great write up (albeit for a mod I was very disappointed to find we needed ;-) ). Was there enough space to put it back in the case?
PineTime: wasp-os and MicroPython, Pinebook Pro:  Debian Bullseye
  Reply
#5
@danielt I am zero in eletric stuff and this situation is a bit of worry, need clarification, so you are 100% sure it's safe to connect the adapter with 3.3V on the IO lines to the board pins that are 3.0V (esp. given the datasheet lists 3.15V as the maximum for them)? I mean the RockPro case.
  Reply
#6
(01-24-2020, 01:13 AM)danielt Wrote: It is possible that those 100R resistors give enough margin for a 0.3v difference in I/O voltage but, given the probelms people are observing with the 5v cable currently sold for PBP, they are not enough for the 2v difference if you use the official Pinebook UART cable.

Either way, this is a a great write up (albeit for a mod I was very disappointed to find we needed ;-) ). Was there enough space to put it back in the case?

I agree that the 100R resistors probably make it safe to use with 3.3V in practice, but it's still not ideal.

Yes, it fit back in the case just fine.
  Reply
#7
I have two thoughts here.

Firstly, the 5V cable adapter in the Pine store is wrong for the PBP because it is the wrong voltage and the wrong chipset.

Secondly, I have doubts the correct voltage is 3.0V Unlike 3.3 and 5V, 3V isn't a standard voltage for logic. Does anyone even make a 3.0V adapter?
  Reply
#8
(01-24-2020, 01:17 PM)zaius Wrote: Secondly, I have doubts the correct voltage is 3.0V Unlike 3.3 and 5V, 3V isn't a standard voltage for logic. Does anyone even make a 3.0V adapter?

I'm using my old Serial Debug with stereo jack that I've prepare 2 year for the original Pinbook-A64 and it is working well on PBP.
It is using a cheap USB-TTL CH340 dongle purchased on eBay, they have a jumper to select either 3V3 or 5V.
I have about 15 of those dongles, since I leave them attached to almost all my ARM boards, "almost" because I will need to purchase maybe 5 more ... :-)
  Reply
#9
(01-24-2020, 01:17 PM)zaius Wrote: I have two thoughts here.

Firstly, the 5V cable adapter in the Pine store is wrong for the PBP because it is the wrong voltage and the wrong chipset.

Secondly, I have doubts the correct voltage is 3.0V   Unlike 3.3 and 5V,  3V isn't a standard voltage for logic.  Does anyone even make a 3.0V adapter?

I agree that 3V is unusual, and nonstandard logic levels are almost never exposed on ports a user can access. But for some reason the RK3399 supports a choice between 3.0V and 1.8V (which is much more common but also not usually user-exposed) on the relevant pins, and the PBP engineers decided to use 3.0V.

Normally products that use nonstandard voltages internally would have logic level translators built in to give something standard externally, but I expect since the serial port is only a development/debug feature that was omitted to save on cost. So ideally Pine64 would make a custom cable to go with it.

That being said, given the series 100 ohm resistors in the PBP, using a 3.3V cable is unlikely to cause a problem in practice. So recommending people use 3.3V cables is probably OK.
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)