Bài giảng Kỹ thuật vi xử lý Microprocessors - Chương 7: Các bộ vi xử lý trên thực tế - Phạm Ngọc Nam

ppt 109 trang ngocly 840
Bạn đang xem 20 trang mẫu của tài liệu "Bài giảng Kỹ thuật vi xử lý Microprocessors - Chương 7: Các bộ vi xử lý trên thực tế - Phạm Ngọc Nam", để tải tài liệu gốc về máy bạn click vào nút DOWNLOAD ở trên

Tài liệu đính kèm:

  • pptbai_giang_ky_thuat_vi_xu_ly_microprocessors_chuong_7_cac_bo.ppt

Nội dung text: Bài giảng Kỹ thuật vi xử lý Microprocessors - Chương 7: Các bộ vi xử lý trên thực tế - Phạm Ngọc Nam

  1. © DHBK 2005 Nội dung môn học 1. Giới thiệu chung về hệ vi xử lý 2. Bộ vi xử lý Intel 8088/8086 3. Lập trình hợp ngữ cho 8086 4. Tổ chức vào ra dữ liệu 5. Ngắt và xử lý ngắt 6. Truy cập bộ nhớ trực tiếp DMA 7. Các bộ vi xử lý trên thực tế 1
  2. © DHBK 2005 Chương 7: Các bộ vi xử lý trên thực tế • General purpose microprocessors q Intel 80x86 q Xu hướng phát triển • Microcontrollers q Vi điều khiển của Motorola q Họ vi điều khiển 8051 q Họ vi điều khiển AVR q PSOC q Xu hướng phát triển • Digital signal processors q Texas Instruments q Motorola q Philips q Xu hướng phát triển 2
  3. © DHBK 2005 Chương 7: Các bộ vi xử lý trên thực tế • General purpose microprocessors þ Intel 80x86 q Xu hướng phát triển • Microcontrollers q Vi điều khiển của Motorola q Họ vi điều khiển 8051 q Họ vi điều khiển AVR q PSOC q Xu hướng phát triển • Digital signal processors q Texas Instruments q Motorola q Philips q Xu hướng phát triển 3
  4. © DHBK 2005 Intel 4004 • First microprocessor (1971) • 4-bit processor • 2300 Transistors (P- MOS), 10 mm • 0.06 MIPS, 108 KHz, 640 bytes addressable memory • -15V power supply 4
  5. © DHBK 2005 Intel 8008 • First 8-bit processor (1972) • Cost $500; at this time, a 4-bit processor costed $50 • Complete system had 2 Kbyte RAM • 200 KHz clock frequency, 10 mm, 3500 TOR, 0.06 MIPS, 16 Kbyte addressable memory • 18 pin package, multiplexed address and data bus 5
  6. © DHBK 2005 Intel 8080 • Second gen. 8-bit processor, introduced in 1974 • 40 pin package, NMOS, 500K instructions/s, 6 mm, 2 MHz, ±5V & +12V power supply, 6 KTOR, 0.64 MIPS • 64 Kbyte address space (“as large as designers want”, EDN 1974) 6
  7. © DHBK 2005 Intel 8088 • 16-bit processor • introduced in 1979 • 3 mm, 5 a 8 MHz, 29 KTOR, 0.33 a 0.66 MIPS, 1 Mbyte addressable memory 7
  8. © DHBK 2005 Intel 8086 16 bit integer CPU 16 data 20 address • Introduced: 1978 • Clock frequency: 8 - 10 MHz 8
  9. © DHBK 2005 Intel 80286 MMU 16 bit integer CPU 16 data 24 address • Introduced: 1983 • 1.5 mm, 134 KTOR, 0.9 to 2.6 MIPS • Clock frequency: 6 - 25 MHz 9
  10. © DHBK 2005 Intel 80386sx MMU 32 bit integer CPU 16 data 24 address • Introduced: 1986 • 1 mm, 275 KTOR, 16 to 33 MHz, 5 to 11 MIPS • Clock frequency: 16 - 25 MHz • Software support and hardware protection for multitasking 10
  11. © DHBK 2005 Intel 80386dx MMU 32 bit integer CPU 32 data 32 address • Introduced: 1988 • Clock frequency: 16 - 40 MHz • Software support and hardware protection for multitasking 11
  12. © DHBK 2005 Intel 80486dx 8 Kbyte cache 32 bit integer CPU 32 data MMU 64 bit FPU 32 address • Introduced: 1989 • Clock frequency: 25 - 50 MHz • Software support and hardware protection for multitasking • Support for parallel processing • Cache required: external memory is not fast enough 12
  13. © DHBK 2005 Intel 80486sx 8 Kbyte cache 32 bit integer CPU 32 data MMU 32 address • Introduced: 1989 • 0.8 mm, 1.2 MTOR, 20 to 41 MIPS • Clock frequency: 25 - 50 MHz • Software support and hardware protection for multitasking • Support for parallel processing • Cache required: external memory is not fast enough 13
  14. © DHBK 2005 Intel 80486dx2 8 Kbyte cache 32 bit integer CPU 32 data MMU 64 bit FPU 32 address • Introduced: 1992 • Clock frequency: internal: 50 - 66 MHz, external: 25 - 33 MHz • Software support and hardware protection for multitasking • Support for parallel processing • Cache required: external memory is not fast enough 14
  15. © DHBK 2005 Intel Pentium 8 Kbyte 32 bit integer 64 program cache pipelined CPU data 8 Kbyte 32 bit integer 32 data cache pipelined CPU address Static branch 64 bit FPU prediction unit MMU • Introduced: 1993 • (.8 mm, 3.1 MTOR) up to (.35 mm, 4.5 MTOR incl. MMX) • Clock frequency: internal: 60 - 166 MHz, external: 66 MHz • Support for parallel processing: cache coherence protocol • Super scalar 15
  16. © DHBK 2005 Intel Pentium Pro 8 Kbyte L1 32 bit integer 64+ECC program cache pipelined CPU data 8 Kbyte L1 32 bit integer 36 data cache pipelined CPU address Dynamic branch 32 bit integer prediction unit pipelined CPU 64 bit MMU pipelined FPU to L2 cache Instruction Address dispatch unit generation unit • Introduced: 1995, 0.35 mm, 3.3 V, 5.5 MTOR, 35W, 387 pin • Clock frequency: 150 - 200 MHz Internal, 60 - >100 MHz External • Super scalar (4 Instr./cycle), super pipelined (12 stages) • Support for symmetrical multiprocessing ( 4 CPU) • MCM: 256-1024 Kbyte L2 4-way set associative cache 16
  17. © DHBK 2005 Intel Pentium II 16 Kbyte L1 32 bit integer 64+ECC program cache pipelined CPU data 16 Kbyte L1 32 bit integer 36 data cache pipelined CPU address Dynamic branch 64 bit prediction unit pipelined FPU 64 bit ECC MMU pipelined FPU to L2 cache Instruction Address dispatch unit generation unit • Introduced: 1997, 0.25 mm, 2.0 V, 9 MTOR, 43 W, 242 pin • Clock frequency: 200 - 550 MHz Internal, 100 - 225 MHz L2 cache, 66 - 100 MHz External • Super scalar (4 Instr./cycle), super pipelined (12 stages) • Support for symmetrical multiprocessing ( 8 CPU) • Single Edge Contact Cartridge with Thermal Sensor: 256-1024 Kbyte L2 4-way set associative cache 17
  18. © DHBK 2005 Intel Pentium III 16 Kbyte L1 program cache 16 Kbyte L1 32 bit integer 64+ECC data cache pipelined CPU data 256 Kbyte L2 unified 32 bit integer 36 cache pipelined CPU address Dynamic branch 64 bit prediction unit pipelined FPU 64 bit MMU pipelined FPU Instruction Address dispatch unit generation unit • Introduced: 1999, 0.18 mm , 6LM, 1.8 V, 28 MTOR, 370 pin • Clock frequency: 450 - 1130 MHz Internal, 100-133 MHz External • Super scalar (4 Instr./cycle), super pipelined (12 stages) • Support for symmetrical multiprocessing ( 2 CPU) 18
  19. © DHBK 2005 Intel Pentium IV 16 Kbyte L1 program cache 16 Kbyte L1 32 bit integer 64+ECC data cache pipelined CPU data 32 bit integer 256/512/1024 Kbyte L2 36 pipelined CPU address Dynamic branch 64 bit prediction unit pipelined FPU 64 bit MMU pipelined FPU Instruction Address dispatch unit generation unit • Introduced: 2002, 0.13 mm or 90nm , 1.8 V, 55 MTOR • Clock frequency: 1,4 to 3.8 GHz Internal, 400 to 800 MHz External • Super scalar (4 Instr./cycle), super pipelined (12 stages) • Newer versions: Hyper threading, 3.8 MHz 19
  20. © DHBK 2005 Intel Pentium IV • Available at 3.80F GHz, 3.60F GHz, 3.40F GHz and 3.20F GHz • • Supports Hyper-Threading Technology1 (HT Technology) for all frequencies with 800 MHz front side bus (FSB) • • Supports Intel® Extended Memory 64Technology2 (Intel® EM64T) • Supports Execute Disable Bit capability • Binary compatible with applications running on previous members of the Intel microprocessor line • Intel NetBurst® microarchitecture • FSB frequency at 800 MHz • Hyper-Pipelined Technology • Advance Dynamic Execution • Very deep out-of-order execution • Enhanced branch prediction • 775-land Package 20
  21. © DHBK 2005 Intel Pentium IV • 16-KB Level 1 data cache • 1-MB Advanced Transfer Cache (on-die, fullspeed Level 2 (L2) cache) with 8-way associativity and Error Correcting Code (ECC) • 144 Streaming SIMD Extensions 2 (SSE2) instructions • 13 Streaming SIMD Extensions 3 (SSE3) instructions • Enhanced floating point and multimedia unit for enhanced video, audio, encryption, and 3D performance • Power Management capabilities • System Management mode • Multiple low-power states • 8-way cache associativity provides improved cache hit rate on load/store operations 21
  22. © DHBK 2005 IA-64 (Itanium) • Design started in 1994; first samples on the market in 2001 • 64-bit address space (4x109 Gbyte; we will never need that much ) • 256 64-bit integer and 128 82-bit floating point registers; 64 branch target registers; 64 1-bit predicate registers • 41 bit instruction word length • 10-stage pipeline • separate L1 data and program, 96 Kbyte L2 unified on-chip, 4 Mbyte L3 unified off-chip 22
  23. © DHBK 2005 Chương 7: Các bộ vi xử lý trên thực tế • General purpose microprocessors q Intel 80x86 þ Xu hướng phát triển • Microcontrollers q Vi điều khiển của Motorola q Họ vi điều khiển 8051 q Họ vi điều khiển AVR q PSOC q Xu hướng phát triển • Digital signal processors q Texas Instruments q Motorola q Philips q Xu hướng phát triển 23
  24. © DHBK 2005 Trends for general purpose processors • Higher clock frequencies: 4.7 -> 30 GHz • Faster memory: 120 ns -> 50 ns q not proportional to clock frequency increase => use of caches and special DRAM memories (e.g. SDRAM) • Limited by power dissipation => decreasing power supply voltage • Parallel processing • Memory with processor instead of processor with memory 24
  25. © DHBK 2005 The future: general characteristics Will 22 nm be the end of the scaling race for CMOS? Some believe10 nm will be the end thereafter, semiconductor drive will be scattered (MEMS, sensors, magnetic, optic, polymer, bio, ) Depending on application domain: besides and beyond silicon 25
  26. © DHBK 2005 Besides and beyond silicon (e.g. polymer electronics) 26
  27. © DHBK 2005 Besides and beyond silicon: applied to future ambient intelligent environments 27 © Emile Aarts, HomeLab, Philips
  28. © DHBK 2005 Besides and beyond silicon: applied to future ambient intelligent environments 28 © Emile Aarts, HomeLab, Philips
  29. © DHBK 2005 Besides and beyond silicon: applied to ambient intelligent HomeLab (2002) 29 © Emile Aarts, HomeLab, Philips
  30. © DHBK 2005 The future: high performance (mP) • CTO Intel says in 2001 q 2005 ð425 MTOR ð100 nm ð1600 mm2 ð30 GHz on chip ðwithout specific measures like individual transistor power- down: 3000 W, i.e. 3000 amps q 1.8 GTOR in 2010 30
  31. © DHBK 2005 The future: high performance (mP) 31
  32. © DHBK 2005 Processor performance Performance 1M 100K 10K 55%/year 1K 100 10 1 Time 1980 1985 1990 1995 2000 2005 Exponential growth for 3 decades! This is called ‘Moore’s law’: number of transistors doubles every 18 months (Gordon Moore, founder Intel Corp.) 32
  33. © DHBK 2005 Processor performance • Smaller line size q More transistors => parallelism ð1983: 1 instruction per 4 clock cycles ð2002: 8 instructions per clock cycle q Smaller capacitors => faster ð1983: 4 MHz ð2002: 2800 MHz q Speed-up: 25000 • Enables new applications q UMTS with large rolled-up OLED screen enabling web downloadable services (e.g. virtual meetings) • Do we find applications that are demanding enough for next decade’s processors? 33
  34. © DHBK 2005 The future: DRAM 34
  35. © DHBK 2005 Memory density Performance 1M Processor 100K 10K 55%/year Gap 1K 100 10 Memory 10%/year 1 Time 1980 1985 1990 1995 2000 2005 35
  36. © DHBK 2005 Memory density • Skills: center of gravity q USA: processors (Intel, Motorola, TI, ) q Japan: memory (NEC, Toshiba, ) q Future: IC = processor + memory Where??? • Memory density grows faster than needs q 1983: 512 Kbyte @ 64 Kbit/chip = 64 chips/PC q 2001: 256 Mbyte @ 512 Mbit/chip = 4 chips/PC q Compensated if you sell at least 16 times more PCs q or if you find new applications (UMTS, car, ) q 2010: 4 Gbyte @ 64 Gbit/chip = 0.5 chip/PC q No need for such a large memory chip q unless you find new applications (3D video ) 36
  37. © DHBK 2005 Power consumption Power (W/cm2) 1K Nuclear reactor 100 Hot plate P 4 10 P II P III P Pro 386 P 486 1 1.5m 1m 0.7m 0.5m 0.35m 0.25m 0.18m 0.13m 0.1m Line width Processor architecture design driven by memory bottleneck & power problem! Nevertheless, ‘cooling tower’ is necessary! 37 © Fred Pollack, Keynote at Micro99
  38. © DHBK 2005 Power consumption Cooling “tower” 38
  39. © DHBK 2005 Power consumption • Let us do a calculation: q How long could a GSM using a Pentium 3 (hardly powerful enough ) last on a single battery charge? q Capacity of a battery: 600 mAh @ 4V = 2400 mWh q Power consumption Pentium 3: 45 W q One charge lasts for 3 minutes!!! • Let us turn the computation upside down: q We want a GSM to last for 240 hours on a single charge. How much power may be consumed by the processor? q Capacity of a battery: 600 mAh @ 4V = 2400 mWh q Power consumption processor: 10 mW q Possible via specialization to the application: dedicated hardware 39
  40. © DHBK 2005 Summary on technological trends • Technologically speaking, we can have the same exponential evolution for another decade • This gives us at least 4 decades of exponential evolution, never seen in history • End-user price stayed the same or even decreased q Since 30 years, the price for a brand new processor is 1000 USD • So far for the good news 40
  41. © DHBK 2005 Design issues Performance Design 1M complexity 100K 10K 55%/year Gap 1K 100 Design 10 productivity 10%/year 1 Time 1980 1985 1990 1995 2000 2005 Unfortunately, Gordon Moore’s law is also valid for the design complexity, which doubles every 18 months and worse, design productivity doubles only every 10 years 41
  42. © DHBK 2005 Design issues • We can build exponentially complex circuits, but we cannot design them q Design of Pentium 4: 8 years, during last 2 years with a team of 1000 persons q Who can afford this??? 42
  43. © DHBK 2005 Chương 7: Các bộ vi xử lý trên thực tế • General purpose microprocessors q Intel 80x86 þ Xu hướng phát triển • Microcontrollers þ Vi điều khiển của Motorola q Họ vi điều khiển 8051 q Họ vi điều khiển AVR q PSOC q Xu hướng phát triển • Digital signal processors q Texas Instruments q Motorola q Philips q Xu hướng phát triển 43
  44. © DHBK 2005 Giới thiệu về vi điều khiển • Vi điều khiển = CPU + Bộ nhớ + các khối ghép nối ngoại vi + các khối chức năng q EEPROM q RAM q ADC/DAC q Timer q Bộ tạo xung nhịp q PWM q UART q USB q 44
  45. © DHBK 2005 Vi xử lý vs. Vi điều khiển • Vi xử lý là một CPU được sử dụng trong các máy tính. • Các vi bộ điều khiển và các bộ vi xử lý có ba điểm khác nhau chính sau:kiến trúc phần cứng, phạm vi ứng dụng, và đặc điểm tập lệnh. • Kiến trúc phần cứng: Một bộ vi xử lý chỉ là một CPU đơn lẻ trong khi một bộ vi điều khiển là một IC chứa CPU và các mạch ngoại vi chính của một máy tính hoàn chỉnh (như RAM, ROM, giao diện nối tiếp, giao diện song song, bộ định thời, mạch xử lý ngắt) • Ứng dụng: Vi xử lý thường được dùng như một CPU trong các máy tính trong khi các vi điều khiển được sử dụng trong các thiết bị nhỏ để điều khiển các hoạt động. 45
  46. © DHBK 2005 Vi xử lý vs. Vi điều khiển • Tập lệnh: q Tập lệnh của vi xử lý thiên về xử lý dữ liệu. ðChúng có thể làm việc với 4 bit, byte, word, thậm chí double word. ðChế độ địa chỉ cho phép truy nhập các mảng dữ liệu lớn bằng cách sử dụng con trỏ và địa chỉ offset. q Tập lệnh của vi điều khiển dùng để điều khiển các truy nhập vào và ra. ðChúng có các lệnh cho phép thiết lập và xoá các bit riêng rẽ và thực hiện các thao tác với bit. ðCó các lệnh cho các hoạt động vào/ra, đo thời gian các sự kiện, cho phép và thiết lập các mức độ ưu tiên cho các ngắt ngoài. • Khả năng xử lý của vi điều khiển thấp hơn rất nhiều so với vi xử lý. 46
  47. © DHBK 2005 Microcontroller facts • 99% processor market • Shipments- > 16 Billion in 2000, 8 bit > 1/2 market • Major Players: Microchip 16Fxx, Intel 8051, Motorola MC68HC05, National COP800, SGS/Thomson ST62, Zilog Z86Cxx 47
  48. © DHBK 2005 Motorola MC68331 32 bit 2 Timers 16 integer CPU data 1 Serial asynch. FT unit: watchdog 24 Buffered I/O clock&bus monitor address 12 Programmable chip selects 7 Interrupt logic • Clock frequency: > 16 MHz • MC683xx: modular microcontroller unit: MC68000 core plus customized peripherals 48
  49. © DHBK 2005 Motorola MC68332 32 bit Timer PU 16 integer CPU data 1 Serial asynch. FT unit: watchdog 24 Buffered I/O clock&bus monitor address 12 Programmable 2 Kbyte RAM chip selects 7 Interrupt logic 48 Parallel I/O • Clock frequency: > 16 MHz • MC683xx: modular microcontroller unit: MC68000 core plus customized peripherals 49
  50. © DHBK 2005 Motorola MC68340 32 bit 2 Timers 16 integer CPU data 2 Serial asynch. FT unit: watchdog 32 I/O clock&bus monitor address 4 Programmable 2 channel chip selects DMA controller 7 Interrupt logic 16 Parallel I/O • Clock frequency: > 16 MHz • MC683xx: modular microcontroller unit: MC68000 core plus customized peripherals 50
  51. © DHBK 2005 Motorola MC68F333 • 64 Kbyte on chip flash EEPROM • 68020 processor • 4 Kbyte SRAM • 8 channel 10-bit ADC • 16 channel 16-bit timer • several interfaces • Introduced in 1994 51
  52. © DHBK 2005 Motorola MC68HC16 • 16-bit microprocessor • Introduced in 1994 www.freescale.com 52
  53. © DHBK 2005 Chương 7: Các bộ vi xử lý trên thực tế • General purpose microprocessors q Intel 80x86 þ Xu hướng phát triển • Microcontrollers q Vi điều khiển của Motorola þ Họ vi điều khiển 8051 q Họ vi điều khiển AVR q PSOC q Xu hướng phát triển • Digital signal processors q Texas Instruments q Motorola q Philips q Xu hướng phát triển 53
  54. © DHBK 2005 Họ vi điều khiển 8051 • Hiện nay có hơn 40 công ty sản xuất các loại vi điều khiển khác nhau của họ 8051. • Một số công ty có trên 40 version 8051. • Các CORE 8051 có thể được tổ hợp trong các FPGA hay ASIC. • Trên 100 triệu vi điều khiển 8051 được bán ra mỗi năm. • Họ 8051 gặt hái được rất nhiều thành công và nó cũng trực tiếp ảnh hưởng đến cấu trúc của các họ vi điều khiển hiện nay. 54
  55. © DHBK 2005 MCS-51 • 8051 thuộc họ vi điều khiển MCS-51. • MCS-51 được phát triển bởi Intel và các nhà sản xuất khác (như Siemens, Philips) là các nhà cung cấp đứng thứ hai của họ này. • Tóm tắt một số đặc điểm chính của họ 8051: q 4K bytes ROM trong q 128 bytes RAM trong q 4 cổng I/O 8-bit q 2 bộ định thời 16 bit q Giao diện nối tiếp q Quản lý được 64K bộ nhớ code bên ngoài q Quản lý được 64K bộ nhớ dữ liệu bên ngoài 55
  56. © DHBK 2005 Họ vi điều khiển 8051 C¸c ng¾t ngoµi C¸c sù kiÖn cÇn ®Õm Ram trong Thanh ghi 128 byte FF chøc n¨ng ram ®Æc biÖt 80 §iÒu khiÓn Nguån 128 byte 7F ng¾t Ng¾t Trong RAM 00 CPU Bé Qu¶n Port Port Port Port Cæng dao ®éng lý Bus 0 1 2 3 nèi tiÕp XTAL 1,2 PSEN ALE §Þa chØ §Þa Më réng thÊp/d÷ liÖu 56 chØ cao trong 8032
  57. © DHBK 2005 Tham khảo • Họ vi điều khiển 8051 • www.atmel.com/products/8051/ • • 57
  58. © DHBK 2005 Chương 7: Các bộ vi xử lý trên thực tế • General purpose microprocessors q Intel 80x86 þ Xu hướng phát triển • Microcontrollers q Vi điều khiển của Motorola q Họ vi điều khiển 8051 þ Họ vi điều khiển AVR q PSOC q Xu hướng phát triển • Digital signal processors q Texas Instruments q Motorola q Philips q Xu hướng phát triển 58
  59. © DHBK 2005 Họ vi điều khiển AVR Bus d÷ liÖu 8 bÝt Bé nhí flash Bé ®Õm Tr¹ng th¸i vµ Thanh ghi 1k x 16 cho ch­¬ng tr×nh kiÓm tra ®iÒu khiÓn ch­¬ng tr×nh Thanh ghi §¬n vÞ ng¾t Thanh ghi ®a n¨ng lÖnh 32 x 8 §¬n vÞ SPI UART nèi tiÕp Bé gi¶i m· lÖnh ALU Timer/Counter 8 bÝt C¸c ®­êng ®iÒu khiÓn 128 x 8 Timer/Counter Data 16 bit víi SRAM Bé PWM®Þnh thêi watchdog 128x8 Bé so s¸nh EEPROM analog 15 ®­êng dÉn vµo/ra 59
  60. © DHBK 2005 Chương 7: Các bộ vi xử lý trên thực tế • General purpose microprocessors q Intel 80x86 þ Xu hướng phát triển • Microcontrollers q Vi điều khiển của Motorola q Họ vi điều khiển 8051 q Họ vi điều khiển AVR þ PSOC q Xu hướng phát triển • Digital signal processors q Texas Instruments q Motorola q Philips q Xu hướng phát triển 60
  61. © DHBK 2005 Giới thiệu chung về PSoC • PSoC là gì? q Do hãng Cypress sản xuất q Một loại công nghệ IC mới phát triển trong vài năm gần đây. q Khả năng tích hợp động các loại linh kiện số và tương tự để tạo ra các khối số hoặc tương tự với chức năng tuỳ thuộc người dùng. q Kết hợp với một vi điều khiển trung tâm. 61
  62. © DHBK 2005 Cấu trúc PSoC • Lõi PSoC q Vi xử lý 8bit, 24MHz, 4MIPS q Flash ROM (từ 16K) q RAM (128b-2kb) q Bộ điều khiển ngắt q Bus • Các khốI số q Flip-Flop, cổng logic • Các khốI tương tự q Các bộ khuếch đạI thuật toán q Điện trở q Tụ điện điều khiển đóng ngắt • Tài nguyên hệ thống • Đặc biệt: Debugger core 62
  63. © DHBK 2005 Ứng dụng Xử lý tín hiệu Giao tiếp với cảm biến • Phát hiện sóng Sin • Điện trở nhiệt • Đo điện áp • Cặp nhiệt • Đo tần số • Đo tín hiệu hồng ngoạI thụ động • Điền chế/giảI điều chế • Thu siêu âm • Lọc • Đo áp suất • Nhân tương tự • FSK 63
  64. © DHBK 2005 So sánh thiết kế giữa VXL, VĐK, PSoC • Ứng dụng: Mạch đo điện áp 0-5V, hiển thị giá trị ra LED q Thiết kế phần cứng q Thiết kế phần mềm Nguồn Tương Bộ xử lý Hiển thị điện áp tự/Số trung tâm LED Nguồn nuôi 64
  65. © DHBK 2005 So sánh Vi xử lý Vi điều khiển PSoC Độ phức tạp Cao Trung bình Thấp phần cứng Giá thành Cao Trung bình Trung bình Độ ổn định Thấp Trung bình Cao Khả năng Khó Trung bình Dễ phát triển hệ thống 65
  66. © DHBK 2005 Thiết kế hệ thống sử dụng PSoC • Chuẩn bị q IC q Chương trình thiết kế: PSoC Designer q Chương trình nạp và mạch nạp • Các bước thiết kế PSoC sử dụng PSoC designer q Thiết kế “cứng” ðLựa chọn “linh kiện” để đưa vào các khốI số, tương tự ðĐưa các linh kiện vào các khốI và kết nốI ðThiết lập các thông số q Lập trình ðKích hoạt các linh kiện: Component_Start() ðViết các thuật toán sử dụng linh kiện ðVòng lặp vô tận 66
  67. © DHBK 2005 Một số linh kiện • ADC (6-14 bit) • DAC (6-9 bit) • Khuếch đạI • DTMF • Bộ lọc (thông thấp, thông dảI) • Bộ đếm, bộ định thờI (8-24 bit) • Dồn kênh: số+tương tự • Các linh kiện số: I2C, UART, giao tiếp LCD, mã CRC, mã giả ngẫu nhiên, giao tiếp chuẩn thu /phát hồng ngoại 67
  68. © DHBK 2005 Chọn linh kiện Linh kiện trong hệ thống Tài nguyên hệ thống Chọn Hướng linh dẫn sử kiện dụng linh kiện 68
  69. © DHBK 2005 Thiết kế Thông số chung IC Thông BUS số linh Chân ố kiện S ự t ng ươ T 69
  70. © DHBK 2005 Lập trình Quản lý theo dự án 70
  71. © DHBK 2005 Chương 7: Các bộ vi xử lý trên thực tế • General purpose microprocessors q Intel 80x86 þ Xu hướng phát triển • Microcontrollers q Vi điều khiển của Motorola q Họ vi điều khiển 8051 q Họ vi điều khiển AVR q PSOC q Điều khiển trong công nghiệp PLC þ Xu hướng phát triển • Digital signal processors q Texas Instruments q Motorola q Philips q Xu hướng phát triển 71
  72. © DHBK 2005 PLC (Programmable Logic Controller) • PLC = CPU + giao diện vào ra • Đặc điểm của PLC: q Giá thành hợp lý cho các ứng dụng điều khiển phức tạp q Chịu được rung động, nhiệt, ẩm, tiếng ồn và có độ bền cao q Có sẵn giao diện cho các thiết bị vào và thiết bị ra q Lập trình dễ dàng với ngôn ngữ lập trình đơn giản, chủ yếu giải quyết các phép toán logic và chuyển mạch • PLC được dùng chủ yếu để điều khiển trong công nghiệp: q Điều khiển băng chuyền q Điều khiển thang máy q Điều khiển máy tự động: máy khoan, máy sấy q Điều khiển đèn giao thông q 72
  73. © DHBK 2005 Cấu trúc của hệ thống PLC Bộ nhớ lưu trữ chương trình Tín hiệu Tín hiệu PLC ra vào Giao Giao diện Vi xử lý diện vào ra 73
  74. © DHBK 2005 Cấu trúc bên ngoài 74
  75. © DHBK 2005 Chương 7: Các bộ vi xử lý trên thực tế • General purpose microprocessors q Intel 80x86 þ Xu hướng phát triển • Microcontrollers q Vi điều khiển của Motorola q Họ vi điều khiển 8051 q Họ vi điều khiển AVR q PSOC þ Xu hướng phát triển • Digital signal processors q Texas Instruments q Motorola q Philips q Xu hướng phát triển 75
  76. © DHBK 2005 Trends for microcontrollers • Standard CPU core surrounded by peripherals taken from a vast library • Single architecture line is whole family q different memory & on-chip peripherals q for embedded applications q Deterministic behavior ðno caches, no virtual memory, but on-chip RAM ðno out-of-order execution ðdelayed branch prediction 76
  77. © DHBK 2005 Trends for microcontrollers • Word length as small as possible q 4 bit: 2% q 8 bit: 36% q 16 bit: 25% q 32 bit: 34% q 64 bit: 3% • Not pushing the limits of performance for cost reasons 77
  78. © DHBK 2005 Chương 7: Các bộ vi xử lý trên thực tế • General purpose microprocessors q Intel 80x86 þ Xu hướng phát triển • Microcontrollers q Vi điều khiển của Motorola q Họ vi điều khiển 8051 q Họ vi điều khiển AVR q PSOC q Xu hướng phát triển • Digital signal processors þ Texas Instruments q Motorola q Philips q Xu hướng phát triển 78
  79. © DHBK 2005 Texas Instruments TMS320C20x Low end consumer Fixed Point Dual access fixed MAC 16 data RAM 16x16+32->32 data PROM Selection of 18 peripherals: address serial comm., Loop controller timers, I/O 16 data 16 address • Series continued; typical app.: Digital camera, feature-phones, disk drives, Point-of-Sales Terminal • 40 MHz, 3.3-5V, 3LM • Available as core 79
  80. © DHBK 2005 Texas Instruments TMS320C24x Low end consumer Fixed Point Dual access fixed MAC 16 data RAM 16x16+32->32 data PROM 8 output PWM 16 address Loop controller 8 channel A/D Selection of CAN bus peripherals: controller serial comm., timers, watchdog • Series continued; typical app.: electrical motor control • 50 MHz, 5V 80
  81. © DHBK 2005 Texas Instruments TMS320C3x Floating Point 32 bit XRAM 32 floating add data 32 bit YRAM 24 floating multiply address PRAM ACU I/O 32 Loop controller ACU data Selection of 24 peripherals: address serial comm., timers, DMA, • Series discontinued; typical app.: speech, audio • 60 MHz, 3.3-5V, 144 pin • Super scalar 81
  82. © DHBK 2005 Texas Instruments TMS320C4x Floating Point Message Passing 20 MB/s 32 bit 4KByte XRAM 32 floating add data 32 bit 4KByte YRAM 32 floating multiply address 8 PRAM ACU 32 Loop controller ACU data 12 channel 32 DMA controller Serial link, address timers • Series discontinued; typical app.: prototyping, radar • 60 MHz, 5V, 325 pin • Super scalar; message passing multiprocessor 82
  83. © DHBK 2005 Texas Instruments TMS320C54xx High end consumer Fixed Point Dual access Fixed ALU 32 XRAM 32+32->40 data Fixed Add YRAM 17 32+32->40 address Fixed multiply PROM 17x17->34 I/O 16 Loop controller Viterbi data 6 channel ACU 16 DMA controller address Buffered serial ACU links, timers, • Series continued; typical app.: GSM, set-top box, audio • 1.8-5V, max. 160 MHz, 144 pin, .15mm (1999), 0.32mW/MIPS for the core • Specialized on-chip unit: will occur more often in future • e.g. C5420: dual core + 2x100 MW on-chip SRAM 83 e.g. C5402: 5$ for 100 MIPS
  84. © DHBK 2005 Texas Instruments TMS320C5510 High end consumer Fixed Point Dual access Fixed ALU XRAM (256 Kbyte) 32+32->40 YRAM Fixed Add 32 (64 Kbyte) 32+32->40 data PROM Fixed multiply 24 32 KByte 17x17->34 address P-cache Fixed multiply 24 KByte 17x17->34 I/O 16 Power Mgment Viterbi data 6 channel ACU 16 DMA controller address Buffered serial ACU links, timers, • Series continued; typical app.: UMTS handheld • 1.6V, 200 MHz, .15mm (2000), 400 MIPS,0.05mW/MIPS (core), power management per unit and per cycle 84• Specialized on-chip unit: will occur more often in future
  85. © DHBK 2005 Texas Instruments TMS320C8x Fixed Point Video 2 Kbyte RAM1 DSP processor 1 32 DSP processor 2 address 2 Kbyte RAM16 X- DSP processor 3 data bar 64 2 Kbyte I-cache1 DSP processor 4 2 Kbyte I-cache4 General purpose 4 Kbyte D-cache RISC processor 4 KByte I-cache Video controller Transfer 2 KByte RAM controller • Series discontinued; typical app.: video phone, video conferencing, multimedia workstations • Introduced: 1995, 50 MHz, 305 pin • Multiprocessor-on-a-chip; sub-word SIMD for each DSP 85
  86. © DHBK 2005 Texas Instruments TMS320C6201 High end Fixed Point fixed MUL 16KByte D-SRAM 16x16->32 External memory fixed MUL 23 16KByte D-SRAM 16x16->32 address fixed ALU 16KByte D-SRAM data 32+32->40 32 fixed ALU 16KByte D-SRAM 32+32->40 64KByte fixed ALU/branch P-SRAM/cache 32+32->40 JTAG / clock pump fixed ALU/branch Host interface 4 channel DMA 32+32->40 Ext. memory integer ACU 17 address interface 32+32 2 Serial ports integer ACU data 2 Timers 32+32 16 • Series continued; typical app.: modems, multimedia • 1997, 0.25 mm, 5ML, 352 pin, 200 MHz, 2.5V, 1.9W, $85 • Super scalar (8 Instr./cycle), 1600 MIPS 86• VLIW: 256 bit instruction word
  87. © DHBK 2005 Texas Instruments TMS320C6202 High end Fixed Point 2x16KByte D-RAM fixed MUL (Shadow load) 16x16->32 External memory 2x16KByte D-RAM fixed MUL 23? (Shadow load) 16x16->32 address 2x16KByte D-RAM fixed ALU data (Shadow load) 32+32->40 32 2x16KByte D-RAM fixed ALU (Shadow load) 32+32->40 2x128KB P-RAM fixed ALU/branch (Shadow load) 32+32->40 JTAG / clock pump fixed ALU/branch Expansion bus 4 channel DMA 32+32->40 Ext. memory integer ACU 17? address interface 32+32 2 Serial ports integer ACU data 2 Timers 32+32 32 • Series continued; typical app.: modems, multimedia • 1999, 0.18 mm, 5ML, 352 pin, 250 MHz, 1.8V, 1.9W, $130 • Super scalar (8 Instr./cycle), 2000 MIPS, scales well till 700 MHz (6000 MIPS) 87• Optimum choice when all data fits in on-chip memory
  88. © DHBK 2005 Texas Instruments TMS320C6203 High end Fixed Point 2x64KByte D-RAM fixed MUL (Shadow load) 16x16->32 External memory 2x64KByte D-RAM fixed MUL 23? (Shadow load) 16x16->32 address 2x64KByte D-RAM fixed ALU data (Shadow load) 32+32->40 32 2x64KByte D-RAM fixed ALU (Shadow load) 32+32->40 256KByte P-RAM fixed ALU/branch 128KB P-cache/RAM 32+32->40 JTAG / clock pump fixed ALU/branch Expansion bus 4 channel DMA 32+32->40 Ext. memory integer ACU 17? address interface 32+32 2 Serial ports integer ACU data 2 Timers 32+32 32 • Series continued; typical app.: base stations • 2000, 0.15 mm, 5ML, 18 mm2 package size, 300 MHz, 1.5V, 1.5W • Super scalar (8 Instr./cycle), 2400 MIPS • Optimum choice when all data fits in on-chip memory 88
  89. © DHBK 2005 Texas Instruments TMS320C6211 High end Fixed Point 4KByte L1 Dcache fixed MUL (2 way set assoc.) 16x16->32 External memory 4KByte L1 Pcache fixed MUL 30 (2 way set assoc.) 16x16->32 address 4x16KByte L2 fixed ALU data cache (direct map) 32+32->40 32 fixed ALU 32+32->40 fixed ALU/branch 32+32->40 JTAG / clock pump fixed ALU/branch Host port 16 channel DMA 32+32->40 Ext. memory integer ACU 17 address interface 32+32 2 Serial ports integer ACU data 2 Timers 32+32 16 • Series continued; typical app.: modems, multimedia • 1999, 0.18 mm, 5ML, 256 pin, 150 MHz, 1.8V, 1.5W, $25 • VLIW, 1.2 GIPS; cheap (25$ in ‘99, 5$ in ‘01) • Optimum for random access to large memory space 89• 80% of performance of C6x with infinite on-chip memory
  90. © DHBK 2005 Texas Instruments TMS320C6416 High end Fixed Point 16 Kbyte L1P fixed MUL direct mapped 16x16->32 External memory 16 Kbyte L1D fixed MUL 30 2way dual access 16x16->32 address 1 Mbyte RAM/L2 fixed ALU data 4way 32+32->40 64 Dual EMIF & HPI & fixed ALU PCI & Utopia 32+32->40 30 address JTAG / clock pump fixed ALU/branch 64 channel DMA 32+32->40 data 3 Serial ports fixed ALU/branch 16 3 Timers 32+32->40 HPI Viterbi decoder integer ACU ? accelerator 32+32 address Turbo decoder integer ACU data accelerator 32+32 32 • Samples June 2001, 0.12 mm, 6 LM, 532 pin, 400 MHz-600 MHz, 1.2V, starts at 95$ in volume • Super scalar (8 Instr./cycle), 3200-4800 MIPS • Sub-word (8bit or 16bit) parallelism 90• Specialized instr.: Galois Field Mult, bit manipulation
  91. © DHBK 2005 Texas Instruments TMS320C6701 High end Floating Point Fixed/Float MUL 16KByte D-SRAM 32x32/64x64 External memory Fixed/Float MUL 23 16KByte D-SRAM 32x32/64x64 address Fixed/Float ALU 16KByte D-SRAM data 32+32/64+64 32 Fixed/Float ALU 16KByte D-SRAM 32+32/64+64 64KByte Fixed ALU/Branch P-SRAM/cache Float 1/x & x JTAG / clock pump Fixed ALU/Branch Host interface 4 channel DMA Float 1/x & x Ext. memory integer ACU 17 address interface 32+32 Serial interface integer ACU data 2 Timers 32+32 16 • Series continued; typical app.: video compression • Introduced: 1998, 0.18 mm, 5ML, 352 pin, 167 MHz, 1.8V • Super scalar (8 Instr./cycle); VLIW; 1 GFLOP 91• Foreseen for ‘00: 50$ (cf. C6211) & 3 GFLOP (cf. C6202)
  92. © DHBK 2005 Texas Instruments TMS320C6711 High end Floating Point 4KByte L1 Dcache Fixed/Float MUL (2 way set assoc.) 32x32/64x64 External memory 4KByte L1 Pcache Fixed/Float MUL 23 (2 way set assoc.) 32x32/64x64 address 4x16KByte L2 Fixed/Float ALU data cache (direct map) 32+32/64+64 32 Fixed/Float ALU 32+32/64+64 Fixed ALU/Branch Float 1/x & x JTAG / clock pump Fixed ALU/Branch Host interface 4 channel DMA Float 1/x & x Ext. memory integer ACU 17 address interface 32+32 Serial interface integer ACU data 2 Timers 32+32 16 • Series continued; typical app.: video compression • 2000, 0.18 mm, 5ML, 256 pin, 100 MHz, 1.8V, 2W, $20 • VLIW, 600 MFlops • Optimum for random access to large memory space 92• 80% of performance of C6x with infinite on-chip memory
  93. © DHBK 2005 Texas Instruments TMS320C541 (1995) 93
  94. © DHBK 2005 Texas Instruments TMS320C545 (1995) 94
  95. © DHBK 2005 Texas Instruments TMS320C80 (1994) 95
  96. © DHBK 2005 Chương 7: Các bộ vi xử lý trên thực tế • General purpose microprocessors q Intel 80x86 þ Xu hướng phát triển • Microcontrollers q Vi điều khiển của Motorola q Họ vi điều khiển 8051 q Họ vi điều khiển AVR q PSOC q Xu hướng phát triển • Digital signal processors q Texas Instruments þ Motorola q Philips q Xu hướng phát triển 96
  97. © DHBK 2005 Motorola MC56xxx Audio Fixed Point 16 or 24 bit XRAM 24 integer CPU data YRAM ACU 18 address PRAM ACU Loop controller Selection of peripherals: ADC, DAC, comm., timers, PIO, • 24 bit for audio: 16 bit data + overflow 97
  98. © DHBK 2005 Motorola MC56002 98
  99. © DHBK 2005 Motorola MC56166 99
  100. © DHBK 2005 Chương 7: Các bộ vi xử lý trên thực tế • General purpose microprocessors q Intel 80x86 þ Xu hướng phát triển • Microcontrollers q Vi điều khiển của Motorola q Họ vi điều khiển 8051 q Họ vi điều khiển AVR q PSOC q Xu hướng phát triển • Digital signal processors q Texas Instruments q Motorola þ Philips q Xu hướng phát triển 100
  101. © DHBK 2005 Philips VSP-1 Fixed Point Video 12 512x12 bit 12 bit Memory element integer ALU 512x12 bit 12 bit Memory element integer ALU 12 bit 10x18 cross-bar integer ALU 12 10 • 12 bit for video: 8 bit data + overflow • Clock Frequency: 27 MHz • 1 instruction per sample period for HDTV, 2 instructions per sample period for TV 101
  102. © DHBK 2005 Philips VSP-1 Fixed Point Video Inputs ALU ALU ALU ME ME Outputs 102
  103. © DHBK 2005 Output Philips VSP-1 FIFOs Fixed Point Video • 206K Transistors • 1.1W dissipation • 27 MHz clock • 176 pin • Introduced in 1991 Memory ALU Element 103
  104. © DHBK 2005 Philips VSP-2 Fixed Point Video 12 512x12 bit 12 bit Memory element1 integer ALU1 512x12 bit 12 bit Memory element2 integer ALU2 12 512x12 bit 12 bit Memory element4 integer ALU12 22x50 cross-bar 22 • 12 bit for video: 8 bit data + overflow • Clock Frequency: 54 MHz • 2 instructions per sample period for HDTV, 4 instructions per sample period for TV 104
  105. © DHBK 2005 Philips VSP-2 Fixed Point Video • 1.15 M Transistors • 5W dissipation • 54 MHz clock frequency • 208 pin 105• Introduced in 1994
  106. © DHBK 2005 Sony Graphics Engine • Playstation 3 q Status: prototype in 2001 q 287.5 MTOR q 256 Mbit on-chip embedded DRAM q 2000-bit wide internal bus q 462 mm2 q 180 nm CMOS 106
  107. © DHBK 2005 Chương 7: Các bộ vi xử lý trên thực tế • General purpose microprocessors q Intel 80x86 þ Xu hướng phát triển • Microcontrollers q Vi điều khiển của Motorola q Họ vi điều khiển 8051 q Họ vi điều khiển AVR q PSOC q Xu hướng phát triển • Digital signal processors q Texas Instruments q Motorola q Philips þ Xu hướng phát triển 107
  108. © DHBK 2005 Trends for DSP processors • No new generations that replace old generations, but multiple co-existing architecture lines • Word length application dependent q Automotive: 16-bit fixed point (e.g. C2x) q Speech: 32-bit floating point (e.g. C30) q Audio: 24-bit fixed point (e.g. MC56K) q Telecommunications: 16-32 bit fixed point (e.g. C5x, C6x) q Video: 12-32 bit fixed point (e.g. C8x) • Single architecture line is whole family q different memory & on-chip peripherals q for embedded applications (cf. microcontrollers) 108
  109. © DHBK 2005 Trends for DSP processors • Deterministic behavior q no caches, no virtual memory, but on-chip RAM banks q no out-of-order execution q delayed branch prediction • Increasing address space: 12 -> 32 • Multiple functions on single chip: CPU, FPU, multiple RAM banks, ACUs, loop controller, ADC, DAC, PWM, serial interfaces, • Often provisions for parallel processing 109