1 / 19

Microprocessor and Interfacing 261313

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.

helen
Télécharger la présentation

Microprocessor and Interfacing 261313

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Microprocessor and Interfacing261313 PIC Code Execution II http://www.e-cpe.org/moodle

  2. Memory Mapped I/O MOVWF 06 W

  3. ข้อดีข้อเสียของ Memory Mapped I/O ไม่ต้องออกแบบคำสั่งเฉพาะสำหรับ I/O I/O Operation MOVWF 06 MOVWF 21 Mem Operation

  4. ข้อดีข้อเสียของ Memory Mapped I/O ลดความซับซ้อนของ CPU ทำให้ราคาถูกลง และ ออกแบบได้ง่าย YES NO

  5. ข้อดีข้อเสียของ Memory Mapped I/O 128 Bytes I/O Mapped แต่ก็ต้องเสียตำแหน่งใน Memory ไปบางส่วน 240 Bytes Available RAM

  6. ข้อดีข้อเสียของ Memory Mapped I/O ถ้า Memory และ I/O ใช้ data bus เดียวกัน อาจทำให้ Memory Access ช้าลง Slow I/O Operation MOVWF 06 MOVWF 21 Fast Mem Operation

  7. Port Mapped I/O • มี I/O Bus แยกจาก Memory Bus • ใช้คำสั่งแยกกัน

  8. Machine Code Generation Methods

  9. Options • Write Machine Code • Write Assembly Code • Use a High-Level Compiler

  10. Writing Machine Code ENIAC

  11. Drawbacks of High-Level Compilers • Poor optimization • Non-Optimal Hardware Utilization

  12. 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

  13. 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

  14. Non-Optimal HW Utilization RLF Equivalent Program in ASM BCF 03.5 MOVF 0x21,W MOVWF 06 RLF 0x21, F GOTO 0x1A

  15. File Register Map

  16. Status Register (Address 03)

More Related