You are on page 1of 53

Proteus ARM7

Proteus ARM7

chentuo@ms.xab.ac.cn
2007 6 27 2008 8 22

Proteus Labcenter electronics EDA Proteus


EDA PCB

Proteus
Proteus VSM
Proteus 8051ARMAVR
PIC proteus

Proteus PC PCB

Proteus Keil uVision Proteus Keil C

SPICE Simulation Program


with Integrated Circuits Emphasis
SPICE 1975
Donald Pederson
Fortran C
EDA Electronic Design Automation
Proteus VSM (Proteus Virtual System Modelling (VSM))
SPICE





ARM

Proteus 7.12 setup71.exe

2007 - 2008

Proteus ARM7

()

Proteus
Proteus

Keil for ARM


Keil for ARM 1UART
Keil for ARM 2A/D
Keil for ARM 3GPIO
Keil Proteus
ARM

2007 - 2008

Proteus ARM7

Proteus
Proteus Proteus Proteus
Proteus

Proteus
Proteus .txt

Proteus
> > Protues 7 Professional > ISIS 7 Professional
Proteus View Sample Designs Yes Proteus

Protues 7 16

Proteus ISIS 7 Professional

Proteus
1

2007 - 2008

Proteus ARM7

Proteus

Proteus .pdf
PROTEUS .pdf
ProteusVSM.pdf
PROTEUS .pdf
Proteus 1 .pdf
Proteus 2 .pdf
VSMSHOW.ppt
Proteus .doc

2007 - 2008

Proteus ARM7

Proteus
Proteus ISIS
ARM Proteus

Proteus
> > Protues 7 Professional > ISIS 7 Professional

100 th (1 th = 0.001 inch)

2007 - 2008

Proteus ARM7

File > New Design

Landscape A4 > OK

(Save Design)counter

2007 - 2008

Proteus ARM7

Library > Pick Devices/Symbol.

PCB

PCB

> Place > Component > LPC2106 >

System > Set Sheet Sizes...


View

2007 - 2008

Proteus ARM7

LPC2106

2007 - 2008

Proteus ARM7
> Rotate

> Place > Terminal > POWER

> Place > Terminal > GROUND

2007 - 2008

Proteus ARM7
Proteus

Edit Terminal Label

2007 - 2008

10

Proteus ARM7
Design > Configure Power Rails

New 3.3V
+3.3V

OK Unconnected power nets 3.3V > Add


3.3V 1.8V

2007 - 2008

11

Proteus ARM7

LPC2106 Edit Component

Edit Component
Program File

counter.hexOK

2007 - 2008

12

Proteus ARM7

KEY2 Proteus

KEY1 KEY2 KEY2 KEY2

2007 - 2008

13

Proteus ARM7

Keil for ARM


Keil for ARM
mdk302a.exe
Help > About V3.02a

Next

Next

2007 - 2008

14

Proteus ARM7

Finish

Keil for ARM


Keil uVision3File > lisence management

2007 - 2008

15

Proteus ARM7

Keil_lic_v3.2.exe

Keil License Management CID ( C8Z7Z-5HL1Y) Keil License


Creator External CID co Generate LICO SN LICO Keil
License Management New License ID Code Add LIC

*** LIC Added Sucessfully *** License ID Code


Close

2007 - 2008

16

Proteus ARM7

Keil for ARM 1UART ( Keil


CARM )
UART1 Hello World
UART (Universal Asynchronous Receiver/Transmitter) UART0
1UART1 2

Proteus ISIS UART1

Keil
Project > Open Project

2007 - 2008

17

Proteus ARM7
- Keil

Keil
Keil uVision3

Keil uVision3
Keil
(1) Project > Components, Environment, Books

Components,

Environment and Books

Environment and Books INC

(2) Use Keil CARM Compiler Use Setting from TOOLS.INI

2007 - 2008

18

Proteus ARM7

(3) mdk302a
Keil
(1) Project > New Project Create New Project
hello

(2) Select Device for Target Target 1

CPU
Data base CPU (Philips LPC2124 )Description

(3) LPC2100

GNU

2007 - 2008

19

Proteus ARM7
(4)
Project Workspace
Startup.s KEIL MDK 3.03 KEIL CARM
mdk302a

(5) Project Workspace Target 1 LPC2100


Source Group 1 Startup Code Project Workspace New
Group
Source Code Source Code Add Files to Group
Source Code Serial.c Hello.c

2007 - 2008

20

Proteus ARM7

Hello UART

6Keil GCC Startup.s

C
/******************************************************************************/
/* uVision/ARM Keil Examples\Hello
/* Copyright KEIL ELEKTRONIK GmbH 2002-2004

*/
*/

/******************************************************************************/
/* HELLO.C: Hello World Example

*/

/******************************************************************************/
#include <stdio.h>

/* I/O */

#include <LPC21xx.H>

/* LPC21xx Keil */

Keil <>
/****************/
/*

*/

/****************/
/* */

int main (void) {


/* */
PINSEL0 = 0x00050000;

/* UART1 (RxD1 TxD1) */

U1LCR = 0x83;

/* 8 , , 1 , DLAB = 1 */

U1DLL = 97;

/* 12MHz 9600 bps */

/* U1DLM = 0x00; */

/* 8 0 */

U1LCR = 0x03;

/* DLAB = 0, */

printf ("Hello World\n");

/* 'printf' */

while (1) {

/* */

; /* ... */
}

/* */
/* */

(1) Project Workspace LPC2100 Options for Target


LPC2100 Xtal 12MHz Use Onchip ROM Use
On-chip RAM

2007 - 2008

21

Proteus ARM7
(2) Device CPU
CPU

CPU
(3) Output Create HEX File hex
Select Folder for Objects

(4) Listing Select Folder for Listings list


Assembler Listing linker Listings

2007 - 2008

22

Proteus ARM7

Build
Project Workspace LPC2100 Build Target (F7)

KEIL MDK 3.03 KEIL CARM

KEIL MDK3.02

Protsus
(1) Proteus ISIS
(2) LPC2124 Edit Component hello.hex
( Keil CARM hello.elf )

(3) Proteus

Hello World

2007 - 2008

23

Proteus ARM7
(4)
Debug ARM7 CPU
FlashRAM

Debug > ARM7


CPU Registers

CPU
Flash

Flash
Text
Text
RAM

RAM

2007 - 2008

24

Proteus ARM7
Pin Configuration

Pin Configuration
(5)

Keil CARM hello.elf GCC


elf Keil for ARM 2A/D ( GCC )

Keil
Keil
Keil Debug > Start/Stop Debug Session
1 View > Serial Window #2
Debug > Run

UART0
main
int main (void) {

/* execution starts here

*/

/* initialize the serial interface */


PINSEL0 = 0x00000005;
/* Enable RxD0 and TxD0
U0LCR = 0x83;
/* 8 bits, no Parity, 1 Stop bit
U0DLL = 97;
/* 9600 Baud Rate @ 15MHz VPB Clock
U0LCR = 0x03;
/* DLAB = 0

*/
*/
*/
*/

printf ("Hello World\n");

/* the 'printf' function call

*/

while (1) {
; /* ... */
}

/*
/*
/*
/*

*/
*/
*/
*/

An embedded program does not stop and


never returns. We've used an endless
loop. You may wish to put in your own
code were we've printed the dots (...).

UART0 Keil

2007 - 2008

25

Proteus ARM7

Keil Debug > Start/Stop Debug Session putchar

0x0000072C R0 UART1 U1LSR 0xE0010014


0x0000073E R1 0xE0010000 UART1 U1RBR(DLAB=0
)UART1 U1THR(DLAB=0) UART1 LSB
U1DLL(DLAB=1) printf putchar UART1
printf UART0 putchar CARM C
printf UART0

GCC
2 GCC 1
printf UART0 UART1
GCC printf UART
UART

2007 - 2008

26

Proteus ARM7

Keil for ARM 2A/D ( GCC


)
A/D LED A/D LED
LED

Proteus ISIS ADC

Keil
Keil uVision3

(1) Project Workspace Manage Components


Components, Environment and Books

GNU

2007 - 2008

27

Proteus ARM7
Environment and Books INC

(2) Use GNU Compiler GNU-Tool-Prefix


arm-uclibc-
C:\Cygnus\ GCC for ARM
GNU-Tool-Prefix arm-uclibc-

(3)
Keil
(1) Project > New Project Create New Project
adc
(2) Select Device for Target Target 1 Data base
CPU (Philips LPC2124 )Description

(3) LPC2100

(4)
Project Workspace
Startup.s
(5) Project Workspace Target 1 LPC2100
Source Group 1 Startup Code Project Workspace New
Group
Source Code Source Code Add Files to Group
Source Code Serial.c adc.c

adc AD

/********************************************************************************/
/* uVision/ARM
*/
/* Copyright KEIL ELEKTRONIK GmbH 2002-2004
*/
/********************************************************************************/
/* ADC.C: LED Flasher & Write A/D Conversion Value to Serial Interface
*/
/********************************************************************************/
#include <LPC21xx.H>
/* LPC21xx */
extern void init_serial (void);
extern int putchar (int ch);
extern int getchar (void);

/* */
/* */
/* */

void puthex (int hex) {


if (hex > 9) putchar('A' + (hex - 10));
else putchar('0' + hex);
}

/* */
/* 9 ASCII */
/* ASCII */

2007 - 2008

28

Proteus ARM7

void putstr (char *p) {


while (*p) {
putchar (*p++);
}
}

/* */

void delay (void) {


unsigned int cnt;
unsigned int val;

/* */

ADCR |= 0x01000000;
do {
val = ADDR;
} while ((val & 0x80000000) ==
ADCR &= ~0x01000000;
val = (val >> 6) & 0x03FF;
/* 1111 1111
/* 0000 0011
putstr ("\nAIN0 Result = 0x");
puthex((val >> 8) & 0x0F);
/* 0000 1111
puthex((val >> 4) & 0x0F);
puthex (val & 0x0F);

/* A/D */
/*
/*
/*
/*
1100 0000 */
1111 1111 */
/*
/*
*/
/*
/*

0);

val = (val >> 2) << 12;


for (cnt = 0; cnt < val; cnt++);

A/D */
A/D */
A/D &=~ 1 (NOT) */
AIN0 >> & (AND) */
/* AIN0 0 */
A/D */
Write 1. Hex Digit */
Write 2. Hex Digit */
Write 3. Hex Digit */

/* */
/* Delay */

}
int main (void) {
unsigned int n;
IODIR1 = 0x00FF0000;
/* P1.16..23 I/O */
/* 0000 0000 1111 1111 0000 0000 0000 0000
ADCR = 0x002E0401;
/* A/D: 10-bit AIN0 @ 3MHz */
init_serial();
/* */
IOSET1=0x00ff0000;
while (1) {
/* */
for (n = 0x00010000; n <= 0x00800000; n <<= 1) { // 00000001 8 10000000
/* 0000 0000 1000 0000 0000 0000 0000 0000 */
/* Blink LED 0, 1, 2, 3, 4, 5, 6, 7 */
// 16 01 8 80
IOCLR1 = n;
/* LED */
delay();
/* */
IOSET1 = 0x00FF0000;
/* LEDs */
}
}
}

/******************************************************************************/
/* uVision/ARM
*/
/* Copyright KEIL ELEKTRONIK GmbH 2002-2004
*/
/******************************************************************************/
/* SERIAL.C: Low Level Serial Routines
*/
/******************************************************************************/
#include <LPC21xx.H>
/* LPC21xx */
#define CR

0x0D

2007 - 2008

29

Proteus ARM7

void init_serial (void) {


PINSEL0 = 0x00050000;
U1LCR = 0x83;
U1DLL = 97;
U1LCR = 0x03;
}
int putchar (int ch) {
if (ch == '\n') {
while (!(U1LSR & 0x20));
U1THR = CR;
}
while (!(U1LSR & 0x20));
return (U1THR = ch);
}
int getchar (void) {

/*
/*
/*
/*
/*

*/
UART1 (Enable RDX1 and TDX1) */
8 , , 1 */
12 MHz VPB 9600 */
DLAB = 0 */

/* */
/* while : 1 ture& 0
/* CR */

/* */

while (!(U1LSR & 0x01));


return (U1RBR);
}

extern
extern void init_serial (void);

/* */

(1) Project Workspace LPC2100 Options for Target


LPC2100 Xtal 12MHz

(2) Device CPU


CPU

2007 - 2008

30

Proteus ARM7

CPU
(3) Output Create HEX File hex
Select Folder for Objects

(4) Listing Select Folder for Listings list


Assembler Listing linker Listings

(5) Linker Linker Script Edit


Flash.ld

2007 - 2008

31

Proteus ARM7

(6) Do not use Standard System Startup Files


(7)

Build
Project Workspace LPC2100 Build Target (F7)

uVision3 3 ARM ()Keil CARMKeil RealView GNU


CAN'T execute 'arm uclibc as' GNU
GUN
(1) Keil CARM Project - Components,
Environment and Books Use Keil CARM Compiler Keil CARM
STARTUP.S GNU STARTUP.S ( \KEIL\ARM\STARTUP\
)
(2) GNU GNU (toolchain)
www.keil.com/demo Keil ARM

(1) GNU
https://www.keil.com/demo/eval/arm.htm

2007 - 2008

32

Proteus ARM7

GNU

(2) GNU
gccarm331.exe

Next

2007 - 2008

33

Proteus ARM7
Yes

Next

Next

Finish

2007 - 2008

34

Proteus ARM7
(3) Build
Project Workspace LPC2100 Build Target (F7)

Proteus
(1) LPC2124 Edit Component adc.elf
(elf bin elf hex
hex )
Proteus

2007 - 2008

35

Proteus ARM7

(2)
Debug ARM7 CPU
FlashRAM CARM

Debug > ARM7


(3)
A/D LED
(4)
ARM7 Source Code
ARM7 Variables CPU

2007 - 2008

36

Proteus ARM7

GCC

(5)

ARM7 Source Code

2007 - 2008

37

Proteus ARM7

Keil for ARM 3GPIO ( GCC


)
P0.0~P0.7 LED LED
LED IO0DIR P0.0~P0.7 IO0SET IO0CLR
1 0 LED

Proteus ISIS GPIO

Keil
Keil uVision3
Keil
(1) Project > Manage > Components, Environment, Books

Components, Environment and Books

GNU

2007 - 2008

38

Proteus ARM7
Environment and Books INC

(2) Use GNU Compiler GNU-Tool-Prefix arm-uclibc()


(3)
Keil
(1) Project > New Project Create New Project
Blinky
(2) Select Device for Target Target 1 Data base
CPU (Philips LPC2124 )Description

(3) LPC2100
Startup.s
(4)
Project Workspace
Startup.s
(5) Project Workspace Target 1 LPC2100
Source Group 1 Startup Code LPC2100 New Group
Source Code Source Code Add Files to Group Source Code
Time.c Blinky.c
Timer.h

blink GPIO

/********************************************************************************/
/* uVision/ARM
*/
/* Copyright KEIL ELEKTRONIK GmbH 2002-2004
*/
/******************************************************************************/
/* BLINKY.C: LED Flasher
*/
/******************************************************************************/
#include <LPC21xx.H>
/* LPC21xx */
#include "Timer.h"
extern long volatile timeval; // extern timeval TIME.C
/*******************************************************************************
**: wait()
**:
********************************************************************************/
void wait (void) {
/* */
unsigned long i;
i = timeval;
while ((i + 10) != timeval);

/* 100ms */
}
/*******************************************************************************
**: main()
**:
********************************************************************************/
int main (void) {

2007 - 2008

39

Proteus ARM7
unsigned int j;
/* LED */
IO0DIR = 0x0000FF;
/*P0.0..P0.7 */
init_timer();
IO0SET=0x0000FF;
while (1) {
/* */
for (j = 0x000001; j < 0x000080; j <<= 1) { /* LED 0,1,2,3,4,5,6 */
IO0CLR = j;
/* LED */ // 01 8 80
wait ();
/* */
IO0SET = j;
/* LED */
}
for (j = 0x000080; j > 0x000001; j >>=1 ) { /* LED 7,6,5,4,3,2,1 */
IO0CLR = j;
/* LED */
wait ();
/* */
IO0SET = j;
/* LED */
}
}
}

/******************************************************************************/
/* uVision/ARM
*/
/* Copyright KEIL ELEKTRONIK GmbH 2002-2004
*/
/******************************************************************************/
/* TIME.C: Time Functions for 100Hz Clock Tick
*/
/******************************************************************************/
#include <LPC21XX.H>
// LPC21XX
#include "Timer.h"
long timeval;
void tc0 (void) __attribute__ ((interrupt));
//
/* /(Timer Counter) 0 */
void init_timer (void) {
// 0
T0MR0 = 149999;
// 10ms (10mSec = 150.000-1 counts)
T0MCR = 3;
// MR0 () T/C
T0TCR = 1;
// 0
VICVectAddr0 = (unsigned long)tc0;
//
VICVectCntl0 = 0x20 | 0x04;
// 0
VICIntEnable = 0x00000010;
// 0
}
/* /(Timer Counter - TC) 0 10ms ( CPU 60MHz) */
void tc0 (void) {
timeval++;
T0IR = 0x01;
//
VICVectAddr = 0x00;
//
}

(1) Project Workspace LPC2100 Options for Target


LPC2100 Xtal 12MHz
(2) Device CPU
CPU
(3) Output Create HEX File hex
Select Folder for Objects
(4) Listing Select Folder for Listings list
Assembler Listing linker Listings
(5) Linker Linker Script Flash.ld Edit

2007 - 2008

40

Proteus ARM7
Flash.ld
Do not use Standard System Startup Files
(6)

Build
Project Workspace LPC2100 Build Target (F7)

Protues
(1) U1LPC2124 Edit Component Program File
Blinky.elf

(2)

LED

2007 - 2008

41

Proteus ARM7

(3)
Debug CPU
FlashRAM

Debug

ARM7 Source Code

(4)
ARM7 Source Code
ARM7 Variables 3.
ARM7 CUP Reisters - U1 CPU

2007 - 2008

42

Proteus ARM7
CPU
(5)

(6) U1LPC2124 Edit Component Program File


Blinky.hex

(7)

Debug
CPU FlashRAM

Debug
elf elf hex
(8)

dll dll
Proteus MODELS
lib Proteus LIBRARY
Proteus

http://www.callbus.ru/models.html I2C Spy DS1621


I2C Spy DS1621 DS1621
I2CSPY.dllDS1621.dll test_i2c.DSN I2CSPY.dll DS1621.dll
Proteus MODELS test_i2c.DSN

2007 - 2008

43

Proteus ARM7

Keil Proteus
Proteus VSM (Virtual System Modelling) AGDI Proteus VSM Keil
Keil IDE Proteus
Keil IDE

Proteus VSM AGDI


(1) vdmagdi.exe

(2) Next
Keil AGDI dll keil
IDEAGDI Drivers for uVision2 8051 AGDI Drivers
for uVision3 8051 ARM

2007 - 2008

44

Proteus ARM7
(3) Next

(4) Next

(5) Next

(6) Finish

2007 - 2008

45

Proteus ARM7
Kiel Proteus
(1) Proteus ISIS Blinky

(2) ISIS Debug > Use Remote Debug Monitor

Use Remote Debug Monitor


(3) Keil Keil IDE Blinky.uv2 (Project Workspace)
LPC2100 Options for Target LPC2100 Options for Target
LPC2100 Debug Use
Proteus VSM Simulator

2007 - 2008

46

Proteus ARM7
Proteus VSM Simulator Proteus VSM AGDI

roteus VSM Simulator

(4)
(5) ISIS LPC2124 Edit Component Program File
Blinky.elf OK

2007 - 2008

47

Proteus ARM7
(6) Keil Debug > Start/Stop Debug Seccsion LPC2124
Proteus ARM7 Source Code

2007 - 2008

48

Proteus ARM7
(7) Keil Debug > Run F5

(8) Debug > Stop Running


(9) Debug > Start/Stop Debug Seccsion Debug > Step
F11 Proteus ARM7 Source
Code ARM7 Variables
(10) Proteus Debug > 3.ARM7 CPU Registers U1 CPU
BXEQ R1 Keil

CPU

2007 - 2008

49

Proteus ARM7

(11) Debug > Start/Stop Debug Session

keil Protues
TCP/IP Proteus VSM AGDI ISIS Keil
Proteus
Option for Target LPC2100 Debug
Setting Proteus IP

IP

2007 - 2008

50

Proteus ARM7

ARM
1) ARM
ARM dsp
FlashSRAM SDRAMCPUJTAG
ARM

2)
SRAM
C bootloader

3) ARM

4) ARM
linux,uc/os-II
5) DEMO
DATSHEET
6)
7) 33

33

8) PCB
()

(microstrip)

2007 - 2008

51

Proteus ARM7

9) 33 ( 33
) (
) ()

()
1ns 1000MHz
500MHz IC

2007 - 2008

52

Proteus ARM7
[]
1. Proteus ARM , , ,
2007.1
2. http://www.embedworld.com/forum_view.asp?forum_id=4&view_id=2002

2007 - 2008

53

You might also like