Raymond Jimenez DSP56k User manual

The DSP56k MP3 Player User’s Manual
Raymond Jimenez
June 8, 2011

ii

Introduction
Congratulations! You’re the new owner of a DSP56k-based MP3 player. This
unit was designed by Raymond Jimenez personally, with emphasis in mind
on:
•audiophile-quality playback
•expandibility
•usability
To get started, please flip to the Quick Start Guide on page 3, which
guides you through the basics necessary just to listen to an MP3 file.
For more information about the system, and how to use its advanced
features, please see the User Guide, on page 9.
For developers or interested people, there is additional Developers Docu-
mentation on page 15, which covers the system internals.
Notable features of this system include:
•An emphasis on data bandwidth: all processes that could benefit from
DMA/interrupts do so. We can successfully play 320kBps MP3 files,
and raw WAV files are almost possible. In addition, thanks to our
decoder, we can handle FLAC, OGG, and WMA files at higher bitrate
than MP3.
•An audiophile-grade outpet stage: The analog output stage of this sys-
tem was heavily based on the γ2, designed by AMB audio. As a result,
it rivals even the best sounding professional systems, easily matching
other digital transports in the 1000-dollar range.
•Integrated volume control : Due to our use of the Wolfson WM8741 DAC
chip, we have fine-grained, completely silent, completely integrated vol-
ume control. Future releases may support ReplayGain adjustment.
iii

iv INTRODUCTION

Contents
Introduction iii
I Quick Start Guide 1
1 Quick Start Guide 3
II User Guide 7
2 Basic Usage 9
2.1 TheDisplay............................ 9
2.2 PlayingSongs........................... 10
2.3 VolumeControl.......................... 10
3 Advanced Features 11
3.1 AddingSongs ........................... 11
3.2 Playing non-MP3 files . . . . . . . . . . . . . . . . . . . . . . 12
III Developer Documentation 13
4 System Overview 15
4.1 Introduction to Architecture . . . . . . . . . . . . . . . . . . . 15
4.2 MP3dataflow .......................... 15
4.3 MP3Decoder ........................... 16
4.4 DAC/AnalogStage........................ 18
4.4.1 Power ........................... 18
4.4.2 DAC............................ 18
v

vi CONTENTS
4.5 IDE ................................ 19
4.6 DRAM............................... 19
5 Memory Map and Registers 23
6 Timing 27
6.1 TimingTargets .......................... 27
6.1.1 SRAM........................... 27
6.1.2 ROM............................ 34
6.1.3 DRAM........................... 38
6.1.4 IDE ............................ 45
6.1.5 DAC (via SCI) . . . . . . . . . . . . . . . . . . . . . . 49
6.1.6 MP3 Decoder (via SCI) . . . . . . . . . . . . . . . . . 53
6.1.7 LCDDisplay ....................... 57
6.2 Timing Simulation (CPLD) . . . . . . . . . . . . . . . . . . . 57
7 Schematics 59
7.1 Prototyping Board/CPU . . . . . . . . . . . . . . . . . . . . . 59
7.2 CPLD ............................... 61
7.3 MP3 Decoder Daughterboard . . . . . . . . . . . . . . . . . . 63
7.4 DAC/AnalogOut......................... 65
7.5 Display/Keypad.......................... 67
7.6 IDEInterface ........................... 69
7.7 DRAM & Address Multiplexing . . . . . . . . . . . . . . . . . 71
8 Annotated Code 73
8.1 CPLDCode............................ 73
8.2 Bootup Code (crt0.asm) . . . . . . . . . . . . . . . . . . . . . 87
8.3 Queues (queues.asm) . . . . . . . . . . . . . . . . . . . . . . . 95
8.4 Display (display.inc, display.asm) . . . . . . . . . . . . . . . . 105
8.5 Keypad (keyfunc.inc, keyfunc.asm) . . . . . . . . . . . . . . . 124
8.6 IDEInterface ...........................133
8.7 Sound (DAC & MP3 Decoder) . . . . . . . . . . . . . . . . . . 141
8.8 Timing...............................186
8.9 Interrupts .............................192
8.10UserInterface...........................202
8.11Miscellaneous ...........................222

viii CONTENTS

List of Figures
1.1 Main MP3 Playback Unit . . . . . . . . . . . . . . . . . . . . 4
1.2 MP3 Player’s Keypad . . . . . . . . . . . . . . . . . . . . . . . 5
1.3 LCDDisplayUnit......................... 6
2.1 Typical Appearance of the LCD Display . . . . . . . . . . . . 9
4.1 Overall System Block Diagram . . . . . . . . . . . . . . . . . . 16
4.2 Main Board Components . . . . . . . . . . . . . . . . . . . . . 17
4.3 DRAM Block Diagram . . . . . . . . . . . . . . . . . . . . . . 20
ix

xLIST OF FIGURES

xii LIST OF TABLES

Part I
Quick Start Guide
1


Chapter 1
Quick Start Guide
Your DSP56k MP3 player comes complete with one MP3 hard drive, one
main playback unit (Fig 1.1), one keypad (Fig 1.2), one display unit (Fig
1.3), and one power supply.
In order to play MP3s from the hard drive, connect the main playback
unit to the keypad, display, and hard drive, and power up the hard drive
using its own power supply.
Then, plug in the main unit’s power and wait several seconds. The unit
will boot up, read the hard drive, and will be come ready.
You can then select the song to play, using the keypad depicted in Fig
1.2.
Happy listening!
3

4CHAPTER 1. QUICK START GUIDE
Figure 1.1: Main MP3 Playback Unit

5
Figure 1.2: MP3 Player’s Keypad

6CHAPTER 1. QUICK START GUIDE
Figure 1.3: LCD Display Unit

Part II
User Guide
7

Table of contents