probonopd / MiniDexed

Dexed FM synthesizer similar to 8x DX7 (TX816/TX802) running on a bare metal Raspberry Pi (without a Linux kernel or operating system)
https://github.com/probonopd/MiniDexed/wiki
1.12k stars 81 forks source link

GPIO pinout for external devices #38

Closed rsta2 closed 2 years ago

rsta2 commented 2 years ago

As suggested in https://github.com/rsta2/circle/issues/280 I investigated the GPIO pinout of the (already known) external devices, which can be connected to a Raspberry Pi, when using MiniDexed and generated a list as a suggestion (see attached).

Two comments:

pinout.txt

probonopd commented 2 years ago

We should enable the system option USE_PWM_AUDIO_ON_ZERO in build.sh.

By uncommenting it like below, or is there a better way?

sed -i -e 's|//#define USE_PWM_AUDIO_ON_ZERO|#define USE_PWM_AUDIO_ON_ZERO|g' include/circle/sysconfig.h
rsta2 commented 2 years ago

It can be defined in build.sh in the same way as REALTIME and SAVE_VFP_REGS_ON_IRQ. With this the option is globally enabled and the file sysconfig.h does not need to be manipulated.

probonopd commented 2 years ago

Thanks @rsta2, implemented your suggestions. i2c may prove useful indeed as we may be running low on pins.

probonopd commented 2 years ago

image

Looking at the pinout in more detail, I have the following questions:

I think we should keep the same pinout for all models of Raspberry Pi to keep things simple and because it will allow the same hat/hardware/connector to be used for all models. This means that if we want to continue support for the Raspberry Pi 1, then we should avoid pins that are not physically present on the Raspberry Pi 1.

MiniDexed_Pinout.zip

rsta2 commented 2 years ago

Good point. I think we can define a pinout, which works on any RPi model, especially when we do not need SPI. Answering your questions:

I agree, if we continue to support the RPi 1, we should have the same pinout there, as it is on the other models. There is one exception: the DAC is at GPIO28-31 on the RPi 1B, that's a standard. But what, if we have to move to multi-core, because of the USB issues? Perhaps we should wait for this decision, before modifying the pinout again?

rsta2 commented 2 years ago

Another idea: If SPI would be an alternative interface for displays, we could easily use the SPI GPIO pins for the (currently supported) HD44780 LCD display, because both are options for the same purpose and only one display is needed.

rsta2 commented 2 years ago

But if we want to have a CV input using a MCP3004/3008 ADC, we also need to have the SPI interface.

There are also differences between Rev 1 and Rev 2 PCBs of the Raspberry Pi 1 Model A and B:

https://elinux.org/RPi_Low-level_peripherals#P1_Header

probonopd commented 2 years ago

If we need an ADC, we might also go with an i2c one like ADS1115 or MCP3421. I'd expect only few users to be interested in this, though.

I think the Rev 1 Raspberry Pi 1 is really rare so I wouldn't worry too much about it.