Support Forum

Share your projects and post your questions

Register   or   Sign In
The Forum

IO Pi Plus bus pins #01 and #09 register activity but other pins dont

3625 Views - Created 05/10/2015

07/09/2015

Posted by:
nathanxl

nathanxl Avatar

Hello.Im a novice.I have a simple processing sketch running on a rasp pi 2.
It has 2x IO Pi Plus shields and an ADC Pi Plus shield.
When the pins are crossed with 5v from the Pi or an external battery pack it is registered correctly and I can see this activity in processing.
However the problem Ive encountered is that when using my sensors/circuits to the pins (The sensors/circuits give 5v hi/lo state gates) only pins #01 and #09 on the IO pi register any activity. The other pins dont register anything... I am correctly connecting common ground between everything.
What is happening here, what am I doing wrong and please help?
Thankyou

07/09/2015

Posted by:
andrew

andrew Avatar

Location:
United Kingdom

andrew Twitter  andrew Website  

Hello

What type of sensors are you trying to connect to the IO Pi? Some sensors may need to have a pull-down or pull-up resistor attached to the input so it changes state correctly.

Are you using our Python library to read from the pins and if so are you using the ReadPin or ReadPort function to read the status of the pins?

07/09/2015

Posted by:
nathanxl

nathanxl Avatar

Thanks Andrew.At the moment all that Im trying to input to the IO pi is a 5v gate from an opamp in a modular synthesizer, its oscillating on/off at about once a second. It has sufficient resistance pulling it down.The code is a mystery to me, a friend wrote it for me so I dont know what/if Python libraries were used. Hopefully he will be able to comment here or relay back to me information soon.
Can you explain what the possible issues could be that result only pins 01 and 09 registering the inputs while the others dont?

07/09/2015

Posted by:
andrew

andrew Avatar

Location:
United Kingdom

andrew Twitter  andrew Website  

The most likely reason I can think of for it only showing pins 1 and 9 is the port direction is not being set correctly so only two of the pins are being set as inputs. Can you check the code and see if there is a set_port_direction() function being called? To set all of the pins as inputs it should be set to set_port_direction(255), I suspect that it is currently set to set_port_direction(1) which would set the first pin on each port as an input and the rest as outputs so they wouldn't respond to any external inputs.

We have a sample python script https://github.com/abelectronicsuk/ABElectronics_Python_Libraries/blob/master/IOPi/demos/demo_ioread.py which shows how to set all of the pins on a port as inputs. It may be worth running this script to see if it shows the correct values on your sensors.

One other thing to look at is if the opamp is oscillating once a second you will need to make sure the inputs are being read several times a second to ensure that the changes in state are recorded.

07/09/2015

Posted by:
davo

davo Avatar

Hi I wrote the code for Nathan. I'll check it with him tomorrow, but the code is a fairly direct port of the existing github code from python to Java. I believe it was registering all pins correctly when exciting from +5 on the pi. ie python code ported to Java retaining the bulk of the python syntax, ported code wraps the pi4j library. Running as a Java app within processing.org app. May need a blog.

Sign in to post your reply

Note: documents in Portable Document Format (PDF) require Adobe Acrobat Reader 5.0 or higher to view.
Download Adobe Acrobat Reader or other PDF reading software for your computer or mobile device.