MP3 player on PC using PIC controller via USB.
Supervisor:Dmitry Sokolik
Performed by:Yoav GershoniShachar Faigenblat
Project Overview
Playing MP3 files that located in the PC
Controlling the song selection using the PIC.
Establish a USB based connection for control.
Enable friendly user interface (LCD, switches).
Block diagram
PIC board
Project Specification Components:
PIC 18F452 evaluation board. DLP 245.
Power supply: 5v for the evaluation board, PIC and
USB bus. Interfaces:
USB bus between the PIC board and the PC
Software Architecture
PCMain function
COM Port functions
USB Driver and Bus
Software Architecture
PICMain function
DLP Driverfunctions
USB Bus
LCD Driverfunctions
LCD Display
Software Development Tools
PIC: MCC18 compiler on MPLAB IDE.
• PC: Code in C, with Visual Studio
compiler.
USB protocol: USB Inspector.
DLP 245 – USB Device
Provides parallel interface to USB bus.
Easy to handle.
No USB protocol knowledge required.
PC Driver are Virtual COM Port.
DLP 245 – PIC connection
PICDLP 245
DLP 245 – PIC connection
LCD
2x16 Characters. LCD controller provide easy
handling. Parallel bus to LCD controller.
LCD PinoutPin NoNameFunctionDescriptionPIC Port
1D7PowerData MSBRD.0
2D6PowerData RD.1
3D5Contrast Adj.DataRD.2
4D4CommandDataRD.3
5D3CommandDataN.C.
6D2CommandDataN.C.
7D1I/ODataN.C.
8D0I/OData LSB כניסות נתוניםN.C.
9EI/OEnable (Strobe) אפשור RA.1
10R/WI/ORead / Write קריאה או כתיבהRA.2
11RSI/ORegister Selectבחירת אוגר RA.3
LCD BUS Waveform
Since the LCD has only 4 bits the E line has to toggle twice for each Data/command transaction.
LCD CommandsInstruction
RSR
WD
7D
6D
5D
4D
3D
2D
1D
0Description
Execution time**
NOP0000000000No Operation0
Clear Display0000000001Clear display & set address counter to zero1.64mS
Cursor Home000000001xSet adress counter to zero, return shifted display to original
position.DD RAM contents remains unchanged.
1.64mS
Entry Mode Set00000001I/
DS
Set cursor move direction (I/D) and specify automatic display shift (S).1.64mS
Display Control0000001DCBTurn display (D), cursor on/off I, and cursor blinking (B) .40uS
Cursor / Display shift
000001S/
CR/
LxxShift display or move cursor (S/C) and specify direction (R/L).40uS
Function Set00001D
LNFxx
Set interface data width (DL), number of display lines (N) and character font (F).
40uS
Set CGRAM Address
0001CGRAM AddressSet CGRAM address. CGRAM data is sent afterwards.40uS
Set DDRAM Address
001DDRAM AddressSet DDRAM address. DDRAM data is sent afterwards.40uS
Busy Flag & Address
01B
FAddress CounterRead busy flag (BF) and address counter40uS
Write Data10DataWrite data into DDRAM or CGRAM40uS
Read Data11DataRead data from DDRAM or CGRAM40uS
LCD Initialization proccess
It appears that the initialization process of the LCD module isn't strait forward as one would think.
Conclusions Every thing works this time!! Datasheets don’t always have all the
information needed to make things work. (LCD)
HW doesn’t always work as you intended it would (Philips).
The Internet provides a useful knowledge base, with the experience of many skilled people.