• Hardware
  • UART + I2C pins interfering with analog inputs on Bela Mini

Dear forum,
I'm building something like a HAT for a Bela Mini project that will use both Midi and Trill as well as all the digital and analog inputs. However, the UART4 and I2C1 pins interfer with the analog inputs so I thought about using UART2 and I2C2, but according to this pinout those are occupied by Bela Core stuff, right? Can they be used anyway? Or how do people attach both analog inputs and UART/I2C with a HAT? I should mention that the build height is very limited. Thanks!

You can use I2C2 as long as you don't need address 24 (0x18), as that's used on board. You cannot use the UART2 pins on P1.08/P1.10 because those are used by the chip that provides the analog inputs. What interference did you find when using UART4 and I2C1 pins? What ground, 3.3V and 5V signals are you using for your hat?

Ah, thanks! Not sure what address 24 means, when is it used?
Sorry, I was unclear, I mean that the space is too tight. When I solder header pins to rails on my proto breadbord it doesn't work with 3 pins next to each other. The rail can only split in 2 directions (left and right) Hope this makes sense!

Address 24 (0x18) on I2C2 is used by the Bela audio codec on the Mini cape, so you can't use another device with the same address. If you are only connecting Trills, that's no problem because that address is not within the Trill address range.

There are a few more UART pins that are not documented in that pinout. Here's a complete list: https://github.com/beagleboard/capes/blob/master/README.mediawiki . For instance, there's UART4_TX on P2.25 and UART4_RX on P2.27.

Ok great! I'll use the I2C2 then. Do I need to change the code?

In that list, on the PocketBeagle row, I can only see UART4 on P2.05/07 and UART0 on P1.30/32. Where should I look for the other ones? I will use P2.25 and P2.27 for digital inputs (or possibly Neopixels on P2.25).
Thanks!

Right. You need to scroll down to the lines labelled MUX MODE 0 through 7. The way the table is printed there it is really hard to parse. You will find UART 3 TXD on P2.29 . If you also need an RX line you'll have to sacrifice one of the digital pins. If you strictly need 16 digitals but can work with sampling one of them once per block, instead of once per audio sample, you can replace it with an arbitrary GPIO instead of a Bela-sanctioned Dx pin following the instructions here: https://learn.bela.io/using-bela/technical-explainers/other-uses-of-gpio-pins/

Thanks a lot Giulio, that is great news! Additional GPIOs once per audio sample will be very useful! That would mean I could also skip digital input D0 (pin P2.1) and avoid the three-pins-in-a-row-problem altogether.

    m3rten Additional GPIOs once per audio sample will be very useful!

    once per audio block

    Yes, once per block.
    So, on P2, pins 28, 29, 31 and 33?
    And on P1, pins 34, 31, 20 and 3?

    those look OK. Make sure you test P1.03 before committing to it. You could use P1.20 instead, that should be more readily available.