Audio Solutions on the RX MCU Family

39
Renesas Electronics America Inc. © 2012 Renesas Electronics America Inc. All rights reserved. Class ID: Audio Solutions on the RX MCU Family Mitch Ferguson, Applications Engineering Manager 5L071

Transcript of Audio Solutions on the RX MCU Family

Page 1: Audio Solutions on the RX MCU Family

Renesas Electronics America Inc.

© 2012 Renesas Electronics America Inc. All rights reserved.

Class ID:

Audio Solutions on the RX MCU Family

Mitch Ferguson, Applications Engineering Manager

5L071

Page 2: Audio Solutions on the RX MCU Family

© 2012 Renesas Electronics America Inc. All rights reserved. 2 2

Mitch Ferguson

Applications Engineer Manager

Provides support of design teams using ADCs in MCU system.

Over 15 years of system-level design experience

Over 7 years of experience as an application engineer.

As a hardware engineer and engineering manager, he has been involved in design in power distribution controls, automotive and fire alarm systems with focus on analog design and EMI/EMS issues.

Bachelor of science in electrical engineering from Cleveland State University

Page 3: Audio Solutions on the RX MCU Family

© 2012 Renesas Electronics America Inc. All rights reserved. 3

Renesas Technology & Solution Portfolio

Page 4: Audio Solutions on the RX MCU Family

© 2012 Renesas Electronics America Inc. All rights reserved. 4

Microcontroller and Microprocessor Line-up

Wide Format LCDs Industrial & Automotive, 130nm

350µA/MHz, 1µA standby

44 DMIPS, True Low Power

Embedded Security, ASSP

165 DMIPS, FPU, DSC

1200 DMIPS, Performance 1200 DMIPS, Superscalar

500 DMIPS, Low Power

165 DMIPS, FPU, DSC

25 DMIPS, Low Power

10 DMIPS, Capacitive Touch

Industrial & Automotive, 150nm

190µA/MHz, 0.3µA standby

Industrial, 90nm

242µA/MHz, 0.2µA standby

Automotive & Industrial, 90nm

600µA/MHz, 1.5µA standby

Automotive & Industrial, 65nm

600µA/MHz, 1.5µA standby Automotive, 40nm

500µA/MHz, 35µA deep standby

Industrial, 40nm

242µA/MHz, 0.2µA standby

Industrial, 90nm

1mA/MHz, 100µA standby

Industrial & Automotive, 130nm

144µA/MHz, 0.2µA standby

2010 2013

32-b

it

8/1

6-b

it

Page 5: Audio Solutions on the RX MCU Family

© 2012 Renesas Electronics America Inc. All rights reserved. 5

Microcontroller and Microprocessor Line-up

Wide Format LCDs Industrial & Automotive, 130nm

350µA/MHz, 1µA standby

44 DMIPS, True Low Power

Embedded Security, ASSP

165 DMIPS, FPU, DSC

1200 DMIPS, Performance 1200 DMIPS, Superscalar

500 DMIPS, Low Power

165 DMIPS, FPU, DSC

25 DMIPS, Low Power

10 DMIPS, Capacitive Touch

Industrial & Automotive, 150nm

190µA/MHz, 0.3µA standby

Industrial, 90nm

242µA/MHz, 0.2µA standby

Automotive & Industrial, 90nm

600µA/MHz, 1.5µA standby

Automotive & Industrial, 65nm

600µA/MHz, 1.5µA standby Automotive, 40nm

500µA/MHz, 35µA deep standby

Industrial, 40nm

242µA/MHz, 0.2µA standby

Industrial, 90nm

1mA/MHz, 100µA standby

Industrial & Automotive, 130nm

144µA/MHz, 0.2µA standby

2010 2013

32-b

it

8/1

6-b

it

Page 6: Audio Solutions on the RX MCU Family

© 2012 Renesas Electronics America Inc. All rights reserved. 6

Microcontroller and Microprocessor Line-up

Wide Format LCDs Industrial & Automotive, 130nm

350µA/MHz, 1µA standby

44 DMIPS, True Low Power

Embedded Security, ASSP

165 DMIPS, FPU, DSC

1200 DMIPS, Performance 1200 DMIPS, Superscalar

500 DMIPS, Low Power

165 DMIPS, FPU, DSC

25 DMIPS, Low Power

10 DMIPS, Capacitive Touch

Industrial & Automotive, 150nm

190µA/MHz, 0.3µA standby

Industrial, 90nm

242µA/MHz, 0.2µA standby

Automotive & Industrial, 90nm

600µA/MHz, 1.5µA standby

Automotive & Industrial, 65nm

600µA/MHz, 1.5µA standby Automotive, 40nm

500µA/MHz, 35µA deep standby

Industrial, 40nm

242µA/MHz, 0.2µA standby

Industrial, 90nm

1mA/MHz, 100µA standby

Industrial & Automotive, 130nm

144µA/MHz, 0.2µA standby

2010 2013

32-b

it

8/1

6-b

it

32-Bit High Performance DSP, FPU with High Integration

Page 7: Audio Solutions on the RX MCU Family

© 2012 Renesas Electronics America Inc. All rights reserved. 7

‘Enabling The Smart Society’

Challenge: “Improving the interface to the new smart machines is one of the important concepts of the Smart Society. Audio is an effective way of improving information delivery”

Solution:

“This class will show you how simple it can be to add various levels of audio to your next project”

Page 8: Audio Solutions on the RX MCU Family

© 2012 Renesas Electronics America Inc. All rights reserved. 8

Agenda

Discuss audio formats and requirements

Embedded applications not high quality music players

Hardware Requirements

DAC

PWM

RX Audio Demo Components

Basic decoding scheme

Peripheral Blocks

Lab

Summary

Page 9: Audio Solutions on the RX MCU Family

© 2012 Renesas Electronics America Inc. All rights reserved. 9

Audio Experience

BMW pursuing better acoustics to improve efficiency

Audio used to compensate for low RPM rumble

- At Mercedes-Benz...engineers record the sounds of those servo motors used to raise the windows and adjust the seats, then compare them with sounds made by a BMW and other competitor

if it sounds well made, it probably is

Do Your Products Sound Priceless?

Page 10: Audio Solutions on the RX MCU Family

© 2012 Renesas Electronics America Inc. All rights reserved. 10

Audio Considerations

Page 11: Audio Solutions on the RX MCU Family

© 2012 Renesas Electronics America Inc. All rights reserved. 11

Key Considerations

What type of audio is needed

Simple tones

Speech

Music

What are characteristics and requirements

File size

– Internal Flash

– External file storage

– File system

MCU and Bus Bandwidth

Transducer (speaker)

Amplifier/filter requirements

Page 12: Audio Solutions on the RX MCU Family

© 2012 Renesas Electronics America Inc. All rights reserved. 12

Sample Rates and Quality

8kHz, 8 bits

Telephone quality

11kHz

passable voice

22kHz, 8 bits,

good for a mix of mono speech and music.

44.1kHz , 16 bits

Good for audio and quality speech

© 2010 Renesas Electronics America Inc. All rights reserved.

Page 13: Audio Solutions on the RX MCU Family

© 2012 Renesas Electronics America Inc. All rights reserved. 13

Telephone or Voice quality

Bandwidth: 180 Hz to 3.2 kHz

Low end avoids 60 Hz region.

Noise pickup

Size of transformers

High end bandwidth issue

8 kHz sampling rate

sufficient for speech intelligibility

Signal to Noise: Approximately 45 dB

Human voice extends from 80 Hz to 14 kHz

Lab will investigate voice quality

Spectrum of Audio Clip

Page 14: Audio Solutions on the RX MCU Family

© 2012 Renesas Electronics America Inc. All rights reserved. 14

Bandwidth, Storage and Dynamic Range

Page 15: Audio Solutions on the RX MCU Family

© 2012 Renesas Electronics America Inc. All rights reserved. 15

Dynamic Range – How many bits?

48 dB = 8 bit

60 dB = 10 bit

96 dB = 16 bit

144 dB = 24 bit

Page 16: Audio Solutions on the RX MCU Family

© 2012 Renesas Electronics America Inc. All rights reserved. 16

Improving Dynamic Range Use signal compression techniques

u-Law or A-law

– 8 bit data, 8K sampling rate = 8kB/sec

– Compression ratio 2:1

Page 17: Audio Solutions on the RX MCU Family

© 2012 Renesas Electronics America Inc. All rights reserved. 17

Signal Compression - ADPCM

PCM stores digitized audio - WAVE is a PCM file

DPCM (Differentia) stores the difference from predicted last sample

ADPCM – Adaptive – adapts step size for better compression (4:1}

Page 18: Audio Solutions on the RX MCU Family

© 2012 Renesas Electronics America Inc. All rights reserved. 18

Audio Data Compression

Format (compression type) Bitrate (Kbps) Filesize (KB/min)

Uncompressed WAV 1411 105,000

MP3 128 960

MP3 (VBR) 112 840RA 96 720

WMA 92 690

OGG 112 840

MPC 88 660

AAC 80 600

AC3 967 720

Comparison Audio Files

Page 19: Audio Solutions on the RX MCU Family

© 2012 Renesas Electronics America Inc. All rights reserved. 19

Hardware requirements

Page 20: Audio Solutions on the RX MCU Family

© 2012 Renesas Electronics America Inc. All rights reserved. 20

DAC or PWM Output

Which is better?

DAC is simple

DAC resolution must be considered

DAC settling time may limit actual audio range

PWM very flexible, available on most MCUs

PWM resolution may be limited depending on carrier

Page 21: Audio Solutions on the RX MCU Family

© 2012 Renesas Electronics America Inc. All rights reserved. 21

Filter Considerations

DAC output should have filter

Basically same requirement as anti-aliasing filter on ADC

Should filter all frequencies above sampling rate/2

May cause amplitude distortion

Buffer and filter can be combined

Output resistance of the DAC should be considered in the filter design

Simple RC acceptable in many applications

Some systems like audio the speaker or listener filters many of the unwanted higher frequencies

Page 22: Audio Solutions on the RX MCU Family

© 2012 Renesas Electronics America Inc. All rights reserved. 22

PWM vs DAC Resolution

At 10 kHz DAC settling time (3 uS) should not be a problem so all 1024 states of 10 bit DAC available

Using 16 bit MTU timer

48 Mhz / 44.1 kHz = 1088

Can utilize more that 10 bits (1024)

Increased resolution just adds audio dynamic range

If a lower resolution audio is used interrupts can be “skipped” while still using PWM carrier

© 2010 Renesas Electronics America Inc. All rights reserved.

Page 23: Audio Solutions on the RX MCU Family

© 2012 Renesas Electronics America Inc. All rights reserved. 23

DAC Output Resistance

Important specification of DAC

Relatively high for many MCU DACs

May require buffering in many cases

Some MCUs have internal buffer

If no internal buffer

Rload >> Ro to prevent loading

Rload>2*Resolution* Ro for <1/2 bit error

Ro on RX63N is 3.6K

DAC

Ro Rload

Vload

Page 24: Audio Solutions on the RX MCU Family

© 2012 Renesas Electronics America Inc. All rights reserved. 24

DAC Filter

Frequency / Hertz

500m 1 2 5 10 20 50 100 200 500 1k 2k 5k 10k 20k 50k 100k

Gain

/

10m

20m

50m

100m

200m

500m

1

2.5 kHz First Order Filter

Typically first order filter not enough

Often use amplifier and filter

Page 25: Audio Solutions on the RX MCU Family

© 2012 Renesas Electronics America Inc. All rights reserved. 25

Filter Considerations

Time/mSecs 1mSecs/div

-0 1 2 3 4 5

V

-1.2

-1

-0.8

-0.6

-0.4

-0.2

-0

0.2

0.4

0.6

0.8

1

Page 26: Audio Solutions on the RX MCU Family

© 2012 Renesas Electronics America Inc. All rights reserved. 26

RX Audio Demo

Page 27: Audio Solutions on the RX MCU Family

© 2012 Renesas Electronics America Inc. All rights reserved. 27

Renesas RX63N RDK J-Link

debugger

Speaker

Stereo headphone

jack

LED

Ring

SD-Card

Graphics

LCD

User push

buttons

POT

VR1

MIC and

amplifier

Page 28: Audio Solutions on the RX MCU Family

© 2012 Renesas Electronics America Inc. All rights reserved. 28

RX Audio Demo

SD-Card stack & low-level drivers

FAT file system browser

Supports

MP3

WAV

ADPCM

Stereo PWM output

Software volume control

YRDK RX63N

© 2012 Renesas Electronics America Inc. All rights reserved.

Page 29: Audio Solutions on the RX MCU Family

© 2012 Renesas Electronics America Inc. All rights reserved. 29 © 2012 Renesas Electronics America Inc. All rights reserved.

RX Audio Demo - supported formats

MP3

MPEG-1/Audio(ISO/IEC11172-3)LayerIII

MPEG-2/Audio(ISO/IEC 13818-3)LayerIII

MPEG-2.5 (For Low Sampling Frequencies)

ADPCM

WAV (uncompressed PCM)

16-bit stereo or mono ( 1 or 2 channels)

Sample rates (kHz)

44.1, 33.075, 22.05, 11.025

Page 30: Audio Solutions on the RX MCU Family

© 2012 Renesas Electronics America Inc. All rights reserved. 30 © 2012 Renesas Electronics America Inc. All rights reserved.

RX Audio Demo Decode path block diagram

SD-Card

RSPI MMC FAT MP3 Render

Raw binary Blocks File I/O MP3

decode Timers

Page 31: Audio Solutions on the RX MCU Family

© 2012 Renesas Electronics America Inc. All rights reserved. 31 © 2012 Renesas Electronics America Inc. All rights reserved.

RX Audio Demo

Rendering block diagram

Render

Ping

Pong

DTC TPU

L

R

Sample Rate

Ready for next PCM data sample

Reload

Load next PCM sample

Page 32: Audio Solutions on the RX MCU Family

© 2012 Renesas Electronics America Inc. All rights reserved. 32 © 2012 Renesas Electronics America Inc. All rights reserved.

Timer Operation

Timer count value

Elapsed time

TPU1.TGRB

TPU0.TGRA

TPU0.TGRB

TPU1.TGRB clears all channels at the audio sample rate

Channel A PWM

Channel B PWM

Sets Playback Rate

Page 33: Audio Solutions on the RX MCU Family

© 2012 Renesas Electronics America Inc. All rights reserved. 33 © 2012 Renesas Electronics America Inc. All rights reserved.

RX Audio Demo

MCU peripherals used

Two synchronizable "TPU" timer channels for PWM

audio rendering.

Data Transfer Controller (DTC) for streaming PWM

timer data to the TPU timers.

RSPI channel for SDCard communication

12-bit ADC to measure the potentiometer setting

for audio playback volume

1 Compare Match Timer (CMT) channel for timed

delays in SDCard driver code

Real-time clock (RTC)--used for file time stamp

Page 34: Audio Solutions on the RX MCU Family

© 2012 Renesas Electronics America Inc. All rights reserved. 34

Lab Time !

Page 35: Audio Solutions on the RX MCU Family

© 2012 Renesas Electronics America Inc. All rights reserved. 35

Summary

Audio formats and requirements

How good is “voice quality”

Hardware

DAC

PWM

Audio

Various quality levels depending on need

Trade-off

– File storage size

– Decode bandwidth

– Quality

Page 36: Audio Solutions on the RX MCU Family

© 2012 Renesas Electronics America Inc. All rights reserved. 36

Questions?

Page 37: Audio Solutions on the RX MCU Family

© 2012 Renesas Electronics America Inc. All rights reserved. 37

‘Enabling The Smart Society’

Challenge: “Improving the interface to the new smart machines is one of the important concepts of the Smart Society. Audio is one of the most effective ways of improving information delivery”

Solution:

“This class will show you how simple it can be to add various levels of audio to your next project”

Page 38: Audio Solutions on the RX MCU Family

© 2012 Renesas Electronics America Inc. All rights reserved. 38

Please utilize the ‘Guidebook’ application to leave feedback

or

Ask me for the paper feedback form for you to use…

Please Provide Your Feedback…

Page 39: Audio Solutions on the RX MCU Family

Renesas Electronics America Inc.

© 2012 Renesas Electronics America Inc. All rights reserved.