LOGO Lab Supervisor – Dr. WH Lau EE3271 Design Laboratory.

29
LOGO Lab Supervisor – Dr. WH Lau EE3271 Design Laboratory

Transcript of LOGO Lab Supervisor – Dr. WH Lau EE3271 Design Laboratory.

Page 1: LOGO Lab Supervisor – Dr. WH Lau EE3271 Design Laboratory.

LOGO

Lab Supervisor – Dr. WH Lau

EE3271 Design Laboratory

Page 2: LOGO Lab Supervisor – Dr. WH Lau EE3271 Design Laboratory.

LOGO

Aims and Objectives

Design and implement a MP3 PlayerLearn the ICs operation and how to use program

to drive the ICs work.Learn data transfer in between ICs

Page 3: LOGO Lab Supervisor – Dr. WH Lau EE3271 Design Laboratory.

LOGO

MP3 Overall Flow

Page 4: LOGO Lab Supervisor – Dr. WH Lau EE3271 Design Laboratory.

LOGO

Page 5: LOGO Lab Supervisor – Dr. WH Lau EE3271 Design Laboratory.

LOGO

Block Diagram of MP3 Player

Page 6: LOGO Lab Supervisor – Dr. WH Lau EE3271 Design Laboratory.

LOGO

Components Description

LPCEB2000-B Processor BoardInstalled with a Philips ARM processor LPC2292 Two debugging modes are available via

JTAG_EN Jumper and ETM_EN JumperBoot set jumper: can boot from internal flash or

external flash by jumper set. Two I/O ports (P0.0-31, P1.0-31) for I/O

interface

Page 7: LOGO Lab Supervisor – Dr. WH Lau EE3271 Design Laboratory.

LOGO

J1, J2, J3, J4 are connectors for external bus interface. J1 and J3 are 40 Pins, J2 and J4 are 20 Pins. J1 and J2 are used to connect the board to applied board, J3 and J4 are used to extend upwards

J1

J2

J3

J4

Page 8: LOGO Lab Supervisor – Dr. WH Lau EE3271 Design Laboratory.

LOGO

STA015 Microelectronics MP3 decoder chip An MPEG Layer III audio decoder with ADPCM

compression / decompression capabilities and BYPASS mode for auxiliary audio sources post-processing

Decodes elementary streams compressed by using low sampling rates

Receives the input data through a Serial input Interface The decoded signal can be a stereo, mono, or dual

channel digital output. Interfaced to LPC2292 using the I2C and SPI interface

pins of Port 0 Equipped with a buffer

Page 9: LOGO Lab Supervisor – Dr. WH Lau EE3271 Design Laboratory.

LOGO

CS4334 Stereo digital-to-analog output systems including

interpolation, 1-bit D/A conversion and output analog filtering in an 8-pin package

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

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

Ideal for portable CD players and other portable playback systems

Directly connected to the output of STA015 via the IIS interface

Page 10: LOGO Lab Supervisor – Dr. WH Lau EE3271 Design Laboratory.

LOGO

LCD Display16 characters, 2 rows LCD moduleRequires 8-bit ASCII character input and 3 input

control signals Use for testing wire-wrapped board is correctly

installed

Page 11: LOGO Lab Supervisor – Dr. WH Lau EE3271 Design Laboratory.

LOGO

Bus Setting - I2C

A bi-directional 2-wire bus for efficient inter-IC control

There are Serial Data Line (SDA) and Serial Clock Line (SCL)

In this lab, we used I2C to configure the STA015.

Page 12: LOGO Lab Supervisor – Dr. WH Lau EE3271 Design Laboratory.

LOGO

Bus Setting - Data Request

We use polling to keep checking the data port (EINT3)

When the buffer in STA015 underflow, it will generate a data request signal.

Page 13: LOGO Lab Supervisor – Dr. WH Lau EE3271 Design Laboratory.

LOGO

Bus Setting – SPI

SPI (Serial Peripheral Interface)Uses the MOSI (Master Output Slave Input) and

MISO (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.

Page 14: LOGO Lab Supervisor – Dr. WH Lau EE3271 Design Laboratory.

LOGO

The flow of bus

SCK

SSEL

MISO, MOSI

SCK

WS

SD

Page 15: LOGO Lab Supervisor – Dr. WH Lau EE3271 Design Laboratory.

LOGO

Page 16: LOGO Lab Supervisor – Dr. WH Lau EE3271 Design Laboratory.

LOGO

Design Flow

System InitializationLCD InitializationI2C InitializationSTA015 InitializationSPI InitializationSTA015 Data Request Signal (Polling)Play song

Page 17: LOGO Lab Supervisor – Dr. WH Lau EE3271 Design Laboratory.

LOGO

System Initialization

Set all the port 0 to GPIO portsSet the PLL Clock frequency to 60MHz

Code: System_Init() in LCD.c

Page 18: LOGO Lab Supervisor – Dr. WH Lau EE3271 Design Laboratory.

LOGO

LCD Initialization

Set the LCD data pinsBy sending command to set the preferences of

the LCD displayCode: LCD_Init() in LCD.c Related functions: --SendCommand(char cmd); --sendchar(char a);--LCD_output(char *str);

Page 19: LOGO Lab Supervisor – Dr. WH Lau EE3271 Design Laboratory.

LOGO

I2C Initialization

Code: I2C_Init() in I2C_Test.c Related functions:

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

Page 20: LOGO Lab Supervisor – Dr. WH Lau EE3271 Design Laboratory.

LOGO

STA015 Initialization

Page 21: LOGO Lab Supervisor – Dr. WH Lau EE3271 Design Laboratory.

LOGO

STA015 Initialization

Code: sta015_init() in sta015.c

Page 22: LOGO Lab Supervisor – Dr. WH Lau EE3271 Design Laboratory.

LOGO

SPI Initialization

Modify the Clock of SPIUpdate the spi_set() function

Code: SPI_Init() in SPI_Test.c

Related functions: spi_set()

Page 23: LOGO Lab Supervisor – Dr. WH Lau EE3271 Design Laboratory.

LOGO

STA015 Data Request Signal (Polling)

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

if ((IOPIN0 & P30) == P30) { spi_set(*song1);

song1++; }

……. …….}

Page 24: LOGO Lab Supervisor – Dr. WH Lau EE3271 Design Laboratory.

LOGO

Play song

Download a mp3 file to a particular address through EmbestIDE softwares

Run all the initialialzation functionsSignal spi to send data

Code: Main() in mp3.c

Page 25: LOGO Lab Supervisor – Dr. WH Lau EE3271 Design Laboratory.

LOGO

Page 26: LOGO Lab Supervisor – Dr. WH Lau EE3271 Design Laboratory.

LOGO

Testing

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

Using the Oscilloscope

-- Checking I2C Clock, I2C Data

-- Checking SPI Clock, SPI Data

-- Checking 1KHz tone frequency

Page 27: LOGO Lab Supervisor – Dr. WH Lau EE3271 Design Laboratory.

LOGO

Difficulties Encountered

Unclear concept of STA015Using wrong Oversampling Ratio Missing Hardware ResetMissing Data Request

Page 28: LOGO Lab Supervisor – Dr. WH Lau EE3271 Design Laboratory.

LOGO

Conclusion

What we had learnt

-- Project Management

-- STA015 configuration

-- Debugging with Oscilloscope

-- Practically understand I2C and SPI data

transfer bus

Page 29: LOGO Lab Supervisor – Dr. WH Lau EE3271 Design Laboratory.

LOGO