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.
Hannu
VLSI Staff
Posts: 526
Joined: Mon 2016-05-30 11:54
Location: Finland
Contact:

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

Post by Hannu »

Your main() is in sdmp3.c file. The main.c is just empty leftover from the start of project and not even compiled.

The SetPLL() is defined in vs1010dRom.h header.
Anyway, I'll add "write auospda driver" to my task heap so everyone can have a better life. Someday.
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 »

File toslink.c

Code: Select all

#include <vs1010c.h>
#include <vs1010dRom.h>
void SRCInterruptForToslink(void); /* Prototype for the interrupt handler. */
void ToslinkInit(void) {
...
No ERROR! :)

Erase main.c

File sdmp3.c

Code: Select all

...u_int32 t1, t2, t3;
int nextSong = 0;
void ToslinkInit(void);
void UiHandler();
...
SPDIF = 0.

OR

File sdmp3.c

Code: Select all

// MP3 player proper
ioresult main (char *params) {
	void ToslinkInit(void);
	int i;
SPDIF = 0.


However, the oscilloscope shows that the SPDIF_I/GP0_1 is the hardware input, and SPDIF_O/GP1_14 is hardware output.
Does this mean that the initialization of SPDIF is works?
Last edited by George on Tue 2022-02-15 6:15, edited 4 times in total.
User avatar
pasi
VLSI Staff
Posts: 2120
Joined: Thu 2010-07-15 16:04

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

Post by pasi »

George wrote: Mon 2022-02-14 16:17 File sdmp3.c

Code: Select all

// MP3 player proper
ioresult main (char *params) {
	void ToslinkInit(void);
	int i;
It seems to me you're still just declaring a prototype and not calling the function. Try:

Code: Select all

// MP3 player proper
void ToslinkInit(void);
ioresult main (char *params) {
	int i;
	ToslinkInit();
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook
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 »

Yes!!!
:lol: :lol: :lol:
pic_261_2.jpg
pic_261_2.jpg (149.12 KiB) Viewed 3497 times
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 Hannu and pasi,
I am very glad that my VS1010 has earned. And I have only one very important question for my project.
In the discussion of VS1053, the question was raised about the need to remember the song being played after turning off the power. As far as I understand, the function Saves current song and position in the lcdmp3.dlx code doesn't do that.
I tried to solve the problem by introducing the "pause" mode using one of the GP1 pins available to me, and my pause mode worked, but unfortunately the current consumption in this mode was too high.
In the VS1053 discussion, this issue was already raised and I suggested the idea of ​​storing the current song number in microSD, and PASI believed that it was better to do this in memory chip.
In my opinion, both options are not good due to the physical limitation of the number of write cycles to flash memory, when the same type of memory is used in both the microSD and the memory chip. It is obvious that the most correct way is to store the song number in RAM, but it is impractical to install such memory only for the sake of storing one value.
Meanwhile, there is RAM in VS1010! This is RTC. As far as I understand, the RTC in VS1010 contains two 16-bit registers: RTC_LOW and RTC-HIGH with a separate low-power supply. Judging by RTCREAD.c RTC is used in SDMP3.C to count the time of playing an mp3 file. I do not need this function, because I don't have a display generally.

Can I ask you to help write me two functions:
1. Write the number of the current song in the RTC register.
2. Read the number of the current song from the RTC register.
I think storing the position in the current song is not necessary for me.

I understand that I am making too many requests to you. If your VS1010 was like Atmel or ST MCU, I would find the examples I need on the Internet and solve the problem myself. But your VS1010 is still a unique and there is nowhere else to get help other than this forum.

Most sincerely.
Hannu
VLSI Staff
Posts: 526
Joined: Mon 2016-05-30 11:54
Location: Finland
Contact:

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

Post by Hannu »

viewtopic.php?f=15&t=2498&p=14057&hilit=date#p14057

The date program main.c has three interesting functions. StartAndWaitRtcReady(), ReadShifter() and WriteSfiter()

The you using the fast player which came with radio or are you using rom player?
player.currentFile is for current file and variable track for the radio player.

And if you meet something undefined when integrating, hilight and right click and find or ctrl-shift-f and fill search and library find.
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 »

Thanks.
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 »

Code: Select all

//	write tracknumber to RTC RAM!
	app.sdTrackNumber = 32;
	WriteShifter(app.sdTrackNumber);
	printf("app.sdTrackNumber to RAM:%u\n ",app.sdTrackNumber);

//	read tracknumber from RTC RAM!	
	app.sdTrackNumber = ReadShifter();
	printf("app.sdTrackNumber from RAM:%lu\n ", app.sdTrackNumber);
terminal:
app.sdTrackNumber to RAM:32
app.sdTrackNumber from RAM:2097152
:!: :!: :!:
Hannu
VLSI Staff
Posts: 526
Joined: Mon 2016-05-30 11:54
Location: Finland
Contact:

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

Post by Hannu »

George wrote: Fri 2022-02-18 14:04

Code: Select all

	printf("app.sdTrackNumber to RAM:%u\n ",app.sdTrackNumber); /* This is correct. */
	printf("app.sdTrackNumber from RAM:%lu\n ", app.sdTrackNumber); /* This has the problem */
terminal:
app.sdTrackNumber to RAM:32
app.sdTrackNumber from RAM:2097152
:!: :!: :!:
Hint:
0x0020 == 32
0x00200000 == 2097152

To fix the warning from compilation (not the print), cast the result.

Code: Select all

app.sdTrackNumber = (u_int16)ReadShifter();
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 »

Yes!!! :!:
Locked