Sunteți pe pagina 1din 27

USB & Ethernet Working Examples

Ivy Cheong Product Line Microcontrollers Business Line Standard ICs July, 2007

USB Firmware Examples

Koninklijke Philips Electronics

Installing latest Keil software V3.11 and Hardware setup


On your CD, go to D:\LPC2300\software\Installer\Keil Double click on mdk311.exe Follow the instructions to install the software Connect the Keil ULINK to your PC via USB Connect the MCB2300 board to your PC via USB

COMPANY CONFIDENTIAL

Audio Device Class Example (Keil)

Running the Audio Device Class Example


Open up Keil uVision3 Open the Audio example: C:\Keil\ARM\Boards\Keil\MCB2300\USBAudio\Audio.Uv2 Rebuild all target files

Download to Flash

Disconnect and Re-connect MCB2300 USB cable (wait a few seconds in between)

COMPANY CONFIDENTIAL

Running the Audio Device Class Example (cont.)


You can also see the speaker in the Hardware Device Manager (Start | Control Panel | System | Hardware | Device Manager) Double-click to see the properties

COMPANY CONFIDENTIAL

Running the Audio Device Class Example (cont.)


Open and play an MP3 file (there is one on your CD) MCB2300 will act as a USB speaker
Sound from the speaker (DAC output) Potentiometer controls the volume LEDs act as VU meter (VU=Volume Unit)

COMPANY CONFIDENTIAL

Mass Storage Device (MSD) Class Example (Keil)

Running the Mass Storage Device (MSD) Class Example


NOTE: This example only work on MCB2140, linking error due to code size bigger than acceptable in Evaluation version. Open up Keil uVision3 Open the MSD example: C:\Keil\ARM\Boards\Keil\MCB2140\USBMEM\Memory.Uv2 Rebuild all target files

Download to Flash

Disconnect and Re-connect MCB2140 USB cable (wait a few seconds in between)
COMPANY CONFIDENTIAL

Running the Mass Storage Device (MSD) Class Example (cont.)


Go to My Computer MCB2140 will show up as removable disk Double-click the drive to access the content Experiment with the example
Open Readme.txt Create a new directory Store a (small) file

COMPANY CONFIDENTIAL

Running the Mass Storage Device (MSD) Class Example (cont.)


You can also see the drive in the Hardware Device Manager (Start | Control Panel | System | Hardware | Device Manager) Double-click to see the properties

COMPANY CONFIDENTIAL

Running the Mass Storage Device (MSD) Class Example (cont.)


If you disconnect the USB cable, the drive will disappear from the view If you re-connect, the drive will show up again, but all modifications you made will be gone
The example is only using RAM (8KB) for storage, not Flash

COMPANY CONFIDENTIAL

Human Interface Device (HID) Class Example (Keil)

Running the Human Interface Device (HID) Class Example


NOTE: HIDClient does not work on MCB2300, need modification in HIDClient.exe Open up Keil uVision3 Open the HID example: C:\Keil\ARM\Boards\Keil\MCB2140\USBHID\HID.Uv2 Rebuild all target files

Download to Flash

Disconnect and Re-connect MCB2300 USB cable (wait a few seconds in between)
COMPANY CONFIDENTIAL

Running the Human Interface Device (HID) Class Example (cont.)


You can also see the HID in the Hardware Device Manager (Start | Control Panel | System | Hardware | Device Manager | Human Interface Devices ) Double-click to see the properties

COMPANY CONFIDENTIAL

Running the Human Interface Device (HID) Class Example (cont.)


Open HID Client example #1: C:\Keil\ARM\Utilities\HID_Client1\Release\HIDClient.exe Select Keil MCB2140 HID Device:

You can now control the LEDs: (Output) The INT1 Button will be recognized: (Input)

COMPANY CONFIDENTIAL

EasyWeb Example (Keil)

Running the EasyWEB Example


This project is a tiny web server that shows the values of two analog inputs (AD0 and AD1) on a web page. This project allows access from the internet to open the board page, accept instructions and run a small application, as blinking the LEDs or displaying a short message on the LCD.
Open up Keil uVision3 Open the EasyWEB example:

C:\Keil\ARM\Boards\Keil\MCB2300\EasyWEB\easyweb.uV3
Rebuild all target files

Download to Flash

Disconnect and Re-connect MCB2300 USB cable (wait a few seconds in between)
COMPANY CONFIDENTIAL

Running the EasyWEB Example

COMPANY CONFIDENTIAL

Running the EasyWEB Example


Open Command Prompt, and ping to 192.168.0.100

COMPANY CONFIDENTIAL

Running the EasyWEB Example


Under LAN settings, select Automatic detect settings

COMPANY CONFIDENTIAL

Running the EasyWEB Example


Open an Internet Browser and type http://<boards ip address>. This should display the following screen:

COMPANY CONFIDENTIAL

Using FlashMagic

FlashMagic - ISP Blinky Example

Open up Keil uVision3 Open the Blinky example: C:\Keil\ARM\Boards\Keil\MCB2300\Blinky\Blinky.Uv2 Rebuild all target files

Connect RS232 serial cable to COM0, make sure jumper ISP and RST are connected on boards

COMPANY CONFIDENTIAL

FlashMagic - ISP
Goto ISP | Read Device Signature to read device ID

Once communication is established, browse to your hex file and start programming

COMPANY CONFIDENTIAL

FlashMagic - ISP
Launch FlashMagic Select COM Port, Baud Rate and Devices

In Advance Options | Hardware Config, checked on the following

COMPANY CONFIDENTIAL

COMPANY CONFIDENTIAL

S-ar putea să vă placă și