VS1063 UART

Writing software for systems that use VLSI Solution's devices as slave codecs to a host microcontroller.
Post Reply
yanghuiyou2008
User
Posts: 1
Joined: Fri 2012-10-19 7:59

VS1063 UART

Post by yanghuiyou2008 »

HI,
I am sorry ,i am poor in English.
I want to ask a question ,How to make VS1063 to transmit encoded data via UART mode.


Thank you .
User avatar
Panu
VSDSP Expert
Posts: 2829
Joined: Tue 2010-06-22 13:43

Re: VS1063 UART

Post by Panu »

Hi!

From datasheet chapter 10.7.1:
If SCI_AICTRL3 bit 13 is set at encode/codec startup, UART transmission of data is initialized
with parameters taken from parametric_x.

If you want to use UART transmission, you must first write the tx configuration values, then set the AICTRL3 UART TX enable bit, and only after that start the encoding/codec mode using SCI_MODE register.

UART is configured from parametric_x.i.encoding, that part of of the parametric structure is no longer cleared at software reset.

parametric_x.i.encoding.txUartDiv = UART divider register value or 0 to use byteSpeed
parametric_x.i.encoding.txUartByteSpeed = UART byteSpeed (e.g. 11520 = 115200 bit/s)
parametric_x.i.encoding.txPauseGpio = GPIO mask for transmit flow control
To write to parametric_x, set SCI_WRAMADDR to the address of the parameter you want to update, then write the value to SCI_WRAM. (e.g. txUartByteSpeed is at address 0x1e2b). See chapter 10.11.

-Panu
Thomas
User
Posts: 3
Joined: Thu 2014-03-06 16:27

Re: VS1063 UART

Post by Thomas »

Hi!
if set parametric_x.i.encoding.txUartDiv 0
how to set parametric_x.i.encoding.txPauseGpio?


if parametric_x.i.encoding.txUartDiv is not zero?
for example, UART Baud rate is 921600, how to set parametric_x.i.encoding.txUartDiv?

Thanks!
User avatar
pasi
VLSI Staff
Posts: 2174
Joined: Thu 2010-07-15 16:04

Re: VS1063 UART

Post by pasi »

0 is a safe value for txPauseGPIO. It means there is no flow control.

The UART divider needs to be calculated from the internal clock. Note that with the patches package the clock adder is always used in the encoding mode.

First calculate for example 5.0x clock and 921600bps:
CLKI = 12.288MHz * 5.0 = 61.44 MHz
div = CLKI / 921600 = 66.6666.. = ~ 67
bps = CLKI / 67 = 917014
So, the actual rate will be 0.5% off, but should work.
Separate the 67 into two dividers. My script says the following.
67: 1* 67= 67 1.0000 0x0043
So, write 0x0043 to txUartDiv.
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook
Post Reply