ive been trying to connect a raspberry pi pico to a adafruit mini sound board to trigger the audio files, but i have had very little succsess, has anyone else tried this before or is there any guides ?
i have tried the following code:
I’m interested in how you’ve got this all hooked up? Could you include a picture or wiring diagram for us to have a look at with this one, it will allow us to have the whole picture and hopefully be able to help get this one sorted for you.
Are you using Arduino-Pico package on the Pico here? Sometimes that can cause issues with standard Arduino Libraries.
ill send through a diagram later today, but this is with a raspberry pi pico running python, the image in the main post is all of the code in the raspberry pi pico, as far as im aware the adafruit doesn’t need any code just the sound files formatted correctly
so below is a diagram of the wiring (low key don’t judge my paint skills )
but this setup does work when the manually trip the sound file on the adafruit sound board it plays, but when i run my code through the raspberry pi pico i dont have any action.
Quick try might be to swap the TX & RX.
From what I have seen I think the Pico uses TX as an output.
The Adafruit web page lists TX as an output for the Mini sound board.
The wiring pic shows TX to TX and RX to RX.
In serial comms output goes to input & input to output.
Also TX can be an output or an input, same for RX.
Depends on how the circuit is wired, labeled or programmed.
To add to Jim’s suggestion, if two TX pins are fighting each other, they can exceed their current ratings and fry the output driver in the pin (they’ll never work again). Hopefully that hasn’t happened here, but it could be worth trying alternate pins or testing the devices apart to confirm you haven’t fried anything.
i tried this out, and swapped them around and still nothing, i tried with pin 8 & 9 alternating the TX and RX, but nothing. Thanks for your suggestions though !
Good design of serial comms should account for a situation where TX & RX are connected wrong.
The datasheet for the VS1000 does not show if there is any protection on the GPIO pins.
Unlike the Arduino (ATMega328P) which has full protection on all pins.
In my opinion this is a possibility only; all other option should be tried first.
Getting the TX & RX the right way around is just one part of the comms.
Using an oscilloscope can show if the signals are present.
Alternatively a multimeter or simple LED would show if the TX is sending anything.
For both Pico and Sound board.
The Adafruit tutorial shows how to connect the serial to a Arduino UNO and use the Serial monitor to check the sound board. Its possible the Pico to not sending the commands correctly.
Looking further at the Adafruit Arduino Library, I think there is more to getting this to work than I originally thought. Adafruit don’t provide enough information on how to get the serial working with a non Arduino device.
As a way ahead, I suggest getting a UNO and following the Adafruit tutorial.
If this works it will prove the sound board is ok wrt to serial comms.
Then I suggest contacting Adafruit and see if they can help with using a Pico or any other serial device.
Cheers
Jim
EDIT: Details of the Soundcard Firmware can be found in the VS1000 datasheets. I found 2, one is more detailed than the other (google search and download of .pdf).
The chip on the sound card is quite flexible and the firmware can be updated via the TX & RX lines. It can boot into different modes. The sound card can send information when it boots up. So this could be displayed via a serial monitor. The datasheets details how to connect a MAX232 chip for a RS232 connection. But, I have NOT looked at this in detail. Hope you can get it working. Might have a go myself when I get a sound board. At $42.50 don’t know, bit expensive to only use to test it out.
Arlo,
looking at the Data Sheet the Default baud rate is 115200(section 7.3) and the default application seems to only use the buttons for control (section 7.4.2) and the UART is for monitoring the chip operation.
hey James,
sorry for the late reply, ive been a little busy.
i will look into this at a later date but at this stage i just cheated a little and used relays to trigger the adafruit sound board.
but i will look into this I’m curious if it can be done.
@Arlo211316 Audio FX board finally arrived. Got it working ok with a Pico.
First:
It has two modes, GPIO and UART, the UG pin needs to be tied to GND for the UART to work.
Second:
There needs to be a delay after TX to allow the command to be sent before doing anything else.
Also allow time for the board to respond to a command before sending another.
The code below works and track 2 plays through the speaker.
###########################################################
from time import sleep
from machine import UART, Pin
###########################################################
Led = Pin(25, Pin.OUT)
Reset = Pin(22, Pin.OUT)
Led.value(1)
Reset.value(1)
###########################################################
uart = UART(1, 9600,tx=Pin(4), rx=Pin(5))
###########################################################
def reset_Board():
Reset.value(0)
sleep(0.1)
Reset.value(1)
sleep(0.5)
return
###########################################################
def UART_read():
if not uart.any(): return 'END'
d = uart.readline()
if d[0] == 0: return 'BLANK'
return str(d,'UTF-8')
def UART_readLines():
get_line = True
while get_line:
line = UART_read()
if line == 'END': get_line = False
elif line != 'BLANK':
line = line[0:len(line)-2]
print(line)
return
###########################################################
reset_Board()
UART_readLines() # read FX board start up info
# always sent after reset
# list files
uart.write('L\n')
sleep(0.5) # wait for command to be sent
UART_readLines() # read list of files
# play file
uart.write('#2\n')
sleep(0.5) # wait for command to be sent
# other stuff
# exit program
sleep(5)
Led.off() # indicates program has stopped
###########################################################
###########################################################
Output in Thonny. Note track 2 is actually T01RAND3.WAV
FAT 00000FCO = 4032*512 = 2,064,384MB (I ordered a 2MB version)
Files 00017 There are more files in the memory, but it can only list and play the first 12.