Presentation is loading. Please wait.

Presentation is loading. Please wait.

Microcomputer System Design

Similar presentations


Presentation on theme: "Microcomputer System Design"— Presentation transcript:

1 Microcomputer System Design
2015년 2학기 강원대학교 전자공학과 남 시 병

2 Computer System Design & Interface
Microprocessor & embedded 관련 교과목 교육과정 학기 관련교과목 내용 2-1 Digital 공학 논리회로, 레지스터, 카운터 등 2-2 Microprocessor 8bit Microprocessor 기초 3-1 실습 및 설계 VHDL(디지털 시스템 설계) Atmega128 interface 3-2 Interface Computer System Design & Interface Embedded system 4-1 Embedded System 4-2 Embedded System 응용

3 Introduction to microcomputer system
목차 Introduction to microcomputer system Microcomputer system design using Atmega128 Memory interface & Data read write LCD interface 5. LED interface I/O port 6. Key Board interface 7. ADC interface Embedded System Linux & Beaglebone Beaglebone GPIO Beaglebone LCD Beaglebone Sattic IP Beaglebone ADC Beaglebone WebCam Beaglebone Project

4 Introduction to microcomputer system
차이점 Microprocessor & Microcontroller system & One chip microprocessor CPU IO PORT Interface Driver I/O device Microcomputer system Address bus Data bus Conrrol bus Memory CPU I/O address Interface Driver I/O device

5 메모리 인터페이스 설계 1) 설계 순서 (1) Memory 영역 분석 (2) Memory device 결정
1) 설계 순서 (1) Memory 영역 분석 (2) Memory device 결정 (3) Memory Map 구성 (4) Address table 구성 (5) 회로설계 ex1) EPROM 2716을 4000H - 47FFH번지에 설계하여라 (1) Address 영역 FF (2) EPROM 2716 address( A0 - A10) (3) Memory map FFFFH 47FFH 4000H 0000H ROM 영역

6 (4) Address table (5) 회로설계 영 역 Chip select ROM address 고유 영역(A0-A10) A
15 14 13 12 11 10 A9 A8 A7 A6 A5 A4 A3 A2 A1 A0 영 역 1 4000H ROM 47FFH Chip select ROM address 고유 영역(A0-A10) (5) 회로설계

7 Memory address 고유 영역(A0-A10)
ex4) 아래 Memory map에 의해 ROM과 RAM을 설계하시오 Address 영역 ROM : 0000H – 07FFH RAM : 2000H- 27FFH (2) ROM 2716 SRAM MC6116 address( A0 – A10) (3) Memory map FFFFH 27FFH 2000H 07FFH 0000H RAM ROM (4) Address table A 15 14 13 12 11 10 A9 A8 A7 A6 A5 A4 A3 A2 A1 A0 영 역 0000H ROM 07FFH 1 2000H RAM 27FFH Chip select Memory address 고유 영역(A0-A10)

8 (5) 회로설계 CPU D0 - D7 A15 A14 A13 A12 A11 A0-A10 Address bus(A0 – A10 )
/OE /OE /RD /WR ROM (2716) RAM (6116) /MREQ /IORQ /WE /CE /CE D0 - D7 D0 - D7 D0 - D7 D0 - D7 Data bus (D0- D7) 1 A15 A15 A14 A14 A13 A13 A12 A12 A11 A11 0000H 2000H

9 Decoder를 이용한 Memory 영역설계
*8 Decoder truth table A B C D0 D1 D2 D3 D4 D5 D6 D7 1 *8 Decoder A D0 B D1 C D2 D3 D4 G D5 G D6 G D7 G1=1,G2=0,G3=0일때 74138이 Active가 된다

10 Memory address 고유 영역(A0-A10)
Decoder를 이용한 Map 설정 Address table A 15 14 13 12 11 10 A9 A8 A7 A6 A5 A4 A3 A2 A1 A0 영 역 0000H 07FFH 1 0800H 0FFFH Decoder 입력 Chip En Memory address 고유 영역(A0-A10) Map 영역 분할

11 Memory address 고유 영역(A0-A10)
ex) 아래 Memory map에 의해 ROM을 설계하시오 Address 영역 ROM : 0000H – 07FFH ROM : 0800H – 0FFFH ROM : 1000H – 17FFH (2) ROM 2716 address( A0 – A10) (3) Memory map FFFFH 17FFH 1000H 0FFFH 0800H 07FFH 0000H ROM_3 ROM_2 ROM_1 Address table A 15 14 13 12 11 10 A9 A8 A7 A6 A5 A4 A3 A2 A1 A0 영 역 0000H 07FFH 1 0800H 0FFFH 1000H 17FFH Decoder Chip En Memory address 고유 영역(A0-A10)

12 (5) 회로설계

13 Intel 계열(8085) microprocessor
X1 X2 RESET OUT SOD SID TRAP RST7.5 RST6.5 RST5.5 INTR /INTA HOLD HLDA RESET IN READY IO/M S1 /RD /WR ALE INTEL 8085 8bit microprocessor Address data bus AD0 -AD7 AD0-AD7 address bus A8-A15 A8-A15 그림 CPU

14 Demultiplexed address interface
Intel 계열 CPU는 하위 주소버스는 데이터 버스와 동일한 버스를 사용하도록 설계되어 있다. 따라서 외부 에서 주소와 데이터버스를 분리 시켜주는 회로가 필요하다. 이 방법을 demultiplexed address interface 가고 한다. LATCH AD0-AD7 A0-A7 ALE Address bus Data bus A0-A15 D0-D7 A8-A15 A8-A15 CPU에서 먼저 address 신호를 출력한 다음 ALE( Address Latch Enable)에 의하여 address를 래치 한다. 이때 address bus 는 A0-A7을 구성하고 A8-A15을 합성하면 A0-A15까 된다. 데이터 신호는 address 신호다음에 ALE가 “Low” 일 때에 출력된다.

15 { Demultiplexed address interface
data AD0-AD7 ALE D0-D7 Address A0-A7 A0-A7 Address A8-A15 A8-A15 A0-A15 ① AD0-AD7(하위 8비트 버스)에 주소 신호(A0-A7)를 출력한다 ② ALE신호가 “high”로 되면서 래치회로에서 A0-A7을 래치한다. ③ ALE신호를 “low”로 전환하고 D0-D7 를 출력한다.

16 8085 Demultiplexed address bus 방식 회로

17 ATmega 128 CPU Pinout AD0-AD7 PORTA ALE: PORTG.2 A8-A15 PORTC
/RD: PORTG.1 /WR: PORTG.0

18 Address Latch Requirements : Demultiplexed addressing method

19

20 Input Output Device interface
Micro-computer system CPU Interface 회로 I/O device Bus Bus Buffer, 기타 Interface 회로 Input Device : Key Board, Mouse,Tablet, AD converter 등 Output Device : CRT display, 7segment, LCD, Printer, Plotter, DA converter 등 I/O device : Memory, Magnetic tape, HDD,FDD

21 주소에 의한 I/O device(Input Output Device) interface 방식
(1)Memory Mapped I/O방식 (2) I/O Mapped I/O(Isolated Mapped I/O방식 Main memory Main memory FFFF FFFF I/O memory I/O address FF I/O address 00 0000 0000 Main memory 내부에 I/O address 영역을 두는 방식 회로가 간단하다 Main memory 영역 감소 Main memory 영역과 I/O address영역을 분리 시켜서 설계된 방식 회로가 복잡하다 main memory 영역을 모두 사용 가능

22 ATmega 128 CPU module configuration

23 ATmega 128 CPU Pin out

24 ATmega 128 Microcomputer system

25 Features • High-performance, Low-power AVR® 8-bit Microcontroller • Advanced RISC Architecture – 133 Powerful Instructions – Most Single Clock Cycle Execution – 32 x 8 General Purpose Working Registers + Peripheral Control Registers – Fully Static Operation – Up to 16 MIPS Throughput at 16 MHz – On-chip 2-cycle Multiplier • Nonvolatile Program and Data Memories – 128K Bytes of In-System Reprogrammable Flash Endurance: 10,000 Write/Erase Cycles – Optional Boot Code Section with Independent Lock Bits In-System Programming by On-chip Boot Program True Read-While-Write Operation – 4K Bytes EEPROM Endurance: 100,000 Write/Erase Cycles – 4K Bytes Internal SRAM – Up to 64K Bytes Optional External Memory Space – Programming Lock for Software Security – SPI Interface for In-System Programming • JTAG (IEEE std Compliant) Interface – Boundary-scan Capabilities According to the JTAG Standard – Extensive On-chip Debug Support – Programming of Flash, EEPROM, Fuses and Lock Bits through the JTAG Interface

26 • Peripheral Features – Two 8-bit Timer/Counters with Separate Prescalers and Compare Modes – Two Expanded 16-bit Timer/Counters with Separate Prescaler, Compare Mode and Capture Mode – Real Time Counter with Separate Oscillator – Two 8-bit PWM Channels – 6 PWM Channels with Programmable Resolution from 2 to 16 Bits – Output Compare Modulator – 8-channel, 10-bit ADC 8 Single-ended Channels 7 Differential Channels 2 Differential Channels with Programmable Gain at 1x, 10x, or 200x – Byte-oriented Two-wire Serial Interface – Dual Programmable Serial USARTs – Master/Slave SPI Serial Interface – Programmable Watchdog Timer with On-chip Oscillator – On-chip Analog Comparator • Special Microcontroller Features – Power-on Reset and Programmable Brown-out Detection – Internal Calibrated RC Oscillator – External and Internal Interrupt Sources – Six Sleep Modes: Idle, ADC Noise Reduction, Power-save, Power-down, Standby, and Extended Standby – Software Selectable Clock Frequency – ATmega103 Compatibility Mode Selected by a Fuse – Global Pull-up Disable

27 • I/O and Packages – 53 Programmable I/O Lines – 64-lead TQFP and 64-pad MLF • Operating Voltages – V for ATmega128L – V for ATmega128 • Speed Grades – MHz for ATmega128L – MHz for ATmega128

28 ATmega 128 microcomputer design
Memory & IO design Bus system address bus : 16bit data bus :8bit control bus System bus Address Bus Data Bus Conltrol Bus External Memory ATmega128 Address bus Address bus Data bus Data bus Control bus Control bus I/O Address bus Data bus Control bus

29 AVR ATmega128 Memories On-System Reprogrammable Flash Program Memory
내부에 128KB의 플래시 메모리 ATmega128는 8비트 마이크로컨트롤러이지만, 프로그램 메모리는 16비트 구조로 되어 있음. 64K×16 비트의 용량을 가짐. 모든 명령은 16bit 또는 32 bit 구조로 각 명령은 프로그램 메모리에서 1~2개의 번지를 차지함. 프로그램 메모리는 부트 프로그램 영역과 응용 프로그램 영역으로 구성됨. SPI 통신 방식을 이용한 ISP 기능을 가지고 있어서 사용자가 작성한 프로그램을 쉽게 쓰기가 가능함. JTAG 에뮬레이터, 병렬 프로그래밍을 이용한 프로그램 쓰기도 가능 16bit

30 SRAM Data Memory 레지스터 파일 0x0000-0x001F I/O 레지스터
I/O 레지스터는 SRAM과 달리 ATmega128에 내장된 I/O 소자들을 직접 제어하는데 사용 주소 0x x005F의 영역을 사용하는 I/O 레지스터와 주소 0x0060-0x00FF의 영역을 사용하는 확장 I/O 레지스터로 구성 내부 SRAM 내부 데이터 메모리인 SRAM은 0x0100-0x10FF 영역으로 4K 바이트 내부 SRAM은 프로그램에서 각종 사용자 변수를 저장하기 위해 사용되며, 스택 영역으로 사용 외부 SRAM 내부 SRAM의 용량이 부족할 경우, 외부에 0x1100 번지부터 0xFFFF번지까지 약 60K 바이트의 SRAM을 쓰기/읽기가 가능한 메모리 최대 64K(0x0000-0xFFFF) 바이트의 용량

31 사용가능 영역

32 MCU Control Register – MCUCR
• Bit 7 – SRE: External SRAM/XMEM Enable 외부 데이터 메모리 영역의 액세스를 가능하기 위해 사용 1로 세트되어 있으면 외부 데이터 메모리 영역의 액세스를 위한 신호가 외부로 출력되고, 0으로 설정되면, 이 신호들은 기본 기능인 병렬 I/O 포트로 동작 • Bit 6 – SRW10: Wait-state Select Bit 외부 데이터 메모리 영역을 액세스할 때 웨이트 사이클의 수를 지정 External Memory Control Register A –XMCRA 메모리 영역을 분할하거나 웨이트 사이클을 설정하는데 사용하는 레지스터 RL0∼SRL2 비트와 SRW00, SRW01, SRW10 등의 6 비트는 메모리 확장에 사용

33 SRL2∼SRL0 (Wait State Sector Limit) 비트
메모리를 2개의 섹터로 구분하는 기능을 담당 SRW11와 SRW10 비트 (Wait-state Select Bits for Upper Sector) MCUCR의 SRW10 비트와 XMCUCR의 SRW11 비트를 조합하여 외부 데이터 메모리의 상위 섹터에 해당하는 영역의 웨이트 사이클을 설정 SRW01과 SRW00 비트 (Wait-state Select Bits for Lower Sector) 외부 데이터 메모리의 하위 섹터에 해당하는 영역의 웨이트 사이클을 설정

34

35 Atmega128: External SRAM 64K Interface
External SRAM : 64Kbyte Wait cycle : 2cycle

36 MCUCR XMCRA SRE SRW10 SE SM1 SM0 SM2 IVSEL IVCE 1
SRE: External SRAM/XMEM Enable XMCRA - SRL2 SRL1 SRL0 SRW01 SRW00 SRW11 1 Upper memory block ; 0x1100~0xFFFF Wait: 2cycle

37 Status Register Bit 7 (I) : Global Interrupt Enable
Bit 6 (T) : 비트 복사 저장 (Bit Copy Storage) Bit 5 (H) : 보조 캐리 플래그 (Half Carry Flag) Bit 4 (S) : Sign Bit  Bit 3 (V) : 2의 보수 오버플로우 비트 (two's complement overflow bit) Bit 2 (N) : Negative Flag Bit 1 (Z) : Zero Flag Bit 0 (C) : Carry Flag

38 General Purpose Register File
AVR의 고성능 RISC 명령을 수행하는데 최적화 되어 있는 레지스터 1 바이트 크기로 32개의 범용 레지스터로 구성 연산의 대상이 누산기가 아닌 이들 32개의 범용 레지스터들을 사용하여 연산을 할 수 있어서 연산의 속도가 빠름 레지스터간의 연산은 보통 1 사이클 명령으로 이루어짐

39 Stack Pointer 스택 : 마이크로컨트롤러 응용에서 서브루틴이나 인터럽트 발생시에 복귀되는 주소를 임시로 기억하기 위해서 사용되거나 일반 프로그램에서 지역 변수 또는 임시 데이터를 저장하는 용도로 사용되는 LIFO(Last In First Out) 구조의 메모리 스택 포인터(stack pointer) : 항상 데이터의 상단(top of stack)을 가리키는 16비트 레지스터로서 SP라고 표시되는데, 이는 데이터 저장이 가능한 스택의 번지를 의미 스택의 동작 : 푸싱, 팝핑 동작 스택은 SRAM 영역내에 존재, SP 레지스터의 초기값은 적어도 0x60 번지 이상의 값으로 설정

40 Instruction Execution Timing
단일 클럭 사이클 동안에 두 개의 레지스터에서 데이터를 인출해 오고, 이에 대한 산술연산을 실행함 그 결과를 목적 레지스터에서 다시 저장하는 모든 과정을 단일 명령어 사이클에서 수행이 가능함.

41 External Memory Control Register B –XMCRB
버스 키퍼 기능을 설정 외부 데이터 메모리 어드레스의 상위 바이트 중에서 어디까지 어드레스 기능으로 사용할 것인지 설정 • Bit 7– XMBK: External Memory Bus-keeper Enable 1로 설정함으로써 AD7∼AD0 신호선은 버스 키퍼 기능이 허가 버스 키퍼 기능이 설정되면 외부 데이터 메모리의 AD7∼AD0 버스의 신호가 3-스테이트로 되어야 하는 동안에 이를 이전의 출력값을 유지하도록 하여 전력 소모를 줄이는데 기여함 . • Bit 2..0 – XMM2, XMM1, XMM0: External Memory High Mask 포트 C와 주소 버스의 상위 바이트가 어느 부분까지 주소 버스 신호로 사용될 지를 설정하는 기능

42 2개의 섹터로 구분 가능한 최대 60KByte의 외부 메모리
각 섹터에는 각각 독립적으로 웨이트 사이클을 설정 가능. 속도가 비교적 빠른 SRAM의 경우 : 웨이트를 부가하지 않고 제어 가능. 상대적으로 동작 속도가 느린 I/O 소자의 경우  적절한 웨이트 사이클을 부여하여 제어의 유연성 을 확보하기 위함. 외부 메모리를 SRL2∼SRL0 비트를 사용하여 개의 섹터로 구분 하위 섹터는 SRW01 ∼ SRW00 비트를 사용하여 사이클 부여. 상위 섹터는 SRW11 ∼ SRW10 비트를 사용하여 사이클 부여. Address Map with 32 KB External Memory

43 address 영역 Access time 0xFFFF 0x8000 SDRAM 빠름 0x7FFF 0x1100 I/O 영역 느림 0x10FF 0x0000 System 영역


Download ppt "Microcomputer System Design"

Similar presentations


Ads by Google