1 1
eyatsko

How to securely modify OrangePiH5orangepi.dts

Recommended Posts

Hello Community!

 

File /boot/orangepi/OrangePiH5orangepi.dts is not self-explanatory.. :-(

 

Is there any documentation on how to define GPIO.21 for example for DIGITAL OUTPUT with initial "Logical ONE" at a BOOT time?

It will control Triac with 220 Volts on it. IT MUST BE EXACTLY AT HIGH LEVEL AT A BOOT TIME. How to do this? It should be in OUT mode.

 

Any help appreciated!...

 

Regards,

Ellad

 

 

Share this post


Link to post
Share on other sites
48 minutes ago, eyatsko said:

/boot/orangepi/OrangePiH5orangepi.dts

First, this file doesn't exist in Armbian, so you are using probably default BSP from Xunlong...

50 minutes ago, eyatsko said:

It will control Triac with 220 Volts on it. IT MUST BE EXACTLY AT HIGH LEVEL AT A BOOT TIME.

Even if you would tweak DT to get GPIO as output, there will be quite long delay before it becomes initialized by kernel, since during all u-boot execution, it will stay floating.

So, you are better designing your hardware according to this fact. Your main triac is on 220V side, you should use an opto-triac to control it's gate, then opto-triac diode anode to +3V while cathode is on GPIO.

This way, if GPIO is floating, triac will stay Off, only when GPIO will become output LOW that it will start be conductive.

Share this post


Link to post
Share on other sites

MOC3063 used... :-) Diagram is from its typical apllication. It works very good. Nothing terrible will happen if there is a delay. Just Triac will be switched twice.  I'd like to avoid this. If it is impossible, well...

 

But how to tweak DT? I certainly need this. To define GPIO as OUT and to set it to "LOGICAL ONE".

 

Kind regards and thanx a lot for rapid response,

Ellad

Share this post


Link to post
Share on other sites
8 minutes ago, eyatsko said:

Nothing terrible will happen if there is a delay. Just Triac will be switched twice. 

Why twice ?

9 minutes ago, eyatsko said:

But how to tweak DT? I certainly need this.

https://www.kernel.org/doc/Documentation/devicetree/bindings/gpio/gpio.txt

 

But you can simply control GPIOs from userspace using sysfs, for example here is flashing script on GPIO72 :

#!/bin/bash

echo 72 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio72/direction

while true; do
	echo 0 > /sys/class/gpio/gpio72/value
	sleep 0.25
	echo 1 > /sys/class/gpio/gpio72/value
	sleep 0.25
done

 

Share this post


Link to post
Share on other sites

I'm afraid I have no such opportunity:

echo 29 > /sys/class/gpio_sw/ <Tab> <Tab> <Tab>

No such catalog: "/sys/class/gpio/export"

 

 

May you give me a simple example "to insert"..

For example, how to define Pin29 "PA7" a.k.a. "GPIO.21" to make it be "Mode=OUT, V=1"

 

"Twice" - it's because all pins according to "gpio readall" have "0". So Triac will be switched on. Then when OS will be loaded up to my script execution my BASH-script will re-define pins as OUTPUTs and set them to "1". Triac will be switched off..

I'm searching a way to define then INITIALLY to "1" as OUTPUTs. It is not so good for my shelf with Cisco 3560 Switches.. :-) (my home bench for CCNP studying).

 

OrangePiH5orangepi.dts

Share this post


Link to post
Share on other sites
2 minutes ago, eyatsko said:

I'm afraid I have no such opportunity:

echo 29 > /sys/class/gpio_sw/ <Tab> <Tab> <Tab>

No such catalog: "/sys/class/gpio/export"

Make sure to use an Armbian image as the OS, otherwise we won't be able to support you, since BSP image isn't coming from Armbian team.

Share this post


Link to post
Share on other sites

This one:

root@pdu-orange:/boot/orangepi# cat /etc/issue
Ubuntu 16.04.1 LTS \n \l

root@pdu-orange:/boot/orangepi# uname -a
Linux pdu-orange.eyatsko.msk 3.10.65 #55 SMP PREEMPT Fri Nov 18 16:17:28 CST 2016 aarch64 aarch64 aarch64 GNU/Linux
root@pdu-orange:/boot/orangepi#

 

Share this post


Link to post
Share on other sites
8 minutes ago, eyatsko said:

There is no such file.

Because you are not running an Armbian image ... :lol:

 

If you wish to use my above GPIO Flasher script, take the effort to use an Armbian image, everything will be resolved !

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
1 1