About Us Knowledge Base Community Forum Electronics Toolbox FAQ Shipping & Delivery

Community Forum

Share your projects and post your questions

Search
Register or Sign In
Forum

Banana Pi compatibility?

174 Views - Created 07/08/2020

07/08/2020

Posted by:
Manbehindthemadness

Users Avatar

I have need to use the raspi ACD board on a Banana BPI M2 Zero board, I have confirmed that I2C is working and operational; however, when I connect the ADC, I2C bus 1 drops all of it's addresses. If I move it over to a Raspberry Pi everything works fine, any idea what's up?

Ubuntu 5.3.5 with matching sunxi overlays.

07/08/2020

Posted by:
andrew

Users Avatar

Location:
United Kingdom

Users Twitter  Users Website  

Hi

I have not tested the ADC Pi with the Banana BPI M2 Zero so I do not know if it is compatible but according to the documentation for the board the GPIO pinout is the same as the Raspberry Pi so it should work.

Can you check that the ADC Pi is connected in the correct direction.  According to the documentation, pin 1 should be next to the micro SD card socket so the ADC Pi should sit on top of the Banana Pi with the connectors and CPU sitting in between the two boards.

I have ordered a Banana BPI M2 Zero, when it arrives I will test it with all of our boards to check if they are compatible.

AB Electronics UK Tech Support

07/08/2020

Posted by:
Manbehindthemadness

Users Avatar

Yes I have confirmed the same, all the pins line up without issue, the header arrangement is identical. The I2C controller is a i2c-mv64xxx. Could it be an issue with regards to a pull up resistor? 

50 days ago

Posted by:
andrew

Users Avatar

Location:
United Kingdom

Users Twitter  Users Website  

I could not find if the Banana BPI M2 Zero contains any internal pull-up resistors on the I2C bus.  The ADC Pi uses 10K pull-up resistors but these should not cause any problems.

AB Electronics UK Tech Support

50 days ago

Posted by:
Manbehindthemadness

Users Avatar

Ok, well I will gather together the image information for you to use when your test board arrives. Thanks so much!

50 days ago

Posted by:
Manbehindthemadness

Last edited: 08/08/2020

Users Avatar

I discovered that the pin-header was faulty after doing a full trace with a DVM, After replacement the ADC board works like a charm!

50 days ago

Posted by:
andrew

Last edited: 08/08/2020

Users Avatar

Location:
United Kingdom

Users Twitter  Users Website  

That is interesting.  The I2C pins on the GPIO header side pass through a mosfet level shifter which converts the 3.3V Raspberry Pi I2C bus to 5V for the ADC chips. 

By connecting to the SDA and SCL pads on the ADC Pi you are bypassing the mosfets but that does mean you are passing 5V into the GPIO header on the Banana Pi.  The 5V passes through a 10K resistor first so hopefully the current is low enough not to damage the I2C bus on the Banana Pi but you may not want to leave it plugged in too long.

When the Banana BPI M2 Zero I have ordered arrives I will connect the I2C port to my logic analyser and oscilloscope which should hopefully tell me why it is not communicating with the ADC Pi.

AB Electronics UK Tech Support

48 days ago

Posted by:
andrew

Last edited: 10/08/2020

Users Avatar

Location:
United Kingdom

Users Twitter  Users Website  

A quick update.  The Banana BPI M2 Zero I ordered from a european supplier has just been cancelled by the supplier so I have had to buy one from AliExpress instead who have a 20 to 40 day delivery time.

I will let you know as soon as it has arrived and I have worked out why the ADC Pi is not working correctly.

AB Electronics UK Tech Support

37 days ago

Posted by:
Manbehindthemadness

Users Avatar

Yeah I had the same problem. I'm just using a rpi for the time being. Thanks for the great support

37 days ago

Posted by:
Manbehindthemadness

Users Avatar

Yeah I had the same problem. I'm just using a rpi for the time being. Thanks for the great support

33 days ago

Posted by:
andrew

Last edited: 02/09/2020

Users Avatar

Location:
United Kingdom

Users Twitter  Users Website  

The Banana BPI M2 Zero arrived this morning and so far I have managed to get it working with the ADC Pi, ADC Differential Pi, IO Pi and RTC Pi.

I used the BPI-M2 zero Ubuntu 19.10 Eoan Ermine Mainline Kernel 5.3.5 image.

The following software packages were needed to get I2C working with python.

sudo apt-get install python3-dev python3-smbus i2c-tools git

The first thing I discovered was that on the Banana BPI M2 Zero the I2C bus is on address 0 instead of address 1 so all i2c commands like i2cdetect need to use 0 for the target, for example sudo i2cdetect -y 0.

With i2ctools installed I ran i2cdetect and the ADC Pi showed up on addresses 0x68 and 0x69.

The I2C bus only appears to be configured to have root access on Ubuntu so you have to use sudo to open any python programs.  I also couldn't find the python-smbus package in the apt repositories so you can only access I2C using Python 3.

So far I have successfully tested our python library with the ADC Pi, ADC Differential Pi, IO Pi and RTC Pi.  Each of the python classes needed updating to detect it is running on a Banana BPI M2 Zero and use the correct I2C bus.  I have uploaded an updated version of the libraries to github.

I haven't managed to get our other boards working yet.  The Servo Pi and I2C Switch use the RPi.GPIO package and this doesn't seem to be compatible with the Banana Pi.  I haven't tested the SPI bus yet but hopefully I can find a way to make it work.

AB Electronics UK Tech Support

25 days ago

Posted by:
andrew

Users Avatar

Location:
United Kingdom

Users Twitter  Users Website  

A quick update on the Banana BPI M2 Zero.

I couldn't get the SPI bus working under Ubuntu but so I decided to try the Raspbian OS image.

The I2C bus is on port 0 instead of 1 as it was with Ubuntu and SPI only has one port SPI0.0 so it will not work correctly with our ADC DAC Pi or Expander Pi boards as they require SPI0.1 to access the DAC chip.

I have found the following boards work with Raspbian.

  • 1 Wire Pi Plus and Zero with OWFS (set the i2c bus to 0 in /etc/owfs.conf)
  • ADC Pi with Python (Works correctly)
  • ADC Differential Pi with Python (Works correctly)
  • Expander Pi with Python (ADC, IO and RTC work but DAC is not available)
  • IO Pi Plus and Zero with Python (Works correctly)
  • I2C Switch with Python (Works correctly but needs sudo to run the python demos)
  • RTC Pi with Python (Works correctly)
  • Servo PWM Pi with Python (Works correctly but needs sudo to run the python demos)

I have only tested the boards with Python but our other libraries should work if the I2C bus is set to target I2C 0.

It is a shame the SPI port does not work fully but at least most of our boards are working.

AB Electronics UK Tech Support

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.