Template 03

download Template 03

of 29

Transcript of Template 03

  • 7/28/2019 Template 03

    1/29

    LOGO

    Lab Supervisor Dr. WH Lau

    EE3271 Design Laboratory

  • 7/28/2019 Template 03

    2/29

    LOGO

    Aims and Objectives

    Design and implement a MP3 Player

    Learn the ICs operation and how to useprogram to drive the ICs work.

    Learn data transfer in between ICs

  • 7/28/2019 Template 03

    3/29

    LOGO

    MP3 Overall Flow

  • 7/28/2019 Template 03

    4/29

    LOGO

  • 7/28/2019 Template 03

    5/29

    LOGO

    Block Diagram of MP3 Player

  • 7/28/2019 Template 03

    6/29

    LOGO

    Components Description

    LPCEB2000-B Processor Board

    Installed with a Philips ARM processor LPC2292

    Two debugging modes are available via

    JTAG_EN Jumper and ETM_EN Jumper

    Boot set jumper: can boot from internal flash orexternal flash by jumper set.

    Two I/O ports (P0.0-31, P1.0-31) for I/Ointerface

  • 7/28/2019 Template 03

    7/29

    LOGO

    J1, J2, J3, J4 are connectors for external businterface. J1 and J3 are 40 Pins, J2 and J4 are20 Pins. J1 and J2 are used to connect the board

    to applied board, J3 and J4 are used to extendupwards

    J1

    J2

    J3

    J4

  • 7/28/2019 Template 03

    8/29

    LOGO

    STA015

    Microelectronics MP3 decoder chip

    An MPEG Layer III audio decoder with ADPCMcompression / decompression capabilities and BYPASSmode for auxiliary audio sources post-processing

    Decodes elementary streams compressed by using lowsampling rates

    Receives the input data through a Serial input Interface

    The decoded signal can be a stereo, mono, or dualchannel digital output.

    Interfaced to LPC2292 using the I2C and SPI interfacepins of Port 0

    Equipped with a buffer

  • 7/28/2019 Template 03

    9/29

    LOGO

    CS4334

    Stereo digital-to-analog output systems includinginterpolation, 1-bit D/A conversion and output analogfiltering in an 8-pin package

    Adjustment of sample rate between 2 kHz and 100 kHzsimply by changing the master clock frequency

    On-chip digital de-emphasis, operates from a single +5V power supply, and requires minimal support circuitry

    Ideal for portable CD players and other portableplayback systems

    Directly connected to the output of STA015 via the IISinterface

  • 7/28/2019 Template 03

    10/29

    LOGO

    LCD Display

    16 characters, 2 rows LCD module

    Requires 8-bit ASCII character input and 3 input

    control signals

    Use for testing wire-wrapped board is correctlyinstalled

  • 7/28/2019 Template 03

    11/29

    LOGO

    Bus Setting - I2C

    A bi-directional 2-wire bus for efficient inter-ICcontrol

    There are Serial Data Line (SDA) and Serial

    Clock Line (SCL)In this lab, we used I2C to configure the STA015.

  • 7/28/2019 Template 03

    12/29

  • 7/28/2019 Template 03

    13/29

    LOGO

    Bus Setting SPI

    SPI (Serial Peripheral Interface)

    Uses the MOSI (Master Output Slave Input) andMISO (Master Input Slave Output) pins to

    perform serial byte data transfer.In this lab, we use SPI to stream the data from

    LPC2292 to STA015.

  • 7/28/2019 Template 03

    14/29

    LOGO

    The flow of bus

    SCK

    SSEL

    MISO, MOSI

    SCK

    WS

    SD

  • 7/28/2019 Template 03

    15/29

    LOGO

  • 7/28/2019 Template 03

    16/29

    LOGO

    Design Flow

    System Initialization

    LCD Initialization

    I2C Initialization

    STA015 Initialization

    SPI Initialization

    STA015 Data Request Signal (Polling)

    Play song

  • 7/28/2019 Template 03

    17/29

    LOGO

    System Initialization

    Set all the port 0 to GPIO ports

    Set the PLL Clock frequency to 60MHz

    Code: System_Init() in LCD.c

  • 7/28/2019 Template 03

    18/29

    LOGO

    LCD Initialization

    Set the LCD data pins

    By sending command to set the preferences ofthe LCD display

    Code: LCD_Init() in LCD.cRelated functions:

    --SendCommand(char cmd);

    --sendchar(char a);

    --LCD_output(char *str);

  • 7/28/2019 Template 03

    19/29

    LOGO

    I2C Initialization

    Code: I2C_Init() in I2C_Test.c

    Related functions:

    --I2C_IRQ_Srv();

    --uint8 I2CTest_SendStr(uint8SlaveAddr, uint8 WrAddr,uint8*Str,uint8 number);

    --uint8 I2CTest_RcvStr(uint8 SlaveAddr,uint8 RDAddr,uint8 *Str,uint8 number);

  • 7/28/2019 Template 03

    20/29

    LOGO

    STA015 Initialization

  • 7/28/2019 Template 03

    21/29

    LOGO

    STA015 Initialization

    Code: sta015_init() in sta015.c

  • 7/28/2019 Template 03

    22/29

    LOGO

    SPI Initialization

    Modify the Clock of SPI

    Update the spi_set() function

    Code: SPI_Init() in SPI_Test.c

    Related functions: spi_set()

  • 7/28/2019 Template 03

    23/29

    LOGO

    STA015 Data Request Signal (Polling)

    Code: Main() in mp3.cwhile(1){

    if ((IOPIN0 & P30) == P30) {

    spi_set(*song1);

    song1++;}

    ..

    }

  • 7/28/2019 Template 03

    24/29

    LOGO

    Play song

    Download a mp3 file to a particular addressthrough EmbestIDE softwares

    Run all the initialialzation functions

    Signal spi to send data

    Code: Main() in mp3.c

  • 7/28/2019 Template 03

    25/29

    LOGO

  • 7/28/2019 Template 03

    26/29

    LOGO

    Testing

    Check register $01(IDENT) , return 0xAC ifSTA015 is presence

    Using the Oscilloscope

    -- Checking I2C Clock, I2C Data-- Checking SPI Clock, SPI Data

    -- Checking 1KHz tone frequency

  • 7/28/2019 Template 03

    27/29

    LOGO

    Difficulties Encountered

    Unclear concept of STA015

    Using wrong Oversampling Ratio

    Missing Hardware Reset

    Missing Data Request

  • 7/28/2019 Template 03

    28/29

    LOGO

    Conclusion

    What we had learnt

    -- Project Management

    -- STA015 configuration

    -- Debugging with Oscilloscope

    -- Practically understand I2C and SPI data

    transfer bus

  • 7/28/2019 Template 03

    29/29

    LOGO