PowerPoint-presentatie - PowerPoint PPT Presentation

1 / 27
About This Presentation
Title:

PowerPoint-presentatie

Description:

Title: PowerPoint-presentatie Author: Peter Kramer Last modified by: wvanooijen Created Date: 9/20/2000 9:37:54 AM Document presentation format: On-screen Show – PowerPoint PPT presentation

Number of Views:78
Avg rating:3.0/5.0
Slides: 28
Provided by: PeterK218
Category:

less

Transcript and Presenter's Notes

Title: PowerPoint-presentatie


1
  • Wat gaan we doen?
  • Herhaling
  • ACPS indexed addressing half-word/byte
  • Nieuw
  • - CMP, CMN
  • - format 2nd argument (operand 2)
  • direct aansturen van I/O pinnen (programmed I/O)
  • oefening taa-tuu taa-tuu taa-tuu

2
ACPS ARM Procedure Call Standard R0 R3
function arguments R0 (R1, R2, R3) function
result R4 - R8 local scratch R9
afblijven R10-11 local scratch R13 SP R14
LR R15 PC R0 R3 are not preserved R4-R8,
R10-R11 are preserved (boek p175-180)
3
  • Herhaling

LDR R0, R1 LDR R0, R1 , 4 LDR R0, R1,
4 LDR R0, R1, 4 ! LDRH R0, R1 LDRB
R0, R1
4
(herhaling) LDR R0, R1
R0
R1 000 0004
R2
R3
R4
R5
R6
R7
R8
R9
R10
R11
R12
R13 SP
R14 LR
R15 PC
0000 0000
0000 0001
0000 0002
0000 0003
0000 0004
0000 0005
0000 0006
0000 0007
0000 0008
0000 0009
. .
FFFF FFFB
FFFF FFFC
FFFF FFFD
FFFF FFFE
FFFF FFFF
registers
geheugen
5
(herhaling) LDR R0, R1 , 4
R0
R1 000 0004
R2
R3
R4
R5
R6
R7
R8
R9
R10
R11
R12
R13 SP
R14 LR
R15 PC
0000 0000
0000 0001
0000 0002
0000 0003
0000 0004
0000 0005
0000 0006
0000 0007
0000 0008
0000 0009
. .
FFFF FFFB
FFFF FFFC
FFFF FFFD
FFFF FFFE
FFFF FFFF

0000 0008
registers
geheugen
6
(herhaling) LDRH R0, R1, 4
R0
R1 000 0004
R2
R3
R4
R5
R6
R7
R8
R9
R10
R11
R12
R13 SP
R14 LR
R15 PC
0000 0000
0000 0001
0000 0002
0000 0003
0000 0004
0000 0005
0000 0006
0000 0007
0000 0008
0000 0009
. .
FFFF FFFB
FFFF FFFC
FFFF FFFD
FFFF FFFE
FFFF FFFF

0000 0008
registers
geheugen
7
(herhaling) LDRB R0, R1, 4 !
R0
R1 000 0004
R2
R3
R4
R5
R6
R7
R8
R9
R10
R11
R12
R13 SP
R14 LR
R15 PC
0000 0000
0000 0001
0000 0002
0000 0003
0000 0004
0000 0005
0000 0006
0000 0007
0000 0008
0000 0009
. .
FFFF FFFB
FFFF FFFC
FFFF FFFD
FFFF FFFE
FFFF FFFF

0000 0008
registers
geheugen
8
  • CMP, CMN

CMP R1, R2 CMP R1, 15 CMN R1, R2 CMN R1, 10
  • boek p52 bovenaan 5.7

9
CMP R2, R1
R0
R1
R2
R3
R4
R5
R6
R7
R8
R9
R10
R11
R12
R13 SP
R14 LR
R15 PC
0000 0000
0000 0001
0000 0002
0000 0003
0000 0004
0000 0005
0000 0006
0000 0007
0000 0008
0000 0009
. .
FFFF FFFB
FFFF FFFC
FFFF FFFD
FFFF FFFE
FFFF FFFF
-
flags
registers
geheugen
10
CMN R1, 15
R0
R1
R2
R3
R4
R5
R6
R7
R8
R9
R10
R11
R12
R13 SP
R14 LR
R15 PC
0000 0000
0000 0001
0000 0002
0000 0003
0000 0004
0000 0005
0000 0006
0000 0007
0000 0008
0000 0009
. .
FFFF FFFB
FFFF FFFC
FFFF FFFD
FFFF FFFE
FFFF FFFF
-
-
flags
registers
geheugen
11
  • Operand 2

MOV R0, R1 ADD R0, R1, 2 SUBC R0, R1, R2, LSL
5 ADDS R1, R2, R3, ASR R4
  • boek p52..53 5.7

12
(No Transcript)
13
  • programmed I/O
  • LPC2148 architectuur
  • I/O pin function selection
  • I/O pin direction selection
  • I/O pin manipulation

14
(No Transcript)
15
User Manual P.7
16
User Manual P.8
17
LDR R0,0 LDR R1,SCS STR R0,R1
User Manual P.26
18
User Manual P.75
19
User Manual P.76
20
User Manual P.82
21
User Manual P.82
22
/ General Purpose IO 0 / IO0PIN
0xe0028000 IO0SET
0xe0028004 IO0DIR
0xe0028008 IO0CLR 0xe002800c /
General Purpose IO 1 / IO1PIN
0xe0028010 IO1SET
0xe0028014 IO1DIR
0xe0028018 IO1CLR 0xe002801c /
Pin Connect Block / PINSEL0
0xe002c000 PINSEL1 0xe002c004
File (part of) lpc214x.inc Use include
lpc214x.inc
23
/ General Purpose IO 0 / define IO0PIN
((volatile unsigned int )(0xe0028000)) de
fine IO0SET ((volatile unsigned
int )(0xe0028004)) define IO0DIR
((volatile unsigned int )(0xe0028008)) define
IO0CLR ((volatile unsigned int
)(0xe002800c)) / General Purpose IO 1
/ define IO1PIN ((volatile
unsigned int )(0xe0028010)) define IO1SET
((volatile unsigned int
)(0xe0028014)) define IO1DIR
((volatile unsigned int )(0xe0028018)) define
IO1CLR ((volatile unsigned int
)(0xe002801c)) / Pin Connect Block / define
PINSEL0 ((volatile unsigned int
)(0xe002c000)) define PINSEL1
((volatile unsigned int )(0xe002c004))
File (part of) lpc214x.h
24
(dit is code voor een LPC2106)
25
(dit is code voor een LPC2106)
26
  • Opdracht (1)
  • Schrijf de subroutines (hou je aan de APCS!)
  • LspInit
  • - geen parameters
  • - maakt de LSP pin een GPIO en output
  • - blijft van de andere pinnen af!
  • LspHigh
  • - geen parameters
  • - neemt aan dat LspInit al is aangeroepen
  • - maakt de LSP pin hoog
  • LspLow
  • - geen parameters
  • - neemt aan dat LspInit al is aangeroepen
  • - maakt de LSP pin laag

27
  • Opdracht (2)
  • Schrijf de subroutines (hou je aan de APCS!)
  • LspBeep
  • - R0 duur van 1 periode in µs
  • - R1 aantal perioden
  • - gebruikt LspHigh en LspLow
  • Test deze functies door programma te schrijven
    dat (in een eeuwigdurende lus) het volgende doet
  • Piep gedurende 1 seconde op 440 Hz
  • 0.1 seconde stilte
  • Piep gedurende 1 seconde op 880 Hz
  • 0.5 seconde stilte
  • Ga uit van de blink.zip als startpunt gebruik
    include lpc2148.h
Write a Comment
User Comments (0)
About PowerShow.com