VS1010 Ultra low cost LCD FM radio + USB DAC + SD/USB MP3 Player demo board

Designing hardware and software for systems that use the VS1010 MP3 Audio DSP Microcontroller.
Hema
User
Posts: 1
Joined: Sun 2022-01-02 8:00

Re: VS1010 Ultra low cost LCD FM radio + USB DAC + SD/USB MP3 Player demo board

Post by Hema »

HOW to add remote control and spidf audio input.
Hannu
Senior User
Posts: 362
Joined: Mon 2016-05-30 11:54

Re: VS1010 Ultra low cost LCD FM radio + USB DAC + SD/USB MP3 Player demo board

Post by Hannu »

Hello and welcome to the forum.

I have limited understanding of the radio program and it is very complex piece of software. I really wish I had time to sit down and even read the code well through and maybe write it more modular.

The H/W part: There are a few pins (or holes for them) on the edge of the board. One is SPDIF_I and then there are three others. SPDIF_I takes data from toslink receiver or coax in reception circuit. Other pin receives the IR module data.

The easy part:
Writing remote controller reception software. Set up TIMER0_CAPTURE and GPIO interrupt for the reception pin and receive the pulses. The length is about half millisecond so there is quite good resolution available on timer. Example can be found from uartspeed program how to work with the timer and GPIO interrupts.

The decode the signals what your remote sends and get the button presses.

The medium hardness part:
Squeeze the memory footprint small enough so that the remote controller decoder can be all the time in memory.

The hard part:
Integrate with the system and poke correctly the information to achieve the desired actions.

S/PDIF Input: Currently there isn't input driver available. Porting VS1005 driver probably isn't that hard task. Then that would be just an another input source like FM or SD card.

So that is generally how those features are done.

Do you have the radio board or have you adapted the design to your own board? What kind of S/PDIF interface do you have? Which protocol your remote controller uses?

A bit offtopic but putting S/PDIF output would be easier: viewtopic.php?f=15&t=2839 Just the integration is left to do and the pin is also in the extra header.
George
Senior User
Posts: 76
Joined: Fri 2021-12-03 11:03

Re: VS1010 Ultra low cost LCD FM radio + USB DAC + SD/USB MP3 Player demo board

Post by George »

Hello,
As a result of my long experiments, I found out what is the reason for the inoperability of this package.
The linker VOPLINKG does not create *.coff file
Image
and I not see any errors.
Successfully compiled 3309 lines (45 in source) with 3 warnings.
C 88 CF 0 X 3 Y 0 F 0
voplinkg -k -m mem_user -p 2 -t LCDMP3 Emulation-Debug\vs1010d_romabs.o Emulation-Debug\vs1010d_romabs.o Emulation-Debug\sdmp3.o Emulation-Debug\fatdirectory.o Emulation-Debug\fatdircache.o Emulation-Debug\lcdtimer.o Emulation-Debug\rtcread.o -o Emulation-Debug\LCDMP3.coff -L. -Llib -LC:\VSIDE\libvs1010 -lc
Total words: I 3270, X 3403, Y 11257.


Because I found VS1010-L asking for help in running this package.
Thanks.

PS. DOS programs do not work in Windows x64, so you can only replace COPY to XCOPY and do all the other commands manually. For example, to clean VSIDE project you need to clean the directory /Emulation-Debug manually.
User avatar
Panu
VSDSP Expert
Posts: 2826
Joined: Tue 2010-06-22 13:43

Re: VS1010 Ultra low cost LCD FM radio + USB DAC + SD/USB MP3 Player demo board

Post by Panu »

Hi, Hannu!

The LCD radio is actually quite modular. For some good times, take some coffee and look it through. It has a loader with a shared data structure and it runs program one by one to handle the different modes, just like the HDMI ARC solution does. The SD / USB MP3 player is practically a stand-alone program. It might be the best MP3 player program ever made for the VS1010, for example it indexes those 20,000 MP3 songs in 6 seconds without relying on external memory.

To remove features (operation modes) from the device, remove the programs that you don't need from the loader.

S/PDIF output is enabled by default, I think...?

Good source code for remote control and S/PDIF input you can get from the VS1010 HDMI ARC solution. It even can change the VS1010 clocking to switch to 44.1 kHz S/PDIF to support external CD players. The LCDradio is starved for IO pins, though, so I'm not sure how much is possible without redesigning the PCB completely.

-Panu

PS. VSOS solutions don't use .coff files so I don't quite undertand the previous message. The vsos linker creates a loadable file which is renamed to a .DLX file for the VS1010. The .coff files, if any, are created by vslink for vs3emu purposes, and this is almost never done in VS1010..

When I wrote that code, I used VSIDE in Windows 7 64-bit exclusively. Other people used Windows 10.

[Edit]
The LCDRadio doesn't have a shared data structure in the loader like in the HDMI arc... instead, because the amount of data is small, it's just fixed to a fixed location with LINK_ABS(app,112) in appstate.h This is much simpler.
-Panu
George
Senior User
Posts: 76
Joined: Fri 2021-12-03 11:03

Re: VS1010 Ultra low cost LCD FM radio + USB DAC + SD/USB MP3 Player demo board

Post by George »

Dear Panu,
I downloaded the FMRadio_RC0 directory. This directory contains two directories - SYS and Source Code. The first contains a set of files with the DLX extension, the second - solutions according to the attached list. I don't see a bootloader here. If bootloader is a PC program, then I should see a file EXE or COM. If bootloader is a MCU program, then I must have a bin file that I have to upload to EEPROM.
Unfortunately, I don't see any instructions or any help for using the bootloader.
When I work with VS1053, I compiled the solution and after linking, I got the COFF file. I could convert this file into a binary IMG file, which I could load into EEPROM using my programmer, or through via VSIDE. It is for this reason that I would like to receive a COFF file.
But the voplinkg does not issue COFF, and the vslink issues an error.

I think I am not understanding something. So, please, help me figure out my problem.
Most Sincerely,
George
User avatar
Panu
VSDSP Expert
Posts: 2826
Joined: Tue 2010-06-22 13:43

Re: VS1010 Ultra low cost LCD FM radio + USB DAC + SD/USB MP3 Player demo board

Post by Panu »

Hi, George!

VS1010 and VS1005 have the VSOS operating system so they are different than earlier VS devices. Basic familiarity with VS1010 is very helpful here.

VS1010 boots from an SD card or a compatible SPI flash with a FAT filesystem. Except in rare cases, the bootloader in the ROM is sufficient and no bootloader is programmed into the flash. Instead, USB is used to format the flash into a FAT filesystem and firmware files are copied there - in this case, extract the zip file there (you can delete the source code subdirectory).

The boot device - SD card if there is no flash, SPI flash if flash is formatted to FAT and has a SYS subdirectory in root - is called S: in VSOS.

Programs are dlx files in S:SYS subdirectory. S:CONFIG.TXT (CONFIG.TXT in the root of the S: device) is read at boot time to determine which programs are run at startup.

STARTFM.DLX is the loader of the LCDRadio. It runs other .DLX programs one by one so that each .DLX program can use the full VS1010 memory (code RAM is very limited in VS1010) and has a shared data structure in the data RAM so that the different programs can keep their state.

-Panu

PS. If you have a programmed, working LCDRadio and can't get to the VSOS command line, follow the README.TXT instructions to get to the USB firmware update mode - long press of power button goes to FMSETUP mode where you can set the time, and there a long press of button 4 activates the SPI flash USB writer mode, or long press of button 5 activates the SD card USB writer mode.
George
Senior User
Posts: 76
Joined: Fri 2021-12-03 11:03

Re: VS1010 Ultra low cost LCD FM radio + USB DAC + SD/USB MP3 Player demo board

Post by George »

Hi Panu!
I understand my mistake, which is that I look at VS1010 as VS1053 when I should look at VS1010 we will see information about VS1005. In other words I was too lazy to find out that the last two letters in the words VSOS mean Operating System! :oops:
Most likely, I will make both versions of the MP3 player - use VS1010 and VS1053, and I will choice based on the test results.
Now I think that I will be using two SD cards slots, one SD card will contents operating system (the SYS directory), and the other for the MP3 files only. If I understand you correctly, in this case I don't need EEPROM. My device will not have LCD and will have only one mode "endless" MP3 play in high capacity Sd card.
If such a solution is realistic, then I see only one problem - remembering the file being played after turning off the power or providing autonomous power supply if such memorization turns out to be difficult or impossible.
Am I thinking right? :?:
User avatar
Panu
VSDSP Expert
Posts: 2826
Joined: Tue 2010-06-22 13:43

Re: VS1010 Ultra low cost LCD FM radio + USB DAC + SD/USB MP3 Player demo board

Post by Panu »

Yes, you are thinking right! Seems great!

To begin with, just use one SD card. You'll have the firmware in the SYS subdirectory and music in other places, these won't interfere with each other while you are doing development and is even OK in cases where final users can't remove the SD card and thus delete or overwrite the firmware files.

Later on you can decide how to do the final version. SPI flash might still be the best for storing the firmware and settings, like is done in the official version. But even I don't use the SPI flash during development, I just develop everything on the SD card.... this has the benefit of being able to recover from even catastrophic failures simply by formatting the SD card again in the PC... :D

-Panu

PS. To revert to just using the SD card with the LCDRadio PCB, just trigger the card into USB flash mode, and rename the SYS folder to some other name, then the flash won't be the S: system disk anymore and it boots from the SD card.
George
Senior User
Posts: 76
Joined: Fri 2021-12-03 11:03

Re: VS1010 Ultra low cost LCD FM radio + USB DAC + SD/USB MP3 Player demo board

Post by George »

Thank you so much, now it remains only to wait for the delivery of chips.
VLSI is very interesting! :!:
George
Senior User
Posts: 76
Joined: Fri 2021-12-03 11:03

Re: VS1010 Ultra low cost LCD FM radio + USB DAC + SD/USB MP3 Player demo board

Post by George »

Dear Panu,
I received the chip VS1010 and am now working with it.
I want to use your advice and work with SD card only.
I have to set boot mode. If I understand correctly, GPIO1_1 = HIGH, GPIO1_3 = LOW.
What bits should BM pin 0 - pin 4 in order to have load LCDMP3.dlx at first and then start MP3 player?
Thank you.
Attachments
mode.JPG
mode.JPG (200.16 KiB) Viewed 380 times
Post Reply