VS1000 + GPIOs for playback

Writing software that controls the system and peripherals such as displays, SD cards, Buttons, LEDs, Serial Ports etc.
Post Reply
strangeintp
User
Posts: 2
Joined: Wed 2022-01-26 20:08

VS1000 + GPIOs for playback

Post by strangeintp »

I'm developing an application for which I would *like* to use the VLSI VS1000 as the system controller. I'm looking at using the Adafruit Audio EZ-FX (w/ 16 Mb SPI Flash) as my springboard for customization (relatively minor modifications to the PCB that aren't relevant to this question; e.g., incorporating a battery charger). For context, it uses the VS1000D as the processor, exposes the SPI Flash as a USB mass storage device for file transfer, and playbacks from the SPI flash.

It pretty much meets all my application requirements *except* the playback functions via the GPIOs. Specifically, I would like to remap the GPIO functions so that rather than playing the audio file corresponding to the binary word encoded on the GPIOs, they respond to external switches to perform playback functions that are fairly standard to audio players: play/pause, next/prev (ff/rev are optional/bonus), volume up/down. From the documentation I can find, it looks like that functionality can only be done (at least out of the box) via UART control. However, implementing UART control would greatly complicate my system design (and cost) (seemingly unnecessary) - e.g. add an MCU to process user switch inputs and implement the UART control functions onboard - more development time, power, parts count, etc.

I'm new to VLSI, and it's been a long while since I've waded in deep into firmware though I've dabbled in some embedded systems projects over the years (mostly Arduino based). But I think it's within my capacity to figure out what to do given some good starting material.

So my question is, is this even doable with the VS1000 (without assembly language or even heavy firmware development/modification)? Are there good example sources I can springboard from to figure out how to implement this (or straight up copy) w/o involving UART control? Or am I barking up the wrong tree using that EZ-FX board and/or using the VS1000D processor; do I need to design a custom system around another processor?

Another complicating factor is that Adafruit notes that the firmware image for that board is VLSI proprietary, so I'd have to rebuild a firmware image anyways (if I'm going to modify any functionality like playback control), but I figure that's not a difficult obstacle.

Thanks for reading, and thanks in advance for any recommendations/suggestions!
User avatar
pasi
VLSI Staff
Posts: 1963
Joined: Thu 2010-07-15 16:04

Re: VS1000 + GPIOs for playback

Post by pasi »

Hi,

The Adafruit board is based on the VS1000 Audio Module, see https://www.vlsi.fi/en/products/vsmd001.html .

A number of VS1000 Audio Module solutions for VSIDE can be found from https://www.vlsi.fi/en/support/software ... tions.html . And see viewtopic.php?f=8&t=461 for more hints and discussion.

If the firmware contains UART control, it is based on the default UART-controlled version. The firmware has GPIO-control as a compile-time option (disable UART_CONTROL and enable GPIO_CONTROL in system.h). You can also define (set DEFAULT_FIRMWARE_KEYS in system.h) "regular player controls" for next, prev, play/pause buttons (detailed in the VS1000 IC datasheet).

The resulting firmware can be programmed into the SPI FLASH using UART (e.g. the pcflash program, see https://www.vlsi.fi/en/support/software ... tools.html ), or if the module already has been programmed, using uSD card.
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook
strangeintp
User
Posts: 2
Joined: Wed 2022-01-26 20:08

Re: VS1000 + GPIOs for playback

Post by strangeintp »

Thank you, that is indeed reassuring. I have been crawling through the documentation and examples for a few days now but somehow missed that.

It sounds like all I need to do to get the default functionality is change system.h to look like:

Code: Select all

//#define UART_CONTROL // Control the player through UART
#define GPIO_CONTROL // Control the player through GPIO, see more defines from gpioctrl.h
#define DEFAULT_FIRMWARE_KEYS
And then wire my track and volume switches to GPIO0[0:3]?

(is that DEFAULT_FIRMWARE_KEYS documented anywhere? I see it referenced in gpioctrl.c)

And for the life of me, I can't find an application source example that uses the GPIOs as per above, with DEFAULT_FIRMWARE_KEYS set. (at least for VS1000) ... I've looked through quite a few. Is there a specific one you can point me at?
User avatar
pasi
VLSI Staff
Posts: 1963
Joined: Thu 2010-07-15 16:04

Re: VS1000 + GPIOs for playback

Post by pasi »

The default firmware key functions are described in the VS1000 datasheet. GPIO0[0:4] and the power button are used.

Because this is just an option for the GPIO-controlled player, there isn't a separate solution anywhere.

DEFAULT_FIRMWARE_KEYS is only checked in gpioctrl.c . It causes the "poll" function GPIOCtrlIdleHook() to call KeyScan() instead of checking the GPIOs itself. If you want to ignore USB insertion, use KeyScanNoUSB() instead.

KeyScan() in ROM first scans the GPIOs, then converts the state changes to events and if any, calls KeyEventHandler() with the proper events. KeyEventHandler() performs the actual player control functions. (Also sets player cancel if USB is attached.)
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook
Post Reply