2 Gpio - Sar
2 Gpio - Sar
1
ARM Cortex M4-based System
Microcontroller System bus
ARM® CortexTM-M I/O
processor
Input
PPB NVIC High- ports
speed
32-bit I/O
Instructions
Internal
Advanced
peripherals High-perf Output
Bus ports
Instructions
Flash ROM Data
ICode bus DCode bus RAM
Debugging
ARM Cortex-M4 processor
Harvard architecture
Different busses for instructions and data
RISC machine
Pipelining effectively provides single cycle operation for many
instructions .
Thumb-2 configuration employs both 16 and 32 bit instructions
Tiva
TM4C123x
Diagram
3
Input/Output: TM4C123
Cortex M4 Systick
System Bus Interface NVIC
Current
high LM3S +3.3V
2 + a Out R
I I or 1mA
R 1mA TM4C
(mA) 1 - k LM3S LED
or
TM4C LED
voltage low
0 Out
1.5 1.6 1.7
V (volts)
(a) LED curve (b) Positive logic interface (c) Negative logic interface
LED Interfacing
R = (3V – 1.5)/0.001 R = (5.0-2-0.5)/0.01
= 1.5 kOhm = 220 Ohm
high LM3S +5V
Out or R 10mA
R 1mA TM4C 7406
LM3S
or +5V LED
TM4C LED
high 0.5V
Out
c7 c6 c5 c4 c3 c2 c1 c0 value of R1
0 0 0 0 0 0 1 1 0x03 constant
c7 c6 c5 c4 c3 c2 1 1 result of the ORR
Assembly:
LDR R0,=GPIO_PORTD_DATA_R
LDR R1,[R0] ; read port D
AND R1,R1,#0xFE ; clear bit 0
STR R1,[R0] ; update
b7 b6 b5 b4 b3 b2 b1 b0 value of R1
1 1 1 1 1 1 1 0 0xFE constant
b7 b6 b5 b4 b3 b2 b1 0 result of the AND
Assembly:
LDR R0,=GPIO_PORTD_DATA_R
LDR R1,[R0] ; read port D
EOR R1,R1,#0x80 ; toggle bit 7
STR R1,[R0] ; update
b7 b6 b5 b4 b3 b2 b1 b0 value of R1
1 0 0 0 0 0 0 0 0x80 constant
~b7 b6 b5 b4 b3 b2 b1 b0 result of the EOR