ınsider’s guide philips arm®7 an engineer’s ıntroduction to the lpc2100 series hitex development tools
trevor martin bsc. (hons) ceng. mıee 228 s. pdf
keil programını kulanımıda anlatılmaktadır
1 chapter 1: the arm7 cpu core 10
1.1 outline .................................................. .................................................. ..10
1.2 the pipeline.......................................... .................................................. ..10
1.3 registers .................................................. ................................................11
1.4 current program status register .................................................. ...........12
1.5 exception modes .................................................. ....................................13
1.6 the arm 7 ınstruction set............................................... .........................16
1.6.1 branching .................................................. ...............................................18
1.6.2 data processing ınstructions .................................................. ..................19
1.6.2.1 copying registers .................................................. ..................................20
1.6.2.2 copying multiple registers .................................................. .....................20
1.7 swap ınstruction .................................................. .....................................21
1.8 modifying the status registers......................................... .......................21
1.9 software ınterrupt .................................................. ...................................21
1.10 mac unit .................................................. ................................................23
1.11 thumb ınstruction set .................................................. ...........................24
1.12 summary .................................................. ................................................26
2 chapter 2: software development 28
2.1 outline .................................................. .................................................. ..28
2.1.1 download and ınstall the keil tools............................................. .............28
2.1.2 uvision ıde.............................................. .................................................2 9
2.1.3 hitop ıde.............................................. .................................................. 29
2.1.4 tutorial.......................................... .................................................. ..........30
2.2 startup code .................................................. ..........................................31
2.3 ınterworking arm/thumb code.............................................. ................34
2.4 stdıo libraries......................................... ...............................................36
2.5 accessing peripherals .................................................. ............................36
2.6 ınterrupt service routines .................................................. ......................37
2.6.1 software ınterrupt .................................................. ...................................38
2.6.1.1 locating variables at absolute memory locations ...................................39
2.6.2 locating code in ram............................................... ...............................39
2.7 ınline functions .................................................. ......................................40
2.8 ınline assembler .................................................. .....................................40
2.8.1 ımporting gcc code .................................................. ..............................40
2.9 hardware debugging tools .................................................. ....................40
2.9.1.1 ımportant! .................................................. ...............................................41
2.9.1.2 even more ımportant .................................................. ..............................42
2.10 summary .................................................. ................................................42
3 chapter 3: system peripherals 43
3.1 outline .................................................. .................................................. ..43
3.2 bus structure......................................... .................................................. .43
3.3 memory map............................................... ..............................................44
3.4 register programming....................................... .......................................45
3.5 memory accelerator module............................................ .........................45
3.5.1 example mam configuration .................................................. ..................48
ıntroduction to the lpc2000 ıntroduction
© hitex (uk) ltd. page 5
3.6 flash memory programming....................................... ...........................49
3.6.1 memory map control .................................................. ..............................49
3.6.2 bootloader .................................................. ..............................................50
3.6.3 philips ısp utility .................................................. ....................................50
3.6.4 ın-application programming .................................................. ...................52
3.7 external bus ınterface .................................................. ............................53
3.7.1 external memory ınterface........................................ ................................53
3.7.2 using the external bus ınterface .................................................. ...........56
3.8 booting from rom............................................... ....................................58
3.9 phase locked loop.............................................. ....................................60
3.10 vlsı peripheral bus divider .................................................. ...................62
3.10.1.1 example code: pll and vpb configuration..................................... .......62
3.11 power control .................................................. .........................................63
3.12 lpc2000 ınterrupt system .................................................. .....................65
3.12.1 pin connect block .................................................. ..................................65
3.12.2 external ınterrupt pins .................................................. ............................65
3.12.3 ınterrupt structure......................................... ............................................66
3.12.4 fıq interrupt .................................................. ...........................................67
3.12.5 leaving an fıq ınterrupt .................................................. ........................67
3.12.5.1 example program: fıq ınterrupt........................................ ......................68
3.12.6 vectored ırq.............................................. ..............................................69
3.12.7 leaving an ırq ınterrupt .................................................. ........................70
3.12.7.1 example program: ırq interrupt .................................................. ............71
3.12.8 non-vectored ınterrupts .................................................. .........................71
3.12.9 leaving a non-vectored ırq ınterrupt .................................................. ...72
3.12.9.1 example program: non-vectored ınterrupt........................................ .......72
3.12.10 nested ınterrupts .................................................. ....................................73
3.13 summary .................................................. ................................................74
4 chapter 4: user peripherals 76
4.1 outline .................................................. .................................................. ..76
4.2 general purpose ı/o................................................. ................................76
4.3 general purpose timers............................................ ...............................78
4.4 pwm modulator .................................................. ......................................82
4.5 real time clock .................................................. .....................................85
4.6 watchdog .................................................. ...............................................88
4.7 uart.............................................. .................................................. ........90
4.8 ı2c ınterface .................................................. ...........................................94
4.9 spı ınterface........................................ .................................................. ...99
4.10 analog to digital converter......................................... ...........................101
4.11 digital to analog converter......................................... ...........................104
4.12 can controller .................................................. .....................................105
4.12.1.1 ıso 7 layer model............................................. .....................................105
4.12.2 can node design .................................................. ................................105
4.12.3 can message objects .................................................. .........................107
4.12.4 can bus arbitration....................................... .........................................109
4.12.5 bit timing............................................ .................................................. ..110
4.12.6 can message transmission .................................................. ................112
4.12.7 can error containment....................................... ...................................114
ıntroduction to the lpc2000 ıntroduction
© hitex (uk) ltd. page 6
4.12.8 can message reception .................................................. .....................117
4.12.9 acceptance filtering .................................................. .............................118
4.12.9.1 configuring the acceptance filter .................................................. .......119
4.13 summary .................................................. ..............................................120
5 chapter 5: keil tutorial 124
5.1 ınstallation .................................................. ............................................124
5.1.1 using the keil uvision ıde.............................................. ........................125
5.2 exercise 1: using the keil toolset .................................................. ........126
5.3 using the debugger.......................................... ......................................131
5.4 using the ulınk hardware debugger.......................................... ..........135
5.4.1 setting up the ulınk jtag hardware debugger: .................................135
5.4.2 customising your project and other quick tips ....................................137
1.6 exercise 2: startup code.............................................. ..........................141
5.8 exercise 4: using stdıo libraries .................................................. .......144
5.9 exercise 5: simple ınterrupt........................................ ............................146
5.10 exercise 6: software ınterrupt .................................................. ..............148
5.11 exercise 7: memory accelerator module ................................................14 9
5.12 exercise 8: ın-application programming....................................... ..........151
5.13 exercise 9: external bus ınterface........................................ ..................152
5.14 exercise 10: phase locked loop .................................................. .........156
5.15 exercise 11: fast ınterrupt........................................ ..............................158
5.16 exercise 12: vectored ınterrupt .................................................. ............159
5.17 exercise 13: non-vectored ınterrupt........................................ ...............161
5.18 exercise 14: nested ınterrupts .................................................. ............162
5.19 exercise 15: general purpose ıo pins .................................................. .163
5.20 exercise 16: timer capture .................................................. ..................164
5.21 exercise 17: timer match............................................. ..........................166
5.22 exercise 18: dual-edge (symmetrical) pwm generation.......................169
5.23 exercise 19: real time clock............................................. ....................171
5.24 exercise 20: uart .................................................. ...............................172
5.25 exercise 21: ı2c ınterface .................................................. ....................173
5.26 exercise 22: spı .................................................. ...................................175
5.27 exercise 23: analog to digital converter ...............................................176
5.28 exercise 24: digital to analog converter ...............................................177
5.29 exercise 25: transmitting can data .................................................. ....178
5.30 exercise 26: receiving can data .................................................. ........179
6 chapter 6: keil tutorial with gnu tools 182
6.1 ıntoduction .................................................. ............................................182
6.2 gcc startup code.............................................. ....................................182
6.3 ınterworking arm/thumb code.............................................. ..............182
6.4 accessing peripherals .................................................. ..........................182
6.5 ınterrupt service routines .................................................. ....................182
6.5.1 software ınterrupt .................................................. .................................183
6.6 ınline functions .................................................. ....................................183
6.7 exercise 1: using the keil toolset with the gnu compiler .................184
6.8 exercise 2: startup code.............................................. ..........................189
6.9 exercise 3: using thumb code .................................................. ..........189
ıntroduction to the lpc2000 ıntroduction
© hitex (uk) ltd. page 7
6.10 exercise 4: using the gnu libraries .................................................. ...192
6.11 exercise 5: simple ınterrupt........................................ ............................193
6.12 exercise 6: software ınterrupt .................................................. ..............195
7 chapter 7: hitex tutorial (with keil or gnu compiler) 197
7.1 ınstallation .................................................. ............................................197
7.2 creating the first project .................................................. .....................198
7.3 exercise 1: creating the first project .................................................. ..199
7.4 using hitop............................................. ..............................................201
7.5 exercise 2: startup code.............................................. ..........................204
7.6 exercise 3: using thumb code .................................................. ...........205
7.7 using the tantino hardware debugger .................................................2 07
7.8 setting up the tantino jtag hardware debugger ................................207
8 chapter 8: extended debugging with etm trace 209
8.1 outline .................................................. .................................................. 209
8.2 using the tanto with trace............................................. ......................209
8.3 recording execution trace .................................................. ..................210
8.4 a data trace .................................................. ........................................216
8.5 trace examples.......................................... ............................................218
işte link:
http://rapidshare.com/files/395197503/l...n_nopw.pdf