1 / 23

Microprocessor and Interfacing 261313

Microprocessor and Interfacing 261313. PIC Code Execution II. http://www.e-cpe.org/moodle. Memory Mapped I/O (MMIO). MOVWF 06. W. B0 B1 B2 B3 B4 B5 B6 B7. PIC. MOVLW XX MOVWF 06. PIC-C Trick: Port-level Control. #byte b_port = 6 // mem pointer

howard
Download Presentation

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 (MMIO) MOVWF 06 W

  3. B0 B1 B2 B3 B4 B5 B6 B7 PIC MOVLW XX MOVWF 06

  4. PIC-C Trick: Port-level Control #byte b_port = 6 // mem pointer b_port = 0xff; // drive port b

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

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

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

  8. The 3 Gig not 4 Gig RAM Problem 4 GB?? 3 GB?? 32 bit

  9. The 3 Gig not 4 Gig RAM Problem Address Space ~1 GB 3 GB Video Card BIOS PCI Bus RAM (4 GB)

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

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

  12. Machine Code Generation Methods

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

  14. Writing Machine Code ENIAC

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

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

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

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

  19. File Register Map

  20. Status Register (Address 03)

More Related