Hello gurus,
I’m building my little one a mini boombox with a Pirate Audio at the center of it. It’s still a heap of wires (and the case needs design updates as I learn), yet it’s moving along well. I’m able to successfully test all of the components of this project separately like playing audio (super fun as a Spotify device yet not project goal), draw to the screen with Python PIL, scan RFID “cartridges” that will be used to trigger sound and read a volume value from a potentiometer via a connected ADC. Super fun!
I could use an extra brain as I figure out SPI surrounding the Pirate Audio display and my RFID reader (RFID-RC522). They are trying to use the same pins and I’m not sure if they can co-exist in the way or not as I catch up on SPI. If I activate the display, my RFID reader no longer reads, so I know so far that they are conflicting. As an alternative to SPI, I learned that the RFID-RC522 can also use I2C, which would pair well with my volume readings, yet enabling this is rather odd (not ideal as I ponder a tutorial for others and future memory).
Would you have ideas on how to get these two devices to play nice with each other? Here’s the RFID library I’m using that has a few options for switching things around. I was able to remove one pin already to avoid conflicting with the Pirate Audio Y button (I’m just reading uids and was able to skip this) and move another pin to not conflict with the amp enable pin:
st7789-python/examples/shapes.py at master · pimoroni/st7789-python (github.com)
Also because I’m a visual person, here’s a pretty chart that describes potential conflicts and where I’m connected now. This based on a Pirate Audio pinout chart I found here:
Here are the settings I’m currently using when enabling the display:
self.st7789 = ST7789(
rotation=self.rotation, # Display the right way up on Pirate Audio
port=0, # SPI port
cs=1, # SPI port Chip-select channel
dc=9, # BCM pin used for data/command
backlight=13,
spi_speed_hz=self.spi_speed_mhz * 1000 * 1000
)
Here’s what enabling the RFID reader currently looks like (disable IRQ, BCM pin mode enabled in init as it’s enabled in main script, moved RST pin, see README here):
rdr = RFID(pin_irq=None, pin_mode=GPIO.BCM, pin_rst=37)
Thanks a ton for helping me untangle my mind in advance. I truly appreciate the feedback. ❤️