VS1010D Memorize the setting value

Designing hardware and software for systems that use the VS1010 MP3 Audio DSP Microcontroller.
Post Reply
Hiro
User
Posts: 2
Joined: Thu 2022-01-20 12:15

VS1010D Memorize the setting value

Post by Hiro »

If you add the following processing and start it again with PWRBTN, the setting value will be initialized.
Is it possible to remember the settings such as volume?
printf("ECO Mode ON\n");
Disable(); /* No more interupts */
SetPLL(1); /* 1X clock */
/* Enable bits down */
PERIP(ANA_CF0) = 0;
PERIP(ANA_CF1) = 0;
PERIP(ANA_CF2) = 0;
PERIP(ANA_CF3) = 0;
/* Drive GPIO pins down */
PERIP(GPIO0_ODATA) = 0;
PERIP(GPIO1_ODATA) = 0;
PERIP(GPIO2_ODATA) = 0;
/* Shutdown regulators */
PERIP(REGU_CF) = 0;
PERIP(REGU_CF) = REGU_CF_AOFF | REGU_CF_IOOFF | REGU_CF_COFF;
PERIP(REGU_CF) |= REGU_CF_REGCK;
PERIP(REGU_CF) &= ~REGU_CF_REGCK;
DelayL(100000);
User avatar
pasi
VLSI Staff
Posts: 1968
Joined: Thu 2010-07-15 16:04

Re: VS1010D Memorize the setting value

Post by pasi »

Turning off the regulators will cause the voltages to drop and there is no supply to keep the register or memory state. In addition, during the next power-up, a reset is generated to make sure the registers start in consistent state. (Memory is also in powerdown while reset is active.)

You need external volatile storage (SPI EEPROM of FLASH) or provide RTC power to vs1010 from a battery and store your information in the RTC. There is limited number of bits available in the RTC, but enough to store volume and current song number.
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook
Hannu
Senior User
Posts: 362
Joined: Mon 2016-05-30 11:54

Re: VS1010D Memorize the setting value

Post by Hannu »

This will shutdown better:

Code: Select all

	// Regulators off
	PERIP(REGU_CF) = 0;
	PERIP(REGU_CF) = (1 << 4) | REGU_CF_AOFF | REGU_CF_IOOFF | REGU_CF_COFF;
	PERIP(REGU_CF) |=  REGU_CF_REGCK;    /* clk up */
	PERIP(REGU_CF) &= ~REGU_CF_REGCK;    /* clk down */
	DelayL(100000); // Power will finally die during this loop.
And the RTC has 32-bits available.
If more state is needed to store to SPI flash: viewtopic.php?f=15&t=2758
Hiro
User
Posts: 2
Joined: Thu 2022-01-20 12:15

Re: VS1010D Memorize the setting value

Post by Hiro »

Dear Hannu.

I tried to change the regulator that I was told, but the situation did not change.
The setting value will be initialized.
Hannu
Senior User
Posts: 362
Joined: Mon 2016-05-30 11:54

Re: VS1010D Memorize the setting value

Post by Hannu »

Indeed the system will initialize all memory except the 32 bits in RTC. You need external non-volatile memory to save your data if it doesn't fit to 32 bits.

My point for shutdown was the (1 << 4) which causes current consumption to go to zero, not to just about 1 mA
Post Reply