Lecture 02_전자 기초, Hardware Organization
< Embedded System >
Hardware + Software + Restriction
: either independent system or a part of a large system
: mostly designed for a specific function(s) within a larger system
- Real-time: various timing과 constraints를 충족해야 한다.
- Reliability: survival probability of the system when the function is critical during the run time.
- Battery
- Cost
< SW 엔지니어 >
- HW에 SW를 설치한다.
- 문제가 SW bug에 의해 발생하는지 HW fault에 의해 발생하는지 파악해야 한다.
- HW design을 읽고 corrections을 제안한다.
- SW drives HW directly.
- Detailed knowledge of HW가 필요하다.
- Often no safety net: SW bug can fry HW in some cases
< 예시 >
> Micro Ovens
- 8 bit Microcontroller
- No OS
- Assembly or C language
*Embedded system에는 OS(operating system)가 없다.
> Automotive Market
- automotive embedded systems and electronics로 인해 자동차가 안전하고 효율적이고 편안하다
Ex) adaptive cruise control, airbag, telematics, traction control, in -vehicle entertainment system,
emission control system, parking system, navigation systems, collision sensors, climate control,
radio, anti -lock braking system etc
- 수요가 많은 이유
: Growing vehicles sales.
: Increasing focus on vehicle safety features.
: Increasing demand of automation
- 디지털화에 따라 거의 모든 업계가 디지털 기술을 통합하여 더 나은 서비스를 제공하려 한다.
자동차 산업에서 디지털 기술을 사용하면 operational productivity and efficiencies을 제공하여
a ton of workload를 줄일 수 있기 때문에 서비스 공급자와 고객 모두 효과적으로 활용할 수 있다.
> IOT Based Smart Parking System
> Robotic Surgery
: Response time
: Bandwidth (대역폭)
> Aerospace (항공우주 산업)
< Electricity (전기) >
: The movement of electrons (전자의 이동)
> Electrons(전자) create charge(전하) which has three principles
- Voltage(전압) V
: 두 지점 사이 전하의 차이
: 두 지점 사이 잠재적 에너지의 양
: 수압
- Current(전류) A
: 전하가 흐르는 비율
: 한 주기동안 circuit에 흐르는 전하(charge)의 양
: 흐르는 물의 양
- Resistance(저항) Ω
: 전하의 흐름을 저항하는 정도
: charge와 current의 흐름을 방해하는 정도
: 물이 흐르는 호스의 넓이
> 옴의 법칙
V = I * R
< Direct Current (DC) vs Alternating Current (AC) >
- Direct Current (직류)
: The electric charge (current) only flows in one direction.
: Battery provides DC
: Typical digital system is based on DC
- Alternating Current (교류)
: The flow of charge that changes direction periodically.
→ current에 따라 voltage level 변환
: 가정, 회사 빌딩에서 사용
예) 60 cycles per 1 second
1 cycle = 0V → 220V → 0V → -220V → 0V
![]() |
![]() |
< Analog vs Digital >
> Analog
: continuous signal which represents physical measurements
: 전송, write/read cycle 중에 noise에 의해 subjected to deterioration
예) Thermometer, analog clock, human voice
> Digital
: discrete time signals generated by digital modulation
: 전송, write/read cycle 중에 deterioration 없이 noise-immune 할 수 있다.
예) Computers, smartphones, and other digital electronic devices
*In electical engineering, 시간에 따라 달라지는 양은 보통 Voltage이다 (if not, current)
→ signals에 대해 이야기할 때, signals를 시간에 따라 변화하는 Voltage로 생각
> Binary scheme for digital signaling
- Assign two different voltages as two different logic levels (states)
- High voltage (usually 5V, 3.3V, 1.8V) : 1 / TRUE / HIGH
- Low voltage (usually 0V) : 0 / FALSE / LOW
- Nothing is perfect (Use voltage ranges for logic levels)
예) 5V (operating voltage)
HIGH level output: 4.2 ~ 5V
HIGH level input: 3 ~ 5V
LOW level output: 0 ~ 0.9V
LOW level input: 0 ~1.5V
< Universal Serial Bus (USB) >
: 빠른 'serial' data transfer를 제공하고 small devices에 전원 공급 가능
: 충분한 current와 적합한 voltage를 circuit에 공급해야 정상 작동
Maximum Power = Maximum Voltage * Maximum Current
< Serial vs Parallel Communications >
*Parallel Communication: 1 byte = 8 bits
< Digital Multi-meter >
: circuits을 진단하고, 다른 사람들의 electronic designs을 배우고, 배터리를 테스트하는 도구
: voltage, current, resistance, continuity 측정
- DV 전압 : V-
- AC 전압 : V~
- A 암페어 : A-
- 저항: Ω
< Logic Gates >
- basic logic operations: AND, OR, NOT
+) NAND, NOR, XOR
- NAND
= AND → NOT = NOT | NOT
- NOR
= OR → NOT = NOT & NOT
- XOR
: 부호가 같으면 0, 다르면 1
< Power >
- VCC and ground provides power to a circuit
- VCC/VDD (or power pin) : 항상 HIGH에 연결
- Ground: 항상 LOW에 연결
< Memory >
: Storage for program instructions and data
: micro-controller는 서로 다른 종류의 memory HW components 여러 개로 구성되어 있다.
> memory type
- Volatile(휘발성): RAM(Random-access Memory), DRAM(main memory)
- Non-volatile(비휘발성): ROM(Read-only Memory)
*access: read and write
> Byte addressable vs Block of bytes-addressable
예) NOR (byte) vs NAND (block) Flash
→ 1 byte = 8 bits: data를 움직이는 단위
< Microprocessor (μP) >
- core components of μP
: ALU(Arithmetic Logical Units) - addition, subtraction, compare, branch, read/write
: Registers - internal memory
- μP는 memory read/write를 제외하고 ALU operators에 external memory를 직접적으로 사용하지 못한다.
→ external memory의 모든 데이터는 먼저 register에 load된 후 ALU에 쓸 수 있다.
→ load/store 연산 필요
< Hardware Organization: Processor (CPU) >
*CPU: ALU + Control unit + Register
< Microprocessor (μP) vs Processor (CPU) >
- Central Processing Unit (CPU)
: "brains" of a computer system
- Microprocessor
: CPU와 가장 유사 → CPU is often referred to as a microprocessor
*All CPUs are microprocessors, but not all microprocessors are CPUs.
→ Processor (CPU) ⊂ Microprocessor (μP)
< Hardware Organization: BUS >
> BUS
: Interconnect HW components
- 컴퓨터 안의 부품들 간에, 또는 컴퓨터 간에 데이터와 주소, 제어 신호 등 정보를 전송하는 통로(통신 시스템)
- 하드웨어 부품(선, 광섬유 등) + 통신 프로토콜을 포함한 소프트웨어
- μP + RAM + ROM + ...
예) 8-bit 전송: 8개의 wire, 16-bit 전송: 16개의 wire
> 예시
- Microprocessor (μP)
: 64KB addressable → A0-A15 address signals (2^16 = 65536 = 64KB)
: 8Bits data → D0-D7 Data signals.
- RAM/ROM
: 32KB memory space → A0-A14 address signals (2^15 byte)
*1byte = 8bits
1KB = 2^10 byte
1MB = 2^10 KB
1GB = 2^10 MB
1TB = 2^10 GB
> 작동 방법
1. READ는 RAM과 ROM의 OE(Output Enable) signals에 부착
2. WRITE는 RAM의 WE(Write Enable)에만 부착
(ROM은 Read-Only이기 때문)
< Hardware Organization: Main Memory >
< Memory Map >
> μP: 16-bit addressable 체계 (2^16 = 64KB)
: 64KB (0x0000 ~ 0xffff)
> memory mapping
: RAM과 ROM에 주소 범위를 할당하는 것
- ROM : 0x0000 ~ 0x7fff (32KB) (0111111111111111)
- RAM : 0x8000 ~ 0xffff (32KB) (1000000000000000)
> μP가 데이터를 읽고 싶다면
- ROM의 A15를 LOW로 (directly)
- RAM의 A15를 HIGH로 (inverted)
→ Connect A15 from μP to CE (Chip Enable) of both ROM (directly) and RAM (but inverted)
+) ROM과 RAM은 동시에 일하면 안 되기에 RAM의 CLK에 not 게이트를 붙임
→ 1개의 bit를 변경하고 싶어도 byte를 가져와야 한다.
- byte단위 (8-bit)로 동작한다.
< Hardware Organization: I/O Devices >
< Additional Devices on the BUS >
> External devices는 memory addresses에 의해 접근 가능
예) memory mapped I/O
: devices는 same buses with data and address signals을 사용하여 uP에 연결되어야 한다.
예) Sensors, actuators
- Memory map
: devices에 사용하지 않은 address range를 할당한다.
: uP pins는 corresponding device pins에 연결되어야 한다.
: Hardware schematic(도면)은 HW components가 서로 어떻게 연결되어 있고 사용되는 지 보여준다.
*중요*
< Simple Operations >
- Load
: 메인 메모리의 byte나 word를 register에 복사하여, register의 이전 내용에 overwriting
- Store
: register의 byte나 word를 메인메모리에 복사하여, 해당 위치의 이전내용에 overwriting
- Operate
: 2개의 registers의 내용을 ALU에 복사하고, 두 words에 대한 arithmetic operation을 수행한다.
(그 결과를 register에 저장하고, register의 이전 내용에 overwriting )
- Jump
: 명령어 자체에서 word를 추출하고 PC(Program Counter)에 복사하여 PC의 이전 값에 overwriting
< Running the Hello program >
자료는 이화여자대학교 윤명국 교수님의 임베디드시스템및실험 강의에서 가져온 것입니다.
'Study > 임베디드시스템및실험' 카테고리의 다른 글
[Exercise 03] 두 LED 동시에 깜빡이기 (0) | 2023.10.17 |
---|---|
[Lecture 04] LED (1) | 2023.10.16 |
[Exercise 02] Red LED 점차 빠르게 깜빡이기 (0) | 2023.10.15 |
[Lecture 03] Cortex-m, ARM (0) | 2023.10.15 |
[Lecture 01] Embedded System (0) | 2023.10.15 |