Page 2 of 2

Re: Problems getting started with VS1063

Posted: Tue 2018-10-16 12:48
by pasi
At least I seem to run into a powering issue. The uSD card I used takes a lot of current when writing, and it seems the power supply of the prototyping card cannot always handle that (especially with the NiMH rechargables I use).

Feeding 2V8 from external power seems to remove the crashes and other strange effects and I can get back to checking the code.

Re: Problems getting started with VS1063

Posted: Tue 2018-10-16 14:08
by jdtengineering
That seems like a logical explanation. After connection a 2V8 power supply to the board, I was able to record something successfully. Strange enough, after the first time I didn't succeed anymore. The device seems to hang after "Init Record".

Checking with my scope I did see a pretty big drop in voltage on the 2V8 line, down to 2V for about 200 µS, on inserting the SD card. (without the external supply connected)

edit:
Even with connecting an external supply, the voltage drops briefly to about 2 V. I'll try adding a bypass cap close to the SD card to see if that makes a difference.

Re: Problems getting started with VS1063

Posted: Tue 2018-10-16 15:55
by pasi
Newer cards have a dedicated regulator for the uSD/SD card.

Re: Problems getting started with VS1063

Posted: Tue 2018-10-16 16:19
by jdtengineering
pasi wrote:
Tue 2018-10-16 15:55
Newer cards have a dedicated regulator for the uSD/SD card.
I'm assuming you mean newer boards here? I've attached a separate power supply and soldered a 10 µF low ESR cap close to the SD card and the voltage sag is gone. The good news is I can now make recordings with 2 out of 4 SD cards. The bad news is that I still run into problems with the other 2 SD cards. I'll make a separate topic for those issues.

Re: Problems getting started with VS1063

Posted: Tue 2018-10-16 16:26
by pasi
The prototyping board regulator for IOVDD doesn't have much reserve, and the switching transformer from the battery may not give enough current either due to the battery not being able to provide it. The powering of the vs10xx prototyping board has just not been scaled to the cards existing now.

It seems I was thinking about the early vs1000 players where the vs1000 provided IOVDD to the MMC/SD card from its internal IOVDD regulator, but its limits were soon reached when cards became faster and more current-hungry.

So, the current development boards and the audio modules have a separate regulator powering the uSD/SD. As an added benefit some designs can control the regulator, allowing to reset the card.

Re: Problems getting started with VS1063

Posted: Mon 2019-01-07 15:52
by mgonen
Hello,
I am using VS1063a in my project. I want to use VS1063a with STM32F4xx as master-slave. In this case I have 2 questions to you,

1) I reached patches for VS1063a but I have no idea that how to apply these patches. How can I apply patches to VS1063 ? Could you please share example source code for appliying patches ?
2) I want to get encoded data from UART. I believe that firstly I have to change parametric.structure to use uart, but I don't know what I have to do to apply right parametric.stucture regulation. Could you help me for using UART of VS1063a

Re: Problems getting started with VS1063

Posted: Mon 2019-01-07 17:18
by pasi
You load the patches through the serial control interface (SCI) after each hardware and software reset. The patches file itself shows a pseudo-C code how to load the patch once you have a working SCI register write routine.

See Microcontroller examples (there should be a recording example too): viewtopic.php?f=11&t=840

Also see chapter 11.10.9 from vs1063a datasheet for the UART values. Basically you write 0x1e2a to SCI_WRAMADDR, then write 0 to WRAM (sets parametric_x.uartDiv to 0), then write the uart baudrate divided by 10 to WRAM. After that set the correct encoding mode in AICTRL3 with the UART output enabled and start the encoding mode.

Re: Problems getting started with VS1063

Posted: Mon 2019-02-25 11:20
by mgonen
Hello Pasi
I activated uart and saw mp3 frames. But I have a problem to start encoding. Some times encoding doesnt start and I starts encoding after I tried many times.
My code is as below;
VS1063_HW_init()
{
GPIO_writePin(CS_Pin, PIN_SET); // Chip select high
GPIO_writePin(XRESET_Pin, PIN_SET); //XRESET SET
GPIO_writePin(XRESET_Pin, PIN_RESET); //XRESET low
Delay(50); //50ms
GPIO_writePin(XRESET_Pin, PIN_SET); //XRESET high
}
VS1063_SW_init()
{
WriteSci(SCI_CLOCKF, 0xC800);
WriteSci(SCI_AICTRL0, 0xBB80);
WriteSci(SCI_WRAMADDR, 0x1E2A);
WriteSci(SCI_AICTRL3, 0x2060);
WriteSci(SCI_WRAM, 0x0000);
WriteSci(SCI_WRAM, 0x2D00); //set boudrate 115200
WriteSci(SCI_AICTRL1, 0x0400);
WriteSci(SCI_VOL, 0x0101);
WriteSci(SCI_MODE, 0x5806); //activate encoding
LoadUsercode(); //apply patch
}
Could you please help me ?

Best Regards
Mevlüt

Re: Problems getting started with VS1063

Posted: Mon 2019-02-25 16:27
by pasi
Your probable issue: If you load patch code, you have to do that before starting the encoding. Also, how to start encoding changes a bit.

1. Deassert reset, wait for DREQ, write CLOCKF (and other general registers you also need for the decoding mode).
2. LoadUserCode(); to load the patch (starts automatically)
3. Set encoding parameters.
4. Set SM_ENCODE in SCI_MODE, then write 0x50 to SCI_AIADDR to (re)start the patch. It will then detect the SM_ENCODE bit and jump to the encoding function.

Re: Problems getting started with VS1063

Posted: Wed 2019-02-27 18:35
by mgonen
Thanks for reply.

I solved this problem by using your suggestions. Thank you.