GPIO questions\suggestions

Moderators: odroid, mdrjr

GPIO questions\suggestions

Unread postby mastertheknife » Tue Feb 13, 2018 6:26 pm

I have a few questions\suggestions.

1) Looking at the RK3399 datasheet, it supports 3 different GPIO voltages: 1.8V, 3.0V and 3.3V.
The problem with 3.0V, is that the input high threshold is up to 3.15V, which means that 3.3V signals will require a level shifter\voltage divider, or risk damaging the chip, which makes it impossible to use RPI\C1\C2 addons on the N1 without adjustments.
2) The RK3399 has 5 UARTs, but the N1 is using UART #0 for serial console and UART #2 on the 40pin header. Is it possible to add another UART to the 40pin header?
3) Same for PWM. The RK3399 has 4 PWMs, but the N1 is using one for fan control, and another one is located in the 40pin header. Could be nice to have a 2nd PWM in the 40pin header.


Edit: Edited the title to be more accurate
Last edited by mastertheknife on Wed Feb 14, 2018 5:15 pm, edited 3 times in total.
mastertheknife
 
Posts: 11
Joined: Fri Apr 14, 2017 3:34 pm
languages_spoken: english, hebrew
ODROIDs: C2

Re: Hardware questions\suggestions

Unread postby odroid » Tue Feb 13, 2018 6:49 pm

Once we release the N1 schematics within a couple of days, let's check the feasibility together.
User avatar
odroid
Site Admin
 
Posts: 29098
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: Hardware questions\suggestions

Unread postby mastertheknife » Tue Feb 13, 2018 7:13 pm

Good idea regarding #2 and #3.
mastertheknife
 
Posts: 11
Joined: Fri Apr 14, 2017 3:34 pm
languages_spoken: english, hebrew
ODROIDs: C2

Re: Hardware questions\suggestions

Unread postby willmore » Tue Feb 13, 2018 9:02 pm

mastertheknife wrote:I have a few questions\suggestions.

1) Looking at the RK3399 datasheet, it supports 3 different GPIO voltages: 1.8V, 3.0V and 3.3V.
The problem with 3.0V, is that the input high threshold is up to 3.15V, which means that 3.3V signals will require a level shifter\voltage divider, or risk damaging the chip, which makes it impossible to use RPI\C1\C2 addons on the N1 without adjustments.


I'm not sure I'm clear on what you're saying about choosing 3.0V as the GPIO voltage. Specifically "is that the input high threshold is up to 3.15V". The input threshold of a 3.0V CMOS pin would be 1.5V(+a small hysteresis). What is the 3.15V value you're talking about coming from? Is that the V(OH) of a 3.3V CMOS signal?

I agree that using 3.0V for the GPIO port is very strange. Unless all of the inputs are safely 3.3V tolerant, it seems like a very poor choice.
willmore
 
Posts: 10
Joined: Mon Aug 29, 2016 2:37 am
languages_spoken: english
ODROIDs: C1 x1
C2 x2

Re: Hardware questions\suggestions

Unread postby mastertheknife » Tue Feb 13, 2018 9:18 pm

willmore wrote:
mastertheknife wrote:I have a few questions\suggestions.

1) Looking at the RK3399 datasheet, it supports 3 different GPIO voltages: 1.8V, 3.0V and 3.3V.
The problem with 3.0V, is that the input high threshold is up to 3.15V, which means that 3.3V signals will require a level shifter\voltage divider, or risk damaging the chip, which makes it impossible to use RPI\C1\C2 addons on the N1 without adjustments.


I'm not sure I'm clear on what you're saying about choosing 3.0V as the GPIO voltage. Specifically "is that the input high threshold is up to 3.15V". The input threshold of a 3.0V CMOS pin would be 1.5V(+a small hysteresis). What is the 3.15V value you're talking about coming from? Is that the V(OH) of a 3.3V CMOS signal?

I agree that using 3.0V for the GPIO port is very strange. Unless all of the inputs are safely 3.3V tolerant, it seems like a very poor choice.


Hi,

I took that from the RK3399 datasheet at page 64:
http://opensource.rock-chips.com/images/6/60/Rockchip_RK3399_Datasheet_V1.6-20170301.pdf
What i am seeing, is that the input high voltage V(IH) is between 1.875V and 3.15V in GPIO 3.0V operation.

Attached a screenshot of the table from the datasheet:
Image
mastertheknife
 
Posts: 11
Joined: Fri Apr 14, 2017 3:34 pm
languages_spoken: english, hebrew
ODROIDs: C2

Re: Hardware questions\suggestions

Unread postby mbili » Wed Feb 14, 2018 4:36 am

mastertheknife wrote:
I took that from the RK3399 datasheet at page 64:
http://opensource.rock-chips.com/images/6/60/Rockchip_RK3399_Datasheet_V1.6-20170301.pdf
What i am seeing, is that the input high voltage V(IH) is between 1.875V and 3.15V in GPIO 3.0V operation.
...


For regular operation of chip V(IH) can be between 1.875V and 3.15V in GPIO 3.0V operation. If it is lower than 1.875V (between threshold at 0.93V (typical) and 1.875V) it is not guaranteed that it will be interpreted as logic 1 and if it is higher than 3.15V then input overvoltage condition occurs with adequate consequences.
mbili
 
Posts: 10
Joined: Tue Jun 21, 2016 5:10 am
languages_spoken: english
ODROIDs: XU4, C2, C1+, HC2

Re: Hardware questions\suggestions

Unread postby mastertheknife » Wed Feb 14, 2018 5:14 pm

mbili wrote:
mastertheknife wrote:
I took that from the RK3399 datasheet at page 64:
http://opensource.rock-chips.com/images/6/60/Rockchip_RK3399_Datasheet_V1.6-20170301.pdf
What i am seeing, is that the input high voltage V(IH) is between 1.875V and 3.15V in GPIO 3.0V operation.
...
if it is higher than 3.15V then input overvoltage condition occurs with adequate consequences.


That is what i am saying. This makes the inputs not 3.3V tolerant, so interfacing with 3.3V logic is not possible without a level shifter\voltage divider or any solution to lower the voltage from 3.3V to 3.0V.
mastertheknife
 
Posts: 11
Joined: Fri Apr 14, 2017 3:34 pm
languages_spoken: english, hebrew
ODROIDs: C2

Re: Hardware questions\suggestions

Unread postby odroid » Wed Feb 14, 2018 5:19 pm

We've tested various 40pin compatible add-on boards with N1 samples.
They worked well because they used 3.0Volt from Pin#1 and #17.
Image

If your add-on boards have its own 3.3volt power source, there should be the voltage tolerance issue.
Anyway, we will try to change the voltage level to 3.3V from 3.0V in the mass production PCB revision if there is no negative side effect.
User avatar
odroid
Site Admin
 
Posts: 29098
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: Hardware questions\suggestions

Unread postby Matioupi » Sun Feb 18, 2018 3:57 am

odroid wrote:Anyway, we will try to change the voltage level to 3.3V from 3.0V in the mass production PCB revision if there is no negative side effect.


That would be really great !!!
Matioupi
 
Posts: 48
Joined: Fri Aug 05, 2016 3:56 pm
languages_spoken: english

Re: GPIO questions\suggestions

Unread postby hominoid » Sun Feb 18, 2018 7:06 am

I agree, output should be 3.3v if possible.
hominoid
 
Posts: 188
Joined: Tue Feb 28, 2017 3:55 am
Location: Lake Superior Basin, USA
languages_spoken: english
ODROIDs: C2, XU4, MC1, N1

Re: GPIO questions\suggestions

Unread postby odroid » Fri Mar 02, 2018 4:03 pm

Rockchip RK3399 Datasheet v1.6-20170301.pdf
http://opensource.rock-chips.com/images ... 170301.pdf
Section 3.2. Recommended Operating Conditions
>>>>> Supply voltage for digital GPIO@3.0V mode : max 3.15V

3.0V capable GPIO block 2 and 4 are used for the 40pin header.
3.3V capable GPIO block 1 is used for other purposes.

So we can't change the IO level to 3.3V probably due to the SoC design limitation.
User avatar
odroid
Site Admin
 
Posts: 29098
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: GPIO questions\suggestions

Unread postby elatllat » Fri Mar 02, 2018 10:47 pm

What % of popular components use 1.8/3/3.3/5?
Is 1.8 worth considering?
something like the shifter for the XU4 could be used...
Last edited by elatllat on Sat Mar 03, 2018 2:59 am, edited 1 time in total.
elatllat
 
Posts: 1096
Joined: Tue Sep 01, 2015 8:54 am
languages_spoken: english
ODROIDs: XU4, N1

Re: GPIO questions\suggestions

Unread postby rooted » Sat Mar 03, 2018 2:08 am

Most stuff I look at is 3.3
User avatar
rooted
 
Posts: 5897
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english

Re: GPIO questions\suggestions

Unread postby mad_ady » Sat Mar 03, 2018 2:46 am

Maybe HK could look into a mini shifter shield from 3.0 to 3.3V, but I think it should be compact (like a raiser shield).
I'm going to try to use a relay and a pir sensor on the N1 and see how it behaves compared to a C2.

Edit: I was initially thinking of a voltage divider, but I remembered the voltage needs to be increased, not lowered. Maybe a transistor with the base hooked up to each N1's GPIO could do the trick, be fast enough in switching time and be compact enough. Would it work?
User avatar
mad_ady
 
Posts: 4917
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: GPIO questions\suggestions

Unread postby odroid » Sat Mar 03, 2018 7:56 am

If you need a unidirectional level shifter, a transistor(for output) or a resistor-divider(for input) should be enough.
But, we have to consider bidirectional level shifters like our shifter-shield for XU4.

One of the most strange behavior in the SoC design. They should adopt 3.3Volt IO, not 3.0Volt. :evil:
User avatar
odroid
Site Admin
 
Posts: 29098
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: GPIO questions\suggestions

Unread postby mad_ady » Sat Mar 03, 2018 1:18 pm

Oh, I forgot the pins can be used as inputs - so it's not a simple workaround. We'll see if simple peripherals can work at 3.0V.
User avatar
mad_ady
 
Posts: 4917
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: GPIO questions\suggestions

Unread postby crashoverride » Sat Mar 03, 2018 1:41 pm

My suggestion (feel free to flame me :D ) is to remove the 40 pin connector and replace it with a physically smaller connector. If GPIO is not 3.3v tolerant, it is just inviting RMAs. The space saved on the board could then be used to provide additional IO lines (like I2S). This implies that N1 would need a "Shifter Shield" just like XU4 for "PI compatible" GPIO. However, unlike XU4, most custom interfacing projects will not require anything extra if they use the 3V0 as a supply line.

The danger area is any GPIO board using external power or generating 3V3 from the 5V0 supply.
crashoverride
 
Posts: 4139
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1

Re: GPIO questions\suggestions

Unread postby mad_ady » Sat Mar 03, 2018 3:01 pm

That sounds sensible. If it's not 3.3V tolerant (maybe HK should risk burning a few N1s to try out some 3.3V things) then it should be designed not to accept 3.3V shields. However, I suspect that most gpio accessories get their power from the board and will try to operate at 3V, which should not be dangerous for the board, but might result in the accessory not working. If some work and some don't, but none fries the n1, then the 40 pins can be kept as is.
User avatar
mad_ady
 
Posts: 4917
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: GPIO questions\suggestions

Unread postby elatllat » Sat Mar 03, 2018 11:52 pm

Is anyone using the GPIO on the XU4 without conversion?
maybe the light version can have no fan, no GPIO, no sata, no usb2.
I2S / audio is attractive though.
elatllat
 
Posts: 1096
Joined: Tue Sep 01, 2015 8:54 am
languages_spoken: english
ODROIDs: XU4, N1

Re: GPIO questions\suggestions

Unread postby mad_ady » Sun Mar 04, 2018 1:51 am

I'm using xu4's gpio without the shifter shield, but I drive transistors with the gpio pins, so that doesn't count...
User avatar
mad_ady
 
Posts: 4917
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: GPIO questions\suggestions

Unread postby mad_ady » Mon Mar 12, 2018 8:52 pm

I've tested the N1 with a Sainsmart relay board (https://www.sainsmart.com/products/2-ch ... lay-module) and thankfully you can toggle the relay on/off without any changes (it's rated for 5V, but 3V seems to be enough for a strong level).

It seems that for 5V TTL devices, the high signal is acceptable if it's between 2-5V, while the low signal is between 0-0.8V. The same is true for 3.3V TTL devices.

I will test input as well (that's more risky), but output should be ok at 3V. I'll measure the voltage from my device to see what happens.
User avatar
mad_ady
 
Posts: 4917
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: GPIO questions\suggestions

Unread postby mad_ady » Tue Mar 13, 2018 12:13 am

Ok, I'm ready to test input. I'm using a PIR sensor that outputs 0V for no presence and 3.32V for presence detected. It's powered from 5V, from the board. I've tested it with a multimeter.
The question is:
1. I could make a voltage divider with a 330 ohm resistor and two 1k resistors in series and that would get the output to 2.85V (which should be a logical 1).
2. Could I use only one resistor between the circuit output and the GPIO? Hoping that it would cause a voltage drop and regulate the output voltage? Would it be enough?
3. I could wire the output directly to the GPIO and experiment with overvoltage. It might burn the N1 (which would be a shame), so - I'd like to ask - @odroid - have you tried 3.3V on the N1's 3.0V pins? If you have a partially broken N1, could you try it?
User avatar
mad_ady
 
Posts: 4917
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: GPIO questions\suggestions

Unread postby rooted » Tue Mar 13, 2018 12:45 am

mad_ady wrote:3. I could wire the output directly to the GPIO and experiment with overvoltage. It might burn the N1 (which would be a shame), so - I'd like to ask - @odroid - have you tried 3.3V on the N1's 3.0V pins? If you have a partially broken N1, could you try it?


Don't risk it, things like this should be tested by Hardkernel IMO. They have access to more than one device and your testing is too valuable to risk your single device...again IMO.
User avatar
rooted
 
Posts: 5897
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english

Re: GPIO questions\suggestions

Unread postby odroid » Tue Mar 13, 2018 11:38 am

1. According to the RK3399 datasheet, the Threshold Point is around 0.8V ~ 1.1Volt. So 2.85V should be fine for detecting a logical high.
But, 330ohms + 1Kohms seems to be too low resistance which can consume around ~3mA continuously.
Increase the resistor values ~10 times.

2. No. Don't do that.
Most GPIO input resistance should be higher than 1Mohm if you disable the internal pull-up/pull-down resistors.
So the voltage drop must be negligible.

3. We've tried to increase the GPIO block input voltage to 3.3V from 3.0V by adjusting the PMIC control driver in u-boot.
It worked well. But Rockchip didn't recommend it and we abandoned that option since we can't guarantee the electrical endurance.
If we keep the GPIO block voltage at 3.0Volt, the maximum input voltage is 3.15V(5% tolerance) as described in the RK3399 datasheet.

So your #1 approach is the safe way to connect an external input device.
User avatar
odroid
Site Admin
 
Posts: 29098
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: GPIO questions\suggestions

Unread postby mad_ady » Tue Mar 13, 2018 3:53 pm

So, for #1, I don't think that the current is an issue - because the GPIO will be set as input and the current will flow from the sensor. I'm guessing the sensor is not outputting too high current. I'll try it.
Thanks for clearing #2 and #3.
For #3, I take it that it's just a software adjustment to switch between 3.0 and 3.3V, right? I'm guessing there will be people interested in tweaking their boards to run at 3.3V if hardware is unchanged (like overclocking).
User avatar
mad_ady
 
Posts: 4917
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: GPIO questions\suggestions

Unread postby odroid » Tue Mar 13, 2018 3:59 pm

It could be a big fear once we get a lot of RMAs due to the over-voltage. ;)
User avatar
odroid
Site Admin
 
Posts: 29098
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: GPIO questions\suggestions

Unread postby mad_ady » Tue Mar 13, 2018 4:02 pm

You're right, I understand. You don't have a "fuse" like that can be burned to indicate over voltage...
User avatar
mad_ady
 
Posts: 4917
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: GPIO questions\suggestions

Unread postby mad_ady » Wed Mar 21, 2018 12:26 am

Ok, I experimented with the voltage divider (one 330 ohm resistor + one 4.7k resistor). It reduced 3.3V input to 2.6V, which registered as a "1". There are no big issues (apart from having extra wires/resistors, but that's life).
Also, first I made an error and sent -2.6V into the input GPIO pin because I wired it wrong, but nothing was burned. So that's nice :D
User avatar
mad_ady
 
Posts: 4917
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1


Return to Hardware and peripherals

Who is online

Users browsing this forum: No registered users and 1 guest