microprocessor and interfacing 261313 n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Microprocessor and Interfacing 261313 PowerPoint Presentation
Download Presentation
Microprocessor and Interfacing 261313

Loading in 2 Seconds...

play fullscreen
1 / 19

Microprocessor and Interfacing 261313 - PowerPoint PPT Presentation


  • 104 Views
  • Uploaded on

Microprocessor and Interfacing 261313. PIC Code Execution II. http://www.e-cpe.org/moodle. Memory Mapped I/O. MOVWF 06. W. ข้อดีข้อเสียของ Memory Mapped I/O. ไม่ต้องออกแบบคำสั่งเฉพาะสำหรับ I/O. I/O Operation. MOVWF 06. MOVWF 21. Mem Operation. ข้อดีข้อเสียของ Memory Mapped I/O.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Microprocessor and Interfacing 261313' - helen


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
microprocessor and interfacing 261313

Microprocessor and Interfacing261313

PIC Code Execution II

http://www.e-cpe.org/moodle

memory mapped i o1
ข้อดีข้อเสียของ Memory Mapped I/O

ไม่ต้องออกแบบคำสั่งเฉพาะสำหรับ I/O

I/O Operation

MOVWF 06

MOVWF 21

Mem Operation

memory mapped i o2
ข้อดีข้อเสียของ Memory Mapped I/O

ลดความซับซ้อนของ CPU ทำให้ราคาถูกลง และ ออกแบบได้ง่าย

YES

NO

memory mapped i o3
ข้อดีข้อเสียของ Memory Mapped I/O

128 Bytes

I/O Mapped

แต่ก็ต้องเสียตำแหน่งใน Memory ไปบางส่วน

240 Bytes

Available RAM

memory mapped i o4
ข้อดีข้อเสียของ Memory Mapped I/O

ถ้า Memory และ I/O ใช้ data bus เดียวกัน อาจทำให้ Memory Access ช้าลง

Slow

I/O Operation

MOVWF 06

MOVWF 21

Fast

Mem Operation

port mapped i o
Port Mapped I/O
  • มี I/O Bus แยกจาก Memory Bus
  • ใช้คำสั่งแยกกัน
options
Options
  • Write Machine Code
  • Write Assembly Code
  • Use a High-Level Compiler
drawbacks of high level compilers
Drawbacks of High-Level Compilers
  • Poor optimization
  • Non-Optimal Hardware Utilization
poor optimazation
Poor Optimazation

.................... while (1) {

.................... output_b(i);

001A: BSF 03.5

001B: CLRF 06

001C: BCF 03.5

001D: MOVF 21,W

001E: MOVWF 06

poor optimization ex 2
Poor Optimization Ex 2

.................... int i;

.................... i = 5;

000D: MOVLW 05

000E: BCF 03.5

000F: MOVWF 21

.................... do {

.................... i--;

0010: DECF 21,F

.................... } while (i>0);

0011: MOVF 21,F

0012: BTFSS 03.2

0013: GOTO 010

non optimal hw utilization
Non-Optimal HW Utilization

RLF

Equivalent Program in ASM

BCF 03.5

MOVF 0x21,W

MOVWF 06

RLF 0x21, F

GOTO 0x1A