Chapter 3 - Hardware Design For An Embedded System (Part 1)
Chapter 3 - Hardware Design For An Embedded System (Part 1)
Chapter 3 - Hardware Design For An Embedded System (Part 1)
om
Chapter 3: Hardware design for an embedded
system
.c
1. Hardware components
ng
2. Design block diagrams
3. Micro controller
4. Board bus
co
1
1
an
th
ng
1. Hardware components
o
1. Microprocessors/Microcontrollers
du
2. Peripherals
cu
CuuDuongThanCong.com https://fb.com/tailieudientucntt 1
9/19/2019
1. Hardware components
• Microprocessors/Microcontrollers
– Is a center processing unit
– Control input devices, sensors, actuators, display devices
– Process tasks, functions, and algorithms
– Interface other systems
om
microprocessor
.c
ng
co
Example of an embedded system
Bộ môn Kỹ Thuật Điện Tử Chapter 4 3
3
an
th
ng
1. Hardware components
o
• Microprocessors/Microcontrollers
du
by Microchip Technology
– ARM is a family of instruction set architectures for computer processors
developed by British company ARM Holdings, based on a reduced
instruction set computing (RISC) architecture.
CuuDuongThanCong.com https://fb.com/tailieudientucntt 2
9/19/2019
1. Hardware components
• Peripherals
– Input devices: button, switch, keyboard, mouse, touch-screen
– Display devices: LED, text LCD, graphic LCD
– Sensors: temperature, humidity, light, motion
– Actuators: motor, solenoid, relay, FET, triac, SCR
– Interfaces: UART, USB, I2C, SPI, Ethernet, Wifi, Bluetooth, Zigbee
om
Input device: keypad
.c
Interface: UART
ng Actuator: relay
co
Bộ môn Kỹ Thuật Điện Tử Chapter 4 5
5
an
th
ng
• Block diagram
du
CuuDuongThanCong.com https://fb.com/tailieudientucntt 3
9/19/2019
om
One way One way
.c
Single connection Multiple connections
ng
co Curve connection
7
an
th
ng
CuuDuongThanCong.com https://fb.com/tailieudientucntt 4
9/19/2019
om
• One direction / two directions/ multiple directions
• Single / multiple connections
.c
• Data type of connections
– Special block
ng
• Block name co
• Extra information
Bộ môn Kỹ Thuật Điện Tử Chapter 4 9
9
an
th
ng
• Recommendations
du
10
CuuDuongThanCong.com https://fb.com/tailieudientucntt 5
9/19/2019
om
.c
ng
co
Bộ môn Kỹ Thuật Điện Tử 11
11
an
th
ng
12
CuuDuongThanCong.com https://fb.com/tailieudientucntt 6
9/19/2019
om
.c
ng
co
Bộ môn Kỹ Thuật Điện Tử 13
13
an
th
o ng
du
u
cu
14
CuuDuongThanCong.com https://fb.com/tailieudientucntt 7
9/19/2019
om
.c
ng
co
Bộ môn Kỹ Thuật Điện Tử 15
15
an
th
ng
DE2 board
o
du
u
cu
16
CuuDuongThanCong.com https://fb.com/tailieudientucntt 8
9/19/2019
om
.c
ng
co
Bộ môn Kỹ Thuật Điện Tử 17
17
an
th
o ng
du
u
cu
18
CuuDuongThanCong.com https://fb.com/tailieudientucntt 9
9/19/2019
Heater
om
– Wrong direction of connection
– Problem of single / multiple connections
.c
– No data type of connections
ng
co
Bộ môn Kỹ Thuật Điện Tử Chapter 4 19
19
an
th
ng
20
CuuDuongThanCong.com https://fb.com/tailieudientucntt 10
9/19/2019
PIC
Microcontroller
om
SIM900
.c
ng
=> Make this block diagram better!
co
Bộ môn Kỹ Thuật Điện Tử Chapter 4 21
21
an
th
ng
Team work
o
project
u
cu
22
CuuDuongThanCong.com https://fb.com/tailieudientucntt 11
9/19/2019
om
.c
ng
co
Bộ môn Kỹ Thuật Điện Tử 23
23
an
th
ng
24
CuuDuongThanCong.com https://fb.com/tailieudientucntt 12
9/19/2019
om
– how long and how often each task will need to
.c
run?
– What interrupts will we need?
ng
– How many timer will we need?
co
Bộ môn Kỹ Thuật Điện Tử 25
25
an
th
ng
26
CuuDuongThanCong.com https://fb.com/tailieudientucntt 13
9/19/2019
om
.c
ng
co
Bộ môn Kỹ Thuật Điện Tử 27
27
an
th
ng
website.
– Chip manufacturer website (microchip, ST,TI,
Atmel, etc)
– https://en.wikipedia.org/wiki/List_of_common_m
icrocontrollers
28
CuuDuongThanCong.com https://fb.com/tailieudientucntt 14
9/19/2019
om
.c
ng
co
Bộ môn Kỹ Thuật Điện Tử 29
29
an
th
ng
30
CuuDuongThanCong.com https://fb.com/tailieudientucntt 15
9/19/2019
om
– Can we have C compiler, IDE and programming
tools?
.c
– Does this micro controller has good support
(community, libraries, resource)
ng
co
Bộ môn Kỹ Thuật Điện Tử 31
31
an
th
ng
Memory
o
du
Once, with a
PROM No device n/a n/a Moderate Fast
programmer
32
CuuDuongThanCong.com https://fb.com/tailieudientucntt 16
9/19/2019
Memory
Writeable Max Erase Cost (per
Type Volatile? Erase Size Speed
? Cycles Byte)
Fast to
Limited read, slow
EEPROM No Yes Byte (consult Expensive to
datasheet) erase/writ
om
e
Fast to
Limited read, slow
.c
Flash No Yes Sector (consult Moderate to
datasheet) erase/writ
e
ng
Expensive
NVRAM No Yes Byte co Unlimited (SRAM + Fast
battery)
Bộ môn Kỹ Thuật Điện Tử 33
33
an
th
ng
rd'/wr D<0...7
P0 D Q
Processor Memory >
A<0...15
enable /CS >
/OE
ALE G /WE
addr[0-11] CS2 /CS
u
8 1
data[0-7] P2
74373
cu
/WR /CS
/RD HM6264
D<0...7>
/PSEN
A<0...14>
bus
/OE
bus structure
27C256
8051
P0 Adr. 7..0 Data
P2 Adr. 15…8
Q Adr. 7…0
ALE
/RD
34
CuuDuongThanCong.com https://fb.com/tailieudientucntt 17
9/19/2019
VCC
om
nRD 3 6
Dung de ZIF 2 5
XTAL_OUT
74HC00 74HC00
VCC
R104
10k
JD02
.c
nPSEN 1 2
PROG_MEM_OVERLAP
nCS.[0..7]
U104
ng
A.13 1 15 nCS.0
A.14 2 A Y0 14 nCS.1
A.15 3 B Y1 13 nCS.2
VCC C Y2 12 nCS.3
6 Y3 11 nCS.4
4 G1 Y4 10 nCS.5
5 G2A Y5 9 nCS.6
G2B Y6 7 nCS.7
Y7
74LS138
co
Bộ môn Kỹ Thuật Điện Tử 35
35
an
th
ng
Memory bus
o
du
U12K
U11
DDR_D0 E22 A11 DDR_A0 U16 DDR3-512MB
DDR_D1 D21 DDR_D0 DDR_A0 C12 DDR_A1 DDR3-512MB
DDR_D2 C22 DDR_D1 DDR_A1 B12 DDR_A2 DDR_D8 E3 N3 DDR_A0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DDR_D19 C2 DQ10 A10/AP R7 DDR_A11 DDR_D28 A7 DQ11 A11 N7 DDR_A12
DDR_D15 C8 DDR_D14 DDR_A14 A16 DDR_A15 DDR_D20 A7 DQ11 A11 N7 DDR_A12 DDR_D29 A2 DQ12 A12/BC# T3 DDR_A13
DDR_D16 C18 DDR_D15 DDR_A15 DDR_D21 A2 DQ12 A12/BC# T3 DDR_A13 DDR_D30 B8 DQ13 A13 T7 DDR_A14
DDR_D17 B17 DDR_D16 B13 DDR_CLK DDR_D22 B8 DQ13 A13 T7 DDR_A14 DDR_D31 A3 DQ14 A14
DDR_D18 A17 DDR_D17 DDR_CLK A13 DDR_CLKN DDR_D23 A3 DQ14 A14 DQ15 M2 DDR_BA0
DDR_D19 A20 DDR_D18 DDR_CLKn DQ15 M2 DDR_BA0 DDR_CKE0 K9 BA0 N8 DDR_BA1
DDR_D20 C19 DDR_D19 D11 DDR_BA0 DDR_CKE0 K9 BA0 N8 DDR_BA1 DDR_CS0N L2 CKE BA1 M3 DDR_BA2
DDR_D21 B18 DDR_D20 DDR_BA0 C11 DDR_BA1 DDR_CS0N L2 CKE BA1 M3 DDR_BA2 DDR_ODT0 K1 CS# BA2
DDR_D22 B20 DDR_D21 DDR_BA1 B11 DDR_BA2 DDR_ODT0 K1 CS# BA2 ODT J7 DDR_CLK
DDR_D23 B21 DDR_D22 DDR_BA2 ODT J7 DDR_CLK DDR_RASN J3 CK K7 DDR_CLKN
DDR_D24 B2 DDR_D23 D17 DDR_ODT0 DDR_RASN J3 CK K7 DDR_CLKN DDR_CASN K3 RAS# CK#
DDR_D25 B3 DDR_D24 DDR_ODT0 C17 DDR_ODT1 DDR_CASN K3 RAS# CK# DDR_WEN L3 CAS# E7 DDR_DM1
DDR_D26 C3 DDR_D25 DDR_ODT1 DDR_WEN L3 CAS# E7 DDR_DM0 WE# LDM D3 DDR_DM3
C4 DDR_D26 A8 WE# LDM D3 VCCDR B2 UDM
DDR_D27 DDR_CS0N DDR_DM2
D5 DDR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R_DM1 MVDD2 F10 F1 VDDQ6 VSSQ8 G9 H2 VDDQ7 VSSQ9
DDR_DM3 A2 DDR_DM2 MVDD3 F11 H2 VDDQ7 VSSQ9 H9 VDDQ8 A9
DDR_DM3 MVDD4 F13 H9 VDDQ8 A9 VREF_DDR VDDQ9 VSS1 B3
G15
R146240R%1 R0402 MVDD5 F14 VREF_DDR VDDQ9 VSS1 B3 H1 VSS2 E1
E10 DDR_PZQ MVDD6 F16 H1 VSS2 E1 M8 VREFDQ VSS3 G8
VCCDR E16 DDR_RETEN MVDD7 F17 M8 VREFDQ VSS3 G8 VREFCA VSS4 J2
E17 DDR_ATO MVDD8 G11 VREFCA VSS4 J2 DDR_RST T2 VSS5 J8
E18 DDR_DTO1 MVDDAO DDR_RST T2 VSS5 J8 L8 RESET# VSS6 M1
DDR_DTO0 L8 RESET# VSS6 M1 ZQ VSS7 M9
RK3188 ZQ VSS7 M9 R58 J1 VSS8 P1
BGA453-19X19 R84 J1 VSS8 P1 240R%1 J9 NC1 VSS9 P9
240R%1 J9 NC1 VSS9 P9 L1 NC2 VSS10 T1
L1 NC2 VSS10 T1 L9 NC3 VSS11 T9
L9 NC3 VSS11 T9 DDR_A15 M7 NC4 VSS12
DDR3 RK3188_K DDR_A15 M7 NC4
NC5
VSS12 NC5
36
CuuDuongThanCong.com https://fb.com/tailieudientucntt 18
9/19/2019
om
.c
ng
co
Bộ môn Kỹ Thuật Điện Tử 37
37
an
th
ng
A strobe/handshake compromise
o
du
u
cu
38
CuuDuongThanCong.com https://fb.com/tailieudientucntt 19
9/19/2019
Parallel communication
om
• long parallel wires result in high capacitance values which requires more
time to charge/discharge
• Data misalignment between wires increases as length increases
.c
• Higher cost, bulky
ng
Question:
List some parallel communications and peripherals you know?
co
Bộ môn Kỹ Thuật Điện Tử 39
39
an
th
ng
Serial communication
o
du
40
CuuDuongThanCong.com https://fb.com/tailieudientucntt 20
9/19/2019
UART connection
Standard baudrate:
1200, 2400, 4800, 9600, 19200, 38400, 57600 and 115200
om
.c
Find and list all the modules and sensor you know that
use UART interface?
ng
co
Bộ môn Kỹ Thuật Điện Tử 41
41
an
th
ng
I2C bus
o
du
• I2C (Inter-IC)
– Two-wire serial bus protocol developed by Philips Semiconductors
u
42
CuuDuongThanCong.com https://fb.com/tailieudientucntt 21
9/19/2019
om
.c
ng
co
Bộ môn Kỹ Thuật Điện Tử 43
43
an
th
o ng
du
u
cu
44
CuuDuongThanCong.com https://fb.com/tailieudientucntt 22
9/19/2019
From From
om
Servant receiver
D
C
.c
S A A A A R A D D D A S O
T R 6 5 0 / C 8 7 0 C T P
T w K K
Typical read/write cycle
ng
co
Bộ môn Kỹ Thuật Điện Tử 45
45
an
th
ng
SPI bus
o
du
• Always full-duplex
u
46
CuuDuongThanCong.com https://fb.com/tailieudientucntt 23
9/19/2019
Bus configuration
om
.c
ng
co
Bộ môn Kỹ Thuật Điện Tử 47
47
an
th
ng
SPI clocking
o
– Two phases
– Two polarities
u
48
CuuDuongThanCong.com https://fb.com/tailieudientucntt 24
9/19/2019
om
.c
ng
co
Bộ môn Kỹ Thuật Điện Tử 49
49
an
th
ng
• Pros
du
–
cu
• Cons
– Slave select/chip select makes multiple slaves more
complex
– No acknowledgement (can’t tell if clocking in garbage)
– No inherent arbitration
– No flow control (must know slave speed)
Bộ môn Kỹ Thuật Điện Tử 50
50
CuuDuongThanCong.com https://fb.com/tailieudientucntt 25
9/19/2019
• One wire
• USB
• PCI
• LVDS
om
.c
ng
co
Bộ môn Kỹ Thuật Điện Tử 51
51
an
th
o ng
du
u
cu
CuuDuongThanCong.com https://fb.com/tailieudientucntt 26