0.5V on PG10

Started by jonas.dorel, February 06, 2019, 09:09:54 PM

Previous topic - Next topic

jonas.dorel

Hi,
I noticed that when trying to turn on the UART4 TX (PG10 / GPIO1 25), its voltage is 0.5V, instead of the 3.3V I see on other pins. Does anyone else have this issue ?

I am using the following code

# GPIO Control

from pyA20Lime2.gpio import gpio
from pyA20Lime2.gpio import port
from pyA20Lime2.gpio import connector

gpio.init()

de = port.PC20
re = port.PC19
tx = port.PG10
rx = port.PG11

gpio.setcfg(de, 1) # 0 is INPUT, 1 is OUTPUT.
gpio.output(tx, 1) # 0 is LOW, 1 is HIGH.

LubOlimex

Technical support and documentation manager at Olimex

jonas.dorel

#2
I don't understand the question as I am using the library from the link.

It also works fine when I put the TX pin to LOW, its voltage is 0v.

Jonathan Fether

#3
Hello Jonas,

   I had a similar problem with the A20-SOM204 which turned out to be a regulator not enabled that supplied the A20's ball E18 "VCC_CSI1/VCC-PG" which resulted in very low voltage levels on port G.

https://www.olimex.com/forum/index.php?topic=6688.msg26117#msg26117

   The fix was a change in the device tree that I pointed to in that message. Edit the device tree source of the board and add a "regulator-always-on;" clause to &reg_ldo4, then recompile the device tree, back up the original, and replace the one in your /boot/dtb directory.

   Probably easier, if you're using Armbian and have a working armbian-add-overlay command, is to just use this Device tree source file:


/dts-v1/;
/plugin/;

/ {
    compatible = "allwinner,sun7i-a20";

    fragment@0 {
        target = <&reg_ldo4>;
        __overlay__ {
            regulator-always-on;
        };
    };
};


Save that to a file such as "ldo4-always-on.dts" and use "armbian-add-overlay ldo4-always-on.dts" to compile it and add it to the U-Boot config file (/boot/armbianEnv.txt, the overlay would compile as /boot/overlay-user/ldo4-always-on.dts). Getting the armbian-add-overlay command to work has been a little tricky in my experience due to a kernel headers issue and a wrong version of the device tree compiler that doesn't support symbols (-@ flag). You may need to play with it a bit. That tells the AXP204 to enable 3.3V to the LDO4_3.3V power net and this supplies Port G.

Best regards,
-Jon

jonas.dorel

Thanks, it worked like a charm. To be honest I would never have thought about this...

Note: for now, on Debian, the dtc version in the stable repos cannot compile symbols, so I add to get the latest version from the test repos.