Vous êtes sur la page 1sur 12

C

LPC2148 keil Vision3 RealView


JX-2148

C LPC2148 keil Vision3 RealView JX-2148 l 1

INNOVATIVE EXPERIMENT

1.


keil Vision 3

C RealView
(1.1) Project Manage Components, Enviroment Books...

(1.2) Component, Environment and Books Floders/


Extensions Use RealView Compiler

2 l C LPC2148 keil Vision3 RealView JX-2148

2 default
( )

C Keil Vision 3


(Compile)
.hex led led.hex

JX-2148 LPC2148

2. C keil Vision 3
(2.1) keil Vision 3


Project Close Project

C LPC2148 keil Vision3 RealView JX-2148 l 3

(2.2) Project New Project...

(2.3) Create New Project



C:\ led (
) ( led )

4 l C LPC2148 keil Vision3 RealView JX-2148

(2.4) led File name: led Save

(2.5) Select Device for Target

C LPC2148 keil Vision3 RealView JX-2148 l 5

(2.6)
Data base Phillips NXP
LPC2148 JX-2148
Description LPC2148
OK

(2.7)
Startup LPC2148

Yes Startup

6 l C LPC2148 keil Vision3 RealView JX-2148

(2.8) Project Workspace

(2.9) main.c keil_2148_system


www.inex.co.th C:\led

C LPC2148 keil Vision3 RealView JX-2148 l 7

(2.10) + Target1 main.c


Source group 1
Add Files to Groups main.c

(2.11) Add Files to Groups Look in: led


C:\led main.c

8 l C LPC2148 keil Vision3 RealView JX-2148

(2.12) main.c Project Workspace




( template) init PLL (Phase Lock Loop)
LPC2148 main

(2.13)

void main()
{
long i;
init();
// Initialize the system
SCS = 0x03;
// select the fast version of the I/O ports
FIO0DIR |= 0x00400000;
while(1)
{
FIO0PIN ^= 0x00400000;
for (i = 0; i < 1000000; i++ );
}
}

(2.14) Option for Target


C LPC2148 keil Vision3 RealView JX-2148 l 9

(2.14.1) Option for Target Output

(2.14.2)
- Create HEX file led.hex
- HEX format: HEX-386
OK

10 l C LPC2148 keil Vision3 RealView JX-2148

(2.15) Project Build Target F7

Output Window
Output Window

led.hex
C:\led

Project
Open Project *.uv2

3.


led.hex
LPC2148 jx-2148 (Run)

LED P0.22

(3.1) jx-2148 UART0 (


USB USB UCON-232S)

C LPC2148 keil Vision3 RealView JX-2148 l 11

(3.2) JX-2148
(3.3) LPC2000 Flash Utility

(3.4) LPC2000 Flash Utility


l
Device
- Device: LPC2148
- XTAL Freq. [kHz]: 12000 ( 12MHz)
l
Communication
- Connected To Port:
- Use Baud Rate:
(3.5) JX-2148 ISP SWITCH (
) RESET 1
(3.6) LPC2000 Flash Utility Manual Reset 1 Read
Device ID 1 JX-2148
Read Part ID Successfully

12 l C LPC2148 keil Vision3 RealView JX-2148

Read Device ID LPC2000 Flash


Utility Read Device ID

(3.7) Browse Filename Flash Programming


led.hex C:\led\led.hex Upload to Flash
File Upload Successfully Completed
(3.8) JX-2148
ISP SWITCH () RESET 1
(3.9) LED P0.22 JX-2148

INNOVATIVE EXPERIMENT