Beruflich Dokumente
Kultur Dokumente
Architecture
Interfaces
Data flow graphs
Flowcharts
Fixed-point numbers
Circles
- Software components Arrows
Rectangles - Data format
- Hardware components - Data bandwidth
EE 445L – Bard, Valvano - Data direction 4
Lab 4 Integral Controller
0x2000.0000 32 KiB
∙∙∙ Static
0x2000.7FFF RAM EE 445L – Bard, Valvano 7
Memory Mapped Processor
Architecture
• The bus contains:
– address (input, output, RAM or ROM),
– data
– control information
• The address specifies:
– which slave module will communicate with the
processor
– one address per memory access cycle
Computer Bus
Processor
Input Input
ports External Physical signals
RAM circuits devices
Output Output
ports signals
ROM
Control
Address
Data
8 4
Port A Port H
Eight Ten
6 UARTs I2Cs 2
Port B Port J
Four Two 8
4 SSIs CANs Port K
4 Port C
JTAG 8
Eight Port L
8 PC3-PC0 Timers
Port D
8
USB 2.0 Port M
Ethernet
6
Port E
6
ADC Port N
5 2 channels Three Analog
Port F 20 inputs Comparators 6
12 bits Port P
Eight PWM
2 outputs 5
Port G Port Q
Advanced High System Advanced High
Performance Bus Bus Performance Bus
EE 445L – Bard, Valvano 12
Interfaces
• Asynchronous Serial Communications
Interface (UART)
– Interaction between PC/TM4C
– Microcontroller network
• ADC systems are available with a 12-bit
precision
R0
R1
R2 Special registers
R3
R4 PSR Program status register
General R5 PRIMASK
purpose R6 FAULTMASK Exception mask registers
registers R7 BASEPRI
R8 CONTROL CONTROL register
R9
R10
R11
R12
Stack pointer R13 (MSP) R13 (PSP)
Link register R14 (LR)
Program counter R15 (PC)
31 30 29 28 27 26 25 24 15 10 8 0
PSR N Z C V Q ICI/IT T Reserved ICI/IT ISR_NUMBER
APSR contains the current state of the condition
flags from previous instruction executions
IPSR contains the exception type number of the
current Interrupt Service Routine (ISR)
EPSR contains the Thumb state bit and the execution
state bits for the If-Then (IT) instruction
Connected
LaunchPad
For more information read Sections 2.1-2.4 in the book
• When:
range of values is known
range of values is small
• How:
1) variable integer, called I.
may be signed or unsigned
may be 8, 16 or 32 bits (precision)
2) fixed constant, called (resolution)
value is fixed, and can not be changed
not stored in memory
specify this fixed content using comments
EE 445L – Bard, Valvano 21
Fixed point numbers
• The value of the fixed-point number:
fixed-point number I•
• Rounding
– I = 1000+(375*N+256)>>9;
• Assembly Optimization
Convert unsigned long Convert(
MOV r1,#375 unsigned long adc){
MUL r0,r1,r0 return 1000+(375*adc+256)/512;
ADD r0,r0,#256 }
LSR r0,r0,#9
ADD r0,r0,#1000
BX lr