Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Gpio questions on useage

Featured Replies

I am looking for some recommendations for using the Gpio on the opi PC ( with uname -r 5.7.15-sunxi )


The project is to open and close a glass house door using a temperature probe ( ds18B20 ) and a relay control board ( opto coupled with active low input ).
Later I will add automatic watering relay board.

 

The pins I would like to use are

Inputs

PC0     used for ds18B20   (SPI0_MOSI)    because it is an Input

PC4    Door closed switch         Internal pullup            
PC7    Door is fully open switch     Internal pullup
PC3     Input to be used later(SPI0_CS) Innternal pullup

 

Outputs
PD14            output  MC  motor close door
PC1     (SPI0_MISO)    output  MC  motor close door    because it is an output


Proposed outputs to be used later

PA0    (UART2_TX/JTAG_MS/PA_EINT0)    
PA11    (TWI0_SCK/DI_TX/PA_EINT11)
PA13 (SPI1_CS/UART3_TX/PA_EINT13)
    
PG6    (UART1_TX/PG_EINT6)

 

Data  from Allwinner H3 Datasheet

 

I am using these commands to set inputs
echo 71 > /sys/class/gpio/export
echo "in" > /sys/class/gpio/gpio71/direction

 

My questions are:
1) what do you think of the chosen pins?
2) Do I need to do anything to configure inputs to use pullups?
3) How can I set output pins to start out as high so as not to trigger the relay on startup?
    I am trying to use  for outup
                  echo 110 > /sys/class/gpio/export                #    pin12    PD14    MCD o/p relay    110
                  echo "out" > /sys/class/gpio/gpio110/direction
                  echo 1 > /sys/class/gpio/gpio110/value    
which causes the relay to turn ON then OFF

 

Thanks for all of your advice
Dave
 

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.