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.

WiringOP version 2.46 or 2.48 seems changed but not working input selection pull up/down

Featured Replies

Hello,

I cloned the master branch of WiringOP one month ago, it reported same version 2.46 and it was working except for the option to activate internal pull up/down.

Trying it in C code using:

pullUpDnControl(n, PUD_DOWN);

or by terminal with:

gpio mode 1 down

same behavior, nothing happen.. by default, unfortunately in my case, it seem active a pull up resistor for all inputs.

 

I searched on the web and found there was a bug, fixed.

I checked again the main branch and in effect it is different now, the new code is:

    *(gpio + GPPUD)              = pud & 3 ;		delayMicroseconds (5) ;
    *(gpio + gpioToPUDCLK [pin]) = 1 << (pin & 31) ;	delayMicroseconds (5) ;
    
    *(gpio + GPPUD)              = 0 ;			delayMicroseconds (5) ;
    *(gpio + gpioToPUDCLK [pin]) = 0 ;			delayMicroseconds (5) ;

but executing it I get "segmentation fault", debugging deeply the reason is that "gpio" address is zero.

 

I tried to clone the "next" branch but it is even worst, it won't compile, many errors, log from terminal attached.

 

What I can do in order to fix.. of simply to setup all inputs with pulldown resistor active?

Thanks in advance

Andrea

 

log.txt

Hello Andrea, I have the same wiringOP version and also in my case it seems the Orange Pi pulls the input UP by default without considering the SW setup cmd (pullUpDnControl(0, PUD_DOWN);) --- By the way I'm using a OPi ZERO.

Is there somebody that can help with a solution or just a workaround?

At the moment I've added a pull-down resistor of 1.8kOhm. Therefore the two voltage states are 1.0 and 2.1 (instead of 0 and 3.3). It works but I'm wondering if it is possible to improve. 

Many thanks!

Edited by SergioAiello

Additionally the cmd gpioRead stops working after ISR setup

 

   printf (" main1 - %d\n", digitalRead (2));

   wiringPiISR (2, INT_EDGE_BOTH, myInterrupt1) ; 
   printf (" main2 %d\n", digitalRead (2));
 

output:

root@MansaConsMon:/home/lapamo15/GPIO/wiringOP# ./ottobre2023
 main1 - 1
 main2 - 0
Waiting ...
 

And 'gpioRead' output will not change even if the INPUT toggles between 3.3 and 0V

Note: the interrupt function detects correctly the input changes, but the 'digitalRead' output is always LOW

Interrupt function triggered by the rising edge.

Signal level at input '2' is 3.3V (measured by a tester) and the command 'gpio read 2' output is '0' (which should be '1').

 

It seems there is a conflict between 'wiringPiISR' and 'digitalRead'.

 

Edited by SergioAiello

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...

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.