VS1053B PCM Mixer. VSMPG VLSI Solution Audio Decoder. Project Code: Project Name:

Similar documents
VS1053B EQ5. VSMPG VLSI Solution Audio Decoder

VS10XX REAL-TIME MIDI INPUT

VS1063A SDIENCODER. VLSI Solution Audio Decoder/Encoder

VS1003 ADC SPECTRUM ANALYZER

VS1053B PATCHES AND FLAC DECODER

VS1063A PATCHES. VLSI Solution Audio Decoder/Encoder

Interfacing I2S DAC. Public Document. VS10XX AppNote: I2S DAC

VLSI Solution. VS10XX - Plugins. Plugins, Applications. Plugins. Description. Applications. Patches. In Development. Public Document.

Music Shield User Manual

VS1033 to VS1053. Public Document. VS10XX AppNote: VS1033 to VS1053 migration checklist. This document applies to all versions of VS1033 and VS1053.

VS10XX APPNOTE: CONNECTING SPI BUSES

VLSI Solution. VS1003B 16/32-Button Player. Controlled Document. VSMPG VLSI Solution Audio Decoder. Project Code: Project Name: Revision History

MSP430F149 P3.4/UTXD0 P3.5/URXD0 P1.5 P1.6 P1.7 MSP430F149 P1.0 P5.4 P5.3 P5.2 P5.1. Figure B-1. BSL Replicator Block Diagram

Contents 1. ROM CODE FEATURE ROM CODE STRUCTURE INTERRUPT VECTOR AND PROGRAM-ORIENTED RAM RESOURCE AND ARRANGEMENT...

VS MP3 AUDIO CODEC

ArduCAM-M-2MP Camera Shield

VS1011b - MP3 AUDIO CODEC

VS1003 to VS1053. VS1003 to VS1053 Migration Guide

MM Update for A3222Q56

char errormsg[100]; //This is a generic array used for sprintf of error messages

VLSI Solution. VS1053 audio i/o APPLICATION NOTE. Preliminary Document. Revision History

Kinetis Bootloader to Update Multiple Devices in a Field Bus Network

IP-48DAC channel 16-bit Digital/Analog Converter With memory Industry Pack Module PROGRAMMING MANUAL Version 1.

VS1002d - MP3 AUDIO CODEC

Music Shield V2.2. Introduction

Application Note. Introduction AN2471/D 3/2003. PC Master Software Communication Protocol Specification

Module 10 MULTIMEDIA SYNCHRONIZATION

UM1641 User manual. Sampling rate conversion SRC236 library software expansion for STM32Cube. Introduction

Encoder Core. API Specification. Revision: SOC Technologies Inc.

Microprocessors and rpeanut. Eric McCreath

AN127 FLASH PROGRAMMING VIA THE C2 INTERFACE. Relevant Devices. Introduction. C2 Interface

Microprocessors. Microprocessors and rpeanut. Memory. Eric McCreath

VS1002d - MP3 AUDIO CODEC

460 Presentation Audio Mixer

Ethernet Access Library for QB

THE STA013 AND STA015 MP3 DECODERS

Using the FADC250 Module (V1C - 5/5/14)

Application Note One Wire Digital Output. 1 Introduction. 2 Electrical Parameters for One Wire Interface. 3 Start and Data Transmission

App Note Application Note: State-Driven Control of a dpasp using a Microchip PIC.

VS1053 STANDALONE PLAYER

DCS 6000 External Microphone Control

VS1063 ENCODER DEMONSTRATION

VS1011 to VS1053. VS1011 to VS1053 Migration Guide

C Language Programming, Interrupts and Timer Hardware

FLASH Programming in Production of VS1000 Applications

AFRecorder 4800R Serial Port Programming Interface Description For Software Version 9.5 (Last Revision )

a data type is Types

bytes per disk block (a block is usually called sector in the disk drive literature), sectors in each track, read/write heads, and cylinders (tracks).

Interrupt vectors for the 68HC912B32. The interrupt vectors for the MC9S12DP256 are located in memory from 0xFF80 to 0xFFFF.

// fontdata6x8.h //WARNING: This Font is usable only with MikroE GLCD Lib. // X-GLCD Lib does not handle this font.

Using the MPC5777M MCAN Module to Exchange CAN FD Messages

Jin-Soo Kim Systems Software & Architecture Lab. Seoul National University. Integers. Spring 2019

Communication Protocol Reference Manual

F28335 I2C MODULE v1.1

EE Embedded Systems Design. Lessons Exceptions - Resets and Interrupts

FnIO S-Series. FnIO MODBUS Adapter Specification Rev 1.00 NA-9473 (MODBUS/RS485) Page 1 of 30. NA-9473 (MODBUS/RS485) Adapter

CSE 509: Computer Security

NOVOtechnik SIEDLE GRUPPE

Technical Information Manual

HDR and Dolby Atmos Support for DTA-2195

URCOM. User s Manual

VS1001k - MPEG AUDIO CODEC

VS1011e. VS1011e - MP3 AUDIO DECODER. Features. Description VS1011

The modules in this lab room are 4 line by 16 character display modules. The data sheet/users manual for the module is posted on My.Seneca.

Taking Advantage of Using the dmax DMA Engine in Conjunction with the McASP Peripheral on the TMS320C67x DSP

Requirements. Left To Implement. Design. Extended Plugin Interface

USB3DevIP Data Recorder by FAT32 Design Rev Mar-15

GUIDE: MP3 / OGG VORBIS ENCODER AND AUDIO CODEC CIRCUIT

EE445M/EE380L.6 Quiz 2 Spring 2017 Solution Page 1 of 5

Memory Management Outline. Operating Systems. Motivation. Paging Implementation. Accessing Invalid Pages. Performance of Demand Paging

HOW TO DIVIDE BOOT AND FLASH AREAS

dotstack integration with STM32F4 & FreeRTOS.

SGTL5000 Initialization and Programming

This application note describes the specification of the JPEG codec unit (in the following, JCU) driver of SH7268/SH7269.

PMC-DA Channel 16 Bit D/A for PMC Systems REFERENCE MANUAL Version 1.0 June 2001

CSCI 2212: Intermediate Programming / C Chapter 15

Representation of Information

Binary Representations and Arithmetic

Dante Gonzales and Ian Doten

CODA Online Data Formats

EE4390 Microprocessors

8032 MCU + Soft Modules. c = rcvdata; // get the keyboard scan code

C Language Programming, Interrupts and Timer Hardware

F2MC-8FX EEPROM Library

COMMUNICATION MODBUS PROTOCOL

Real-time Systems SMD138. Lecture 8: Examples of reactive objects

STM32-MP3NL/DEC. STM32 audio engine MP3 decoder library. Description. Features

Spring 2018 :: CSE 502. Main Memory & DRAM. Nima Honarmand

SECTION 5 ADDRESS GENERATION UNIT AND ADDRESSING MODES

Audio Controller i. Audio Controller

Read section 8 of this document for detailed instructions on how to use this interface spec with LibUSB For OSX

VS1063a HW Guide. VS1063a HARDWARE GUIDE MP3/OGG/AAC/WMA/FLAC/ G.711/G.722 AUDIO CODEC CIRCUIT

What happens when an HC12 gets in unmasked interrupt:

CS 241 Data Organization Binary

Opus Generated by Doxygen Thu May :22:05

DMTME Multimeters. Communication protocol. Technical specification V1.2 ABB

Micriµm, Inc. µc/os-view

AMC13 Register Display Documentation

NEW CEIBO DEBUGGER. Menus and Commands

Bachelor of Engineering in Computer and Electronic Engineering

Transcription:

Controlled Document VS1053B PCM Mixer VLSI Solution Audio Decoder Project Code: Project Name: Revision History Rev. Date Author Description 1.1 2011-04-27 Rate configured from AICTRL0 1.0 2011-03-14 Initial version Rev. 1.1 2011-04-27 Page 1(5)

1. DESCRIPTION 1 Description The new VS1053 audio path provides a lot of tricks not previously possible. For example it allows audio mixed into output while performing normal decoding. This way you can mix PCM samples with other audio. The PCM mixer allows a mono 8kHz, 12kHz, 16kHz, or 24kHz linear PCM stream be played back during any audio format playback. This audio signal is upsampled to at least 24kHz and played through the SDM side channel of vs1053. Note: only 12.288MHz XTALI is supported. The PCM data is sent through the SCI AICTRL1 register, SCI AICTRL0 tells how much space is in the PCM FIFO (you can send upto this many words). Note that SCI multiple write (see vs1053 datasheet) can be used to write multiple words with minimal overhead. During startup AICTRL0 specifies the sample rate. SCI AICTRL2 controls volume independently of the normal playback volume. SCI AICTRL2 value from 0 to 181 controls PCM volume in 0.5dB steps. Note: only the low 8 bits of SCI AICTRL2 control the volume. Note: to prevent sigma-delta modulator overflow, SCI VOL should be at least 2dB (0x0404), and the sum of SCI VOL and SCI AICTRL2 attenuations at least 6dB (12). If you have not set large enough attenuations, the PCM Mixer adjusts the registers automatically to have at least these values. To have absolutely safe scaling, have 6dB (0x0c0c) or more in both SCI VOL and SCI AICTRL2. The PCM mixer takes about 4.0MHz of processing power when in use with 8 khz rate. Processing will be automatically disabled after a 0.125-second timeout when samples are not being written to SCI AICTRL1. The processing is resumed when there are at least 64 samples in the PCM FIFO (1/4 full). The PCM mixer works with VS1053b Patches Package. If you use the VS1053b Patches package, load it first, then the VS1053 PCM Mixer (PCM Mixer uses the application hook). There plugins are distributed in two formats: the new compressed plugin, and the old loading tables. The new compressed plugin format is recommended, because it saves data space and future plugins, patches, and application will be using the new format. Chip File IRAM Description VS1053B vs1053pcm.plg 0xd00.. 0xe82 compressed plugin VS1053B vs1053pcm.cmd 0xd00.. 0xe82 old atab+dtab format Rev. 1.1 2011-04-27 Page 2(5)

1. DESCRIPTION This patch uses the SDM interrupt vector, so it can not be used with other encoding modes or with ADMixer (but ADMixer can be loaded into memory at the same time). However, it can be used with the vs1053b-patches package. PCM Mixer uses X data RAM 0x3580..0x35a1 (interpolation) and 0x1858..0x1863 (pointers and counters) and Y data RAM 0xeb00..0xebff (PCM FIFO). 1.1 Control Register Description SCI AICTRL0 Free space in the buffer, configures rate at startup SCI AICTRL1 Write to send samples SCI AICTRL2 Write to set volume attenuation for PCM (0..181) Perform the the normal system startup (including loading of the vs1053 patches package if you are using it), then load vs1053pcm.plg, then write your samplerate 8000, 12000, 16000, or 24000 to AICTRL0, you can also write the suitable volume settings to SCI VOL and AICTRL2, then write 0x0d00 to AIADDR to start the PCM Mixer. - read AICTRL0: tells how many samples can be sent - write AICTRL1 to send the samples - write AICTRL2 to set volume attenuation for the PCM stream (only low byte) The PCM Mixer will deactivate in a software reset, so load it again and write 0x0d00 to AIADDR to restart. /*Initialization*/ Mp3WriteReg(SCI_AICTRL0, 8000); /*set rate to 8kHz*/ Mp3WriteReg(SCI_VOL, 0x0c0c); /*lower volume*/ Mp3WriteReg(SCI_AICTRL2, 0x0c); /*set pcm volume*/ Mp3WriteReg(SCI_AIADDR, 0x0d00); /*start pcm mixer*/ /*Check fill state and send PCM data*/ s_int16 samples[32]; s_int16 availspace = Mp3ReadReg(SCI_AICTRL0); if (availspace > 32) { ReadSamples(samples, 32); Mp3WriteRegMultiple(SCI_AICTRL1, samples, 32); Rev. 1.1 2011-04-27 Page 3(5)

2. HOW TO LOAD A PLUGIN 2 How to Load a Plugin A plugin file (.plg) contains a data file that contains one unsigned 16-bit array called plugin. The file is in an interleaved and RLE compressed format. An example of a plugin array is: const unsigned short plugin[10] = { /* Compressed plugin */ 0x0007, 0x0001, 0x8260, 0x0006, 0x0002, 0x1234, 0x5678, 0x0006, 0x8004, 0xabcd, ; The vector is decoded as follows: 1. Read register address number addr and repeat number n. 2. If (n & 0x8000U), write the next word n times to register addr. 3. Else write next n words to register addr. 4. Continue until array has been exhausted. The example array first tells to write 0x8260 to register 7. Then write 2 words, 0x1234 and 0x5678, to register 6. Finally, write 0xabcd 4 times to register 6. Assuming the array is in plugin[], a full decoder in C language is provided below: void WriteVS10xxRegister(unsigned short addr, unsigned short value); void LoadUserCode(void) { int i = 0; while (i<sizeof(plugin)/sizeof(plugin[0])) { unsigned short addr, n, val; addr = plugin[i++]; n = plugin[i++]; if (n & 0x8000U) { /* RLE run, replicate n samples */ n &= 0x7FFF; val = plugin[i++]; while (n--) { WriteVS10xxRegister(addr, val); else { /* Copy run, copy n samples */ while (n--) { val = plugin[i++]; WriteVS10xxRegister(addr, val); Rev. 1.1 2011-04-27 Page 4(5)

3. HOW TO USE OLD LOADING TABLES 3 How to Use Old Loading Tables Each patch contains two arrays: atab and dtab. dtab contains the data words to write, and atab gives the SCI registers to write the data values into. For example: const unsigned char atab[] = { /* Register addresses */ 7, 6, 6, 6, 6 ; const unsigned short dtab[] = { /* Data to write */ 0x8260, 0x0030, 0x0717, 0xb080, 0x3c17 ; These arrays tell to write 0x8260 to SCI WRAMADDR (register 7), then 0x0030, 0x0717, 0xb080, and 0x3c17 to SCI WRAM (register 6). This sequence writes two 32-bit instruction words to instruction RAM starting from address 0x260. It is also possible to write 16-bit words to X and Y RAM. The following code loads the patch code into VS10xx memory. /* A prototype for a function that writes to SCI */ void WriteVS10xxRegister(unsigned char scireg, unsigned short data); void LoadUserCode(void) { int i; for (i=0;i<sizeof(dtab)/sizeof(dtab[0]);i++) { WriteVS10xxRegister(atab[i]/*SCI register*/, dtab[i]/*data word*/); Patch code tables use mainly these two registers to apply patches, but they may also contain other SCI registers, especially SCI AIADDR (10), which is the application code hook. If different patch codes do not use overlapping memory areas, you can concatenate the data from separate patch arrays into one pair of atab and dtab arrays, and load them with a single LoadUserCode(). Rev. 1.1 2011-04-27 Page 5(5)