Interfacing with GPIO, UART, SPI, I2C etc

i used to use pigpiod library in raspberry pi zero to use i2c communication in python, is there anything like that in radxa zero ubuntu ?

pigpio is a raspberry pi specific gpio library. it can not work with radxa zero. WiringPi is a more general gpio library. We are also porting it to Radxa Zero.

We are looking forward to it

is there any other python library for i2c communication ?

i installed mraa on zero and man, it was perfect, the communication speed with my sensor using i2c is at least 10x faster than raspberry pi zero, congratulations to the developers

1 Like

Can you share some little introduction on how to use mraa for SPI?

Hi. See this guide. https://wiki.radxa.com/Zero/dev/libmraa

Hi,

I want to use UART with a GPS HAT for Raspberry Pi.
I enabled “overlays=meson-g12a-uart-ao-a-on-gpioao-0-gpioao-1”,
deleted “console=ttyAML0,115200” in /boot/Env.txt.
and connected the GPS module to Pin#8 and Pin#10,
but my Radxa Zero won’t boot.

Other UART options are OK such as meson-g12a-uart-ao-b-on-gpioao-2-gpioao-3, meson-g12a-uart-ao-b-on-gpioao-8-gpioao-9 and meson-g12a-uart-ee-c. I got NMEA2 messages via /dev/ttyAMLx.

I use the Radxa Zero v1.4 with 4GB mem and 32GB eMMC model and radxa-zero-debian-buster-xfce4-arm64-20211121-0245-mbr.img.gz.

Any suggestion?
Thanks.

1 Like

One reason may be that GPS module sends data to Radxa Zero via GPIOAO_1 pin in U-Boot stage and abort U-Boot boot process.

You can try to set CONFIG_BOOTDELAY to -2 in radxa-zero_defconfig to disable input abort. And upgrade your U-Boot on board.

1 Like

Hi Stephen,

I finally got UART_AO_A to work with following instructions.

Thanks a lot!

1 Like

HI,
I had a similar problem. I was connecting Radxa Zero to my custom circuit. My custom cirtuit has the uart connected to ST3232. Radxa didn’t boot. My solution was to put a 10K pulldown resistor in RX, pin 10. After this, Radxa boots.

Radxa team, can you please share the procedure for setting up a ST7789 display via SPI?

This would be a great thing to put on the Wiki for the Zero, as a great many of us bought the board with the intention of making small form factor devices with such displays, and so far only a tiny handful of people have managed it at all. I think if you had a clear step by step tutorial it would open the floodgates for sales of the device.

1 Like

Can you tell how to configure I2C for DS1307 on radxa zero
things till now done
1> DS1307 is connected to I2C_EE_M3 port on Zero
2> added overlays=meson-g12a-i2c-ee-m3-gpioa-14-gpioa-15 in /boot/uEnv.txt
3> when run sudo i2cdetect -y 3 it scans and return UU in one of address block
also I wanted to connect PCF8574 on I2C bus
I am confused with device trees and overlays please guide me in right direction
Thanks You

Hi, may I ask why GPIO pins 12 and 18 are used for SPI in/out – if read this in the link above correctly – vs the “native” (and RP Zer W/RP…) more compatible and as I see also my the design supported pins 19 (MOSI) and 21 (MISO) and 23 (SCLK) pins?

I originally look at this and was happy it fits my old AD converter’s add on hardware.

https://wiki.radxa.com/Zero/hardware/gpio

Is there a way to make pins 19,21,23 work for SPI?

@Nasca

Please provide one guide to use SPI with PIN #19/21/23.

1 Like

I’d be very happy to find a guide. Just got my armbian up and running from the EMMC as I wanted it.

I have some simply python code hacked to read a multichannel hi precision AD hat (waveshare) via SPI. It all works on a old RP-Zero-W, but this old device it a bit underpowered for the task and to server data via influxdb. I do monitor various analog data channels (reading temperatures from PT1000 sensors on a hot water solar system and a few more channels…) – to ultimately display via grafana. I hope to make this faster and more reliable or less prone to drop outs. (Happy to share if any interest)

Hi @pyzahl, I have fixed this issuse already, please use this img instead.

1 Like

Cool, many thanks.

Just, wonder as this a whole debian image – what got changed? Kernel/ add on module or overlay?
Or multiple support tools included as. well?

Asking if I could update/patch a running armbian system simply or better go with the new debian?

I have it running from SD card for testing. I found overlay for SPI on GPIOH_4-7 via the rsetup util. Good.

Q: what may I use for apt/sources.list for this build to not create chaos/mixups? The setting it came with “deb http://apt.vamrs.com/debian …” is not accessible?

As I need to grab a few extra packages for influxdb, spi, python add ons…

if you use armbian kernel, you only need to change the overlay, for the dts file, you can refer to this.