GPIO mode issues

Writing software that inputs and/or outputs audio and performs DSP algorithms such as filters, new codecs or audio effects.
Post Reply
adunk
User
Posts: 3
Joined: Mon 2020-10-26 13:57

GPIO mode issues

Post by adunk » Thu 2020-10-29 15:46

I'm using a VS1000 with a MX25L1606 eeprom over SPI. I've pulled in several example projects and UART control works good for playing an OGG audio file which I have stored on the eeprom. But all attempts for GPIO control result in no response. When viewing the SPI comm with a logic analyzer I can see continuous traffic when attempting GPIO control with IO0 set. Is there some kind of scanning on the filesystem that is unsuccessful that only occurs over GPIO control?

User avatar
pasi
VLSI Staff
Posts: 1730
Joined: Thu 2010-07-15 16:04

Re: GPIO mode issues

Post by pasi » Thu 2020-10-29 16:01

If you're referring to the GPIO-controlled VS1000 Audio Module firmware, then by default it scans the GPIO pins several times per second, driving the relevant GPIO pins low, then switching them into inputs and reading after a small delay. If all of the pins specified are low, then nothing happens. If any are 1, the binary-coded number is used to choose a file to play.

The file gpioctrl.c contains a number of C preprocessor defines to customize the operation. For example, if you have pull-downs on the GPIO pins used for song select, you can disable the "drive low first" feature. It is only needed if there's a chance the pins are floating (the VS1000 module doesn't have pull-downs).

Another #define specifies which GPIO pins are used, and you can also choose GPIO_PRIORITIES to switch from binary-coded song select to one-file-per-pin song select. It's also possible to invert the polarity from active-high to active-low.
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook

adunk
User
Posts: 3
Joined: Mon 2020-10-26 13:57

Re: GPIO mode issues

Post by adunk » Fri 2020-10-30 13:52

Since we have pullups, I have already inverted the Gpio logic using the define and have also commented out driving the pins high, although I wasn't aware of a #define for that functionality. I have tried hardcoding the mask and also the OPENFILENAMED(AUDIO00.OGG) but still get nothing when in GPIO CONTROL MODE.

I said my UART functionality was working, but it actually looks like its not working fully. I am not able to list the songs or play by song name. I am only able to continuously play audio, adjust the volume, and pause/unpause. It seems like I don't have the ability to search through the filesystem and find a specific song, but only just continuously play all audio.

Like I said earlier, this could be related to what I'm seeing on the SPI communication to the eeprom where it just continuously spams the SPI bus in GPIO CONTROL MODE. It may be searching for something specific on the file system and can't seem to find it or the drive itself is set up incorrectly.

Thanks for your feedback!

User avatar
pasi
VLSI Staff
Posts: 1730
Joined: Thu 2010-07-15 16:04

Re: GPIO mode issues

Post by pasi » Mon 2020-11-02 11:18

For the UART mode:
You only have the List command available when not playing. You need to switch to 'f'ilemode, then 'c'ancel playback to enter the "prompt" where you can list files and command files to be played. There's also a define you can set to power up in filemode.

GPIO-ctrl:
If nothing is playing, once the GPIO-controlled SPI player (spiplayer.c) has found a valid FAT disk and at least one file (if there are no playable files, it will reread continuously), should be just waiting in a while loop for player.currentFile to become something else than -1. The same while will check for the uSD insertion switch, but should not generate SPI traffic.

If you see constant SPI access even when not playing, you should probably add some debugs to gpioctrl.c to see if and what it writes to player.currentFile .
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook

adunk
User
Posts: 3
Joined: Mon 2020-10-26 13:57

Re: GPIO mode issues

Post by adunk » Mon 2020-11-02 17:02

Thanks for all the great feedback!

Post Reply