Page 2 of 2

Re: How to change fw on VS1103 module

Posted: Thu 2019-11-14 22:12
by PaulEE
Success!! The latest solution update made easy work in getting the audio to play!

I think I got it from here - simple serial commands to dictate behavior of module..!

I have one other question (until I think of another in month ;) ): Is the file C1103.s the place I would tell the module to default to PAUSED, until which time I would tell it which file to play? (I believe the literature for the module says "pause before play")?

I'm sure I can use SCI via UART to set this after the fact, but I wanted to compile the project with the default being paused.

Thanks much - cheers!!!

EDIT: I read that c1103.s is the startup value defaults, but I'm not sure how to tell it to start in 'pause before play' mode. When our control electronics boots up, we need the sound module to be silent until we send, for example, 0x02 0x00 0x01 0x8c to trigger it to play file "1".

How would I set this as default? I am not familiar with the script/ASM/language used in c1103.s. If I figure it out before I read a response here, I will do a second edit at the top of the message proclaiming this to save time. Thanks so much.!

Re: How to change fw on VS1103 module

Posted: Fri 2019-11-15 19:49
by PaulEE
Still wondering how to set the default behavior to pause before play. Any help appreciated.

Thank you,

Re: How to change fw on VS1103 module

Posted: Sun 2019-11-17 9:57
by PaulEE
Hello! Good news!

After inquiring with a 'veteran' EE with much experience in low-level embedded programming, I found that defining new defaults was as simple as editing file c1103.s, I have successfully gotten the standalone player to pause and wait for a new song selection and play request.

For the benefit of those who attempt to do what I've done here with limited knowledge as I had before I began this interesting task many weeks ago, I will summarize for their benefit.

VLSI product in question:

Original (detailed) statement of goal:
Use a part that was previously purchased (and that I found, with no knowledge of current firmware) to allow the loading of, and subsequent serially-controlled playing of, WAV audio clips from a standard 2 GB microSD card.

1. Do a (surprisingly) exhaustive internet search and identify the designer and technical specifications of this very capable module.
2. Read everything I could find on what it is, how to breadboard the module, what it has on it, how it works, where and how to program it, and attempt to use default firmware source code files to compile and load firmware images in an attempt to solve the original problem.
3. Use UB232 USB-to-serial cable to both power and flash to the device using cmd.exe (Windows) and this code

Code: Select all

pcmodflash -l sdeeprom.img -p 3 -sm 4
by first REMOVING SD CARD and holding CS1 (module pin 12) to ground as power is applied to tell the device we want to program it.
4. Inquire about firmware on this (very helpful) forum.
5. Successfully generate proper "sdeeprom.img" EEPROM firmware image and do an initial test in playing WAV audio files. In the default configuration, the files play one after the other, auto-incrementing and repeating forever.
6. Review c1103.s 'defaults' file and identify this code

Code: Select all

.uword 0	/*SCI_AICTRL3	0xC00F*/
as the line that controls, among other things, the default behavior of the firmware on power-on.
7. Change "0" to "0x0004" to tell the internal control register that I want to pause audio on power-on.
8. Repeat step #5 and #3 to re-compile with new default and re-flash the device
9. Send bytes

Code: Select all

0x02 0x00 0x01 0x8c
at 9,600 8N1 to choose the first file and then send bytes

Code: Select all

0x00 0x00 0x06 0x8f
to play the file.
10. (a note) if the last group of bytes is sent, it will play whatever the next file is, and will repeat this behavior, unless a different file is chosen by the former string of bytes.

Now that the device works satisfactorily and is able to be successfully communicated with, it will be incorporated into a redesign of our new product.

Special thank you to 'pasi' of VLSI for your help and patience! Greetings and good day from TX, USA..!

Re: How to change fw on VS1103 module

Posted: Mon 2019-11-18 14:35
by pasi
Great! You're welcome.

The vs1003 and vs1103 versions of the standalone player are quite cryptic, because there is so little instruction memory. A lot of code is needed to implement both the SD and FAT routines - even with a lot of effort spent for hand-optimized assembly, so there's not much instruction memory left.

This is why the UART control is so cryptic, and the SCI registers are initialized by loading the directly using the bootloader.

The spiplayer doesn't need SD routines and it uses its own "filesystem" instead of FAT, so it can hold a much better UART-control user interface.