You are currently viewing How to Interface USB 2.0 with LPC2148 – ARM7 Evaluation board

How to Interface USB 2.0 with LPC2148 – ARM7 Evaluation board

Spread the love

The ARM7 LPC2148 Evaluation Board is specifically designed to help students to master the required skills in the area of embedded systems. The kit is designed in such way that all the possible features of the microcontroller will be easily used by the students. The kit supports in system programming (ISP) which is done through serial port.

NXP’s ARM7 (LPC2148), ARM Evaluation Kit is proposed to smooth the progress of developing and debugging of various designs encompassing of High speed 32-bit Microcontrollers.

USB

Universal serial Bus (USB), a connection technology for attaching peripheral devices to a computer, providing fast data exchange. USB connects more than computers and peripherals. USB gives you a single, standardized, easy-to-use way to connect up to 127 devices to a computer.

Interfacing USB

Fig. 1 shows how to interface the USB to microcontroller. The USB is a 4 wire bus that supports communication between a host and a number (127 max.) of peripherals. In USB data cable Data+ and Data- signals are transmitted on a twisted pair. No termination needed. Half-duplex differential signaling helps to combat the effects of electromagnetic noise on longer lines. Contrary to popular belief, D+ and D- operate together; they are not separate simplex connections.

Interfacing USB 2.0 to Microcontroller
Fig. 1 Interfacing USB 2.0 to Microcontroller

Interfacing USB with LPC2148

The LPC2148 controller enables 12 Mb/s data exchange with a USB host controller. It consists of register interface, serial interface engine, endpoint buffer memory and DMA controller. The input, output signals and a USB Bus are used to connect with controller. The LPC2148 controller read the USB voltage as power supply for controlling peripherals without having an external voltage. The LPC2148 Evaluation Board read the input voltage either from USB or external power supply by using a Jumper connection.

Pin Assignment with LPC2148

Circuit Diagram to Interface USB 2.0 with LPC2148

Source Code

#include
#include "type.h"
#include "usb.h"
#include "usbcfg.h"
#include "usbhw.h"
#include "usbcore.h"
#include "demo.h"
unsigned char
	InReport,			/* HID Input Report */
	OutReport;		/* HID Out Report */
//  Get HID Input Report -> InReport
void GetInReport (void)
{
	// Read PORT1[24..31]
	InReport = (IOPIN1 & 0xFF000000) >> 8;
}
//  Set HID Output Report

The Interfacing USB 2.0 with LPC2148 program is very simple and straight forward, which access PC from LPC2148 Evaluation Board through USB.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.