vs1053 Startup with GPIO0/GPIO1 unknown

Designing hardware that uses VLSI Solution's devices as slave codecs such as an external MP3 decoder chip for a host microcontroller.
Post Reply
Ord
User
Posts: 9
Joined: Sun 2011-09-25 23:27

vs1053 Startup with GPIO0/GPIO1 unknown

Post by Ord » Mon 2011-09-26 15:35

Hello,

in my application I want to use all 8 GPIO for inputs from switches, and I cannot be sure that they will always be low when the hardware reset happens.

I know I could use a single IO pin from my processor to pull those two lines low when I make the reset, but I want to reserve the processor pin for another purpose if possible.

I believe it is possible to get around this with a 4 step reset:
- make hardware reset (I have xReset connected to processor IO)
- set the GPIO to outputs by setting DDR bits
- make software reset (will reset MIDI mode??)
- set the GPIO to inputs by clearing DDR bits

But is there an easier way to get out of MIDI mode?
Also will the SPI boot fail immediately if it cannot see the 0x50 byte from external memory, or will it keep trying?

User avatar
Panu
VLSI Staff. Currently on holiday.
Posts: 2736
Joined: Tue 2010-06-22 13:43

Re: vs1053 Startup with GPIO0/GPIO1 unknown

Post by Panu » Tue 2011-09-27 13:22

Hi!

SPI gives up immediately if the first boot attempt fails.
I'm not sure about the other question..

-Panu
Info: Line In and Line Out, VS1000 User interface, Overlay howto, Latest VSIDE, MCU Howto, Youtube
Panu-Kristian Poiksalo, VLSI Solution Oy

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

Re: vs1053 Startup with GPIO0/GPIO1 unknown

Post by pasi » Thu 2011-09-29 21:14

Ord wrote:But is there an easier way to get out of MIDI mode?
The 'safe' combinations are gpio0=1, gpio1=X (when SPI EEPROM is not installed or does not contain bootable image) and gpio0=0, gpio1=0. So, you want to avoid gpio0=0,gpio1=1 only.

You can detect RTMIDI mode after hardware/software reset by checking AUDATA. If you see 44100/44101, RTMIDI has been activated, and you can write GPIO_DDR=3 and GPIO_ODATA=0, then give software reset to boot into normal decoding mode.

VS1053 always sets DDR to inputs after software reset, whether boot is tried or not. VS1063 restores the original state so I2S does not need to be reconfigured. But software reset should be the last resort and the cancel procedure should be used to change songs.
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook

Ord
User
Posts: 9
Joined: Sun 2011-09-25 23:27

Re: vs1053 Startup with GPIO0/GPIO1 unknown

Post by Ord » Fri 2011-09-30 19:36

Thanks! That is a very clear explanation.

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

Re: vs1053 Startup with GPIO0/GPIO1 unknown

Post by pasi » Sun 2011-10-02 14:20

Oh, one more thing came to mind:

Because vs1053 switches GPIO into inputs before checking for the GPIO for RTMIDI mode, driving the pins from vs1053 may not work if you have something actively driving the GPIO pins. You can try to limit the rise/fall times with pull-up/down/series resistors, or use a patch code to skip the RTMIDI check (does not yet exist).

Btw, xDCS (and xCS, SCLK and SI) are also readable from GPIO_IDATA, so if you use shared mode, xDCS is freed and can also be used for a general-purpose input. If 8 GPI's are enough for you, then you can pull GPIO0 permanently high.
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook

Ord
User
Posts: 9
Joined: Sun 2011-09-25 23:27

Re: vs1053 Startup with GPIO0/GPIO1 unknown

Post by Ord » Sat 2011-10-08 9:30

Thanks for that extra detail.

I have not been using shared mode, there are several other devices on the SPI bus so I am not sure how I could do it.

The GPIO are all connected to user controls, so I think I will just check for the RTMIDI mode and if it is set I will go into a "self test" mode, play a short midi tune and run some other checks. Then I can write in the documentation to hold down that button when powering up to run a test.

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

Re: vs1053 Startup with GPIO0/GPIO1 unknown

Post by pasi » Mon 2011-10-17 19:38

Ord wrote:The GPIO are all connected to user controls, so I think I will just check for the RTMIDI mode and if it is set I will go into a "self test" mode
Right, the best way to overcome is to make it a feature by documenting it! :-)
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook

Post Reply