Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
1 www.ngxtechnologies.com
User Manual: LPC2148-EDU BOARD_V1.1 Section 1............................................................................................................................4 Introduction..........................................................................................................................4 LPC2148-EDU Evaluation Kit........................................................................................4 References and Applicable Documents..........................................................................4 Section 2...............................................................................................................................5 KIT DELIVERABLES........................................................................................................5 Kit Deliverables...............................................................................................................5 Handling Warning...........................................................................................................5 Section 3...............................................................................................................................6 BOARD USE REQUIREMENTS.......................................................................................6 Power up the Board..........................................................................................................6 Section 4...............................................................................................................................7 LPC2148 EDU KIT HARDWARE.....................................................................................7 Board Overview...............................................................................................................7 Features List.....................................................................................................................8 Function Blocks..............................................................................................................8 Processor....................................................................................................................8 Power Supply and Management...............................................................................8 Reset Circuitry..........................................................................................................10 4X4 Keypad...............................................................................................................10 User Buttons...............................................................................................................12 User LEDs................................................................................................................12 I2C Interface with EEPROM, 7-segment display and RTC...................................13 JTAG port..................................................................................................................14 16x2 character LCD and 128x64 graphic LCD.........................................................15 ADC and Temperature Sensor.................................................................................16 Buzzer and Relay Circuitry.......................................................................................17 Stepper Motor..........................................................................................................19 UART.......................................................................................................................19 USB..........................................................................................................................20 I/O Pin Expansion....................................................................................................21 Configuration.................................................................................................................21 Jumpers..........................................................................................................................21 Section 5.............................................................................................................................22 Programming the Kit..........................................................................................................22 Section 6.............................................................................................................................24 Creating Project in KEIL and Generating HEX file..........................................................24 Section 7.............................................................................................................................31 LIST OF EXPERIMENTS................................................................................................31 Write assembly language programs for.........................................................................31 a) Addition b) Subtraction c) Multiplication d) Division...............................31 Write the programs in embedded C for the following experiments...............................32 8-bit LED and switch interface..................................................................................32 2 www.ngxtechnologies.com
User Manual: LPC2148-EDU BOARD_V1.1 Buzzer, relay and stepper motor interface.................................................................33 Time delay program using built in timer/counter feature..........................................34 External interrupt.......................................................................................................35 Displaying a number in seven segment.....................................................................36 4X4 matrix keyboard.................................................................................................37 Multi-digit seven segment display.............................................................................38 Displaying a message in a 2 line x 16 characters LCD display.................................39 ADC and temperature sensor LM35 interface...........................................................40 I2C interface - 7 segment display..............................................................................41 I2C interface serial EEPROM.................................................................................42 Transmission from Kit and reception from PC using serial port...............................43 Generation of PWM signal........................................................................................44 Displaying a message in a 128x64 GLCD display....................................................45 Section 8.............................................................................................................................46 SCHEMATICS..................................................................................................................46 Information........................................................................................................................51 Revision History.......................................................................................................51 Legal.........................................................................................................................51 Disclaimers ..............................................................................................................51 Trademarks ..............................................................................................................51
3 www.ngxtechnologies.com
Section 1 Introduction
LPC2148-EDU Evaluation Kit
The LPC2148-EDU Evaluation Kit allows the evaluation of the LPC214x series devices. It has enough features to demonstrate most of the products capabilities to the users. The LPC2148-EDU also features extension connectors to allow the users to add new interfaces in case they are not on-board.
4 www.ngxtechnologies.com
Handling Warning
The board must not be subjected to high electrostatic potentials. Board must always be handled at properly designated work areas. When not being worked on, the board must be enclosed in the box and stored safely. Avoid touching the circuits or components. Stacking of circuit boards and assemblies should be avoided to prevent physical damage
5 www.ngxtechnologies.com
6 www.ngxtechnologies.com
4X4 KEYPAD RELAY ADC INTERFACE TEMPRATU RE SENSOR I2C 7SEGMENT I2C RTC I2C EEPROM USB Type B Connector DIP SWITCHES
L E D S
LPC2148
STEPPER MOTOR
JTAG
7 www.ngxtechnologies.com
Features List
Here is the list of the main board components and interfaces: 4X4 Keypad 128X64 graphic LCD with backlight 16X2 character LCD with backlight 2 UART ports Temperature sensor Buzzer interface User potentiometer connected to ADC interface 8 user LEDs and buttons I2C interface with EEPROM, RTC and seven segment display USB interface Relay circuit Stepper motor JTAG port
Function Blocks
Processor
The LPC2148-EDU is equipped with a LPC2148 microcontroller in LQFP64 package. The LPC2148 embeds: 1. 512kB of on-chip flash memory 2. 32KB of on-chip SRAM + 8KB RAM for USB
8 www.ngxtechnologies.com
9 www.ngxtechnologies.com
Reset Circuitry
The on-board switch SW19 provide the LPC2148 with external reset Control. The RESET pin of LPC2148 is connected to this switch and whenever the switch is pressed the board gets RESET. It makes the chip behave as for a power-on reset.
4X4 Keypad
LPC2148-EDU has 4x4 keypad that helps you to make your own menu driven applications or even a simple calculator.
10 www.ngxtechnologies.com
11 www.ngxtechnologies.com
User Buttons
A set of 8 user buttons SW1 are provided as another interface in this kit. Closing the jumpers of J7 enables that particular button. These buttons act like switch. Turning ON the buttons will turn on the respective LEDs.
User LEDs
8 user LEDs are provided through 8 GPIOs from the chip. Each LED can be controlled individually. The LEDs are enabled by closing the jumpers of J9.
12 www.ngxtechnologies.com
13 www.ngxtechnologies.com
JTAG port
The JTAG port J13 is provided for programming and debugging the board, which can be used to connect any JTAG based programmer/debugger. Jumper J12 must be closed while using this port. A parallel port JTAG is required to program through JTAG port.
14 www.ngxtechnologies.com
15 www.ngxtechnologies.com
16 www.ngxtechnologies.com
17 www.ngxtechnologies.com
18 www.ngxtechnologies.com
Stepper Motor
LPC2148-EDU has a stepper motor connector J26. Jumpers J25 must be closed to run the stepper motor. The motor runs on 7.5V supply.
UART
LPC2148-EDU has two UART ports UART0 and UART1. These can be used for communication with external RS232 based peripherals. UART0 can also be used for In-System Programming (ISP). Jumpers J16 must be closed for this purpose.
19 www.ngxtechnologies.com
USB
The LPC2148-EDU USB port is compliant with USB 2.0 high-speed device specification. J14 is a B-type receptacle for USB device. The USB can only be used for communication but not to power the board.
20 www.ngxtechnologies.com
Configuration Jumpers
Table 2 Jumpers J10 J11 J12 J16 J15 J23 J5 J22 J20 J18 J19 J21 J25 J6 J7 Related Module Power Supply Power Supply JTAG UART ISP Buzzer ADC ADC 16x2 LCD 16x2 LCD Graphic LCD Graphic LCD Stepper Motor LEDs User buttons Usage(Close these jumpers) 3.3V power to board 5V power to board Programming through JTAG Using UART interface Programming through serial port. To enable buzzer sound. 3.3V supply to ADC i.e. VREF Enable ADC using POT 1,2-LCD backlight software control. 2,3 LCD backlight connected to 5V(always ON) Power supply to 16x2 LCD Power supply to graphic LCD 2,3 LCD backlight connected to 3.3V(always ON) Enable stepper motor control. Enable LEDs Enable user buttons
21 www.ngxtechnologies.com
22 www.ngxtechnologies.com
Note: You will be required to do this setting only once. Thereafter you only need to provide the path for the HEX file on your computer 3. Now, click on Browse for the HEX file to be downloaded, the sample hex files can be found in the CD at LPC2148_EDU\Hexfiles\Experiments 4. Now make the Kit enter the ISP programming Mode. To get the kit in programming mode you need to follow the simple steps mentioned below i) TURN OFF the kit using the Power Switch ii) Press the ISP button and hold it iii) Now TURN ON kit 5. Now click on Start to program the board and wait for the programming to be complete. You will see a message saying Finished on the FlashMagic Window. 23 www.ngxtechnologies.com
24 www.ngxtechnologies.com
2. Select the CPU target as LPC2148 under the option of NXP in the list
25 www.ngxtechnologies.com
5. Copy the main.c file under the folder where we have the project file saved
26 www.ngxtechnologies.com
User Manual: LPC2148-EDU BOARD_V1.1 6. Include the main.c file into the project as shown below
27 www.ngxtechnologies.com
7. Perform the following settings: Click on Target1 in the left pain, and then go to Options for target1 as shown below and in the next pop-up window select the Output tab and check the option Create HEX file as shown below. Next go to Linker tab and check the Use Memory Layout from Target Diaglog and click OK
28 www.ngxtechnologies.com
29 www.ngxtechnologies.com
8. To compile the project click on the icon on top of the left pane, as highlighted below. If the project is successfully compiled a HEX file would be generated in the same path where we have stored the project file. Flash the HEX file using Flash Magic tool as explained earlier
30 www.ngxtechnologies.com
Description: Program to perform Arithmetic operations using assembly Language instructions. Code Path: LPC2148_EDU\Source Code\Experiments\Exp1 InlineAsm Open the project and build it as explained in Section 6 and find the hex file in the path LPC2148_EDU\Source Code\Experiments\Exp1 InlineAsm\obj\ Inline.hex Program the board using the hex file through serial port using Flash Magic as explained in Section 5. The output can be observed on HyperTerminal through UART0 interface. Algorithm: Step1: Initialize the variables. Step2: init serial port. Step3: Add 'operand1' and 'operand2' and store the result in 'Add'. Step4: Subtract 'operand1' and 'operand2' and store the result in 'Sub'. Step5: Multiply 'operand1' and 'operand2' and store the result in 'Mul'. Step6: Divide operand1 by 'operand2' and store the result in 'Div'. Step7: display the result on the HyperTerminal through serial port.
31 www.ngxtechnologies.com
32 www.ngxtechnologies.com
33 www.ngxtechnologies.com
34 www.ngxtechnologies.com
External interrupt
Description: Program to show the external interrupt. Code Path: LPC2148_EDU\Source Code\Experiments\Exp5 ExtInt Open the project and build it as explained in Section 6 and find the hex file in the path LPC2148_EDU\Source Code\Experiments\Exp5 ExtInt\obj\ ExtInt.hex Program the board using the hex file through serial port using Flash Magic as explained in Section 5. This can be tested by pressing the any key in matrix keypad. Algorithm: Step1: Initialize the variables. Step2: Configure the keypad in interrupt mode. Step3: Turn on the buzzer for some time (half second) in keypad Interrupt Service Routine (ISR).
35 www.ngxtechnologies.com
36 www.ngxtechnologies.com
Note: Please ensure that all Switches in SW17 are in ON position for the 4x4MatrixKeypad to work reliably.
37 www.ngxtechnologies.com
38 www.ngxtechnologies.com
39 www.ngxtechnologies.com
40 www.ngxtechnologies.com
41 www.ngxtechnologies.com
42 www.ngxtechnologies.com
43 www.ngxtechnologies.com
44 www.ngxtechnologies.com
45 www.ngxtechnologies.com
Section 8 SCHEMATICS
Below is the schematic of the LPC2148-EDU board:
46 www.ngxtechnologies.com
47 www.ngxtechnologies.com
48 www.ngxtechnologies.com
49 www.ngxtechnologies.com
50 www.ngxtechnologies.com
Legal NGX Technologies Pvt. Ltd. provides the enclosed product(s) under the following conditions:
This evaluation board/kit is intended for use for ENGINEERING DEVELOPMENT, DEMONSTRATION, EDUCATION OR EVALUATION PURPOSES ONLY and is not considered by NGX Technologies Pvt. Ltd to be a finished end-product fit for general consumer use. Persons handling the product(s) must have electronics training and observe good engineering practice standards. As such, the goods being provided are not intended to be complete in terms of required design-, marketing-, and/or manufacturing-related protective considerations, including product safety and environmental measures typically found in end products that incorporate such semiconductor components or circuit boards. This evaluation board/kit does not fall within the scope of the European Union directives regarding electromagnetic compatibility, restricted substances (RoHS), recycling (WEEE), FCC, CE or UL and therefore may not meet the technical requirements of these directives or other related directives.
The user assumes all responsibility and liability for proper and safe handling of the goods. Further, the user indemnifies NGX Technologies from all claims arising from the handling or use of the goods. Due to the open construction of the product, it is the users responsibility to take any and all appropriate precautions with regard to electrostatic discharge. EXCEPT TO THE EXTENT OF THE INDEMNITY SET FORTH ABOVE, NEITHER PARTY SHALL BE LIABLE TO THE OTHER FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES. NGX Technologies currently deals with a variety of customers for products, and therefore our arrangement with the user is not exclusive. NGX Technologies assumes no liability for applications assistance, customer product design, software performance, or infringement of patents or services described herein. Please read the Users Guide and, specifically, the Warnings and Restrictions notice in the Users Guide prior to handling the product. This notice contains important safety information about temperatures and voltages.
No license is granted under any patent right or other intellectual property right of NGX Technologies covering or relating to any machine, process, or combination in which such NGX Technologies products or services might be or are used. Disclaimers Information in this document is believed to be reliable and accurate. However, NGX Technologies does not give any representations or warranties, expressed or implied, as to the completeness or accuracy of such information and shall have no liability for the consequences of use of such information. NGX Technologies reserves the right to make changes to information published in this document, at any time and without notice, including without limitation specifications and product descriptions. This document replaces and supercedes all information supplied prior to the publication hereof.
Trademarks All referenced trademarks, product names, brands and service names are the property of their respective owners.
51 www.ngxtechnologies.com