SlideServe
Menu
Préférences
© SlideServe · v2026

Memory Organization II

rashad avatar
19 diapositives · 394 Views · Oct 12, 2014

Memory Organization II. Microprocessor and Interfacing 261214. PIC Flash Memory Segments. 12. 10. 0. 2K. 2K. 2K. 2K. PIC’s RAM Banking. Instruction Format. f = 7 bit Maximum memory = 2^7 = 128 Bytes. PIC 16F877 has 512 bytes of RAM: How do we access all of it?. 7. 0.

Memory Organization II - slide 1
01 / 19Memory Organization II
1 / 17

Télécharger la présentation

Memory Organization II
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. Memory Organization II Microprocessor and Interfacing261214

  2. PIC Flash Memory Segments 12 10 0 2K 2K 2K 2K

  3. PIC’s RAM Banking

  4. Instruction Format

  5. f = 7 bit Maximum memory = 2^7 = 128 Bytes

  6. PIC 16F877 has 512 bytes of RAM: How do we access all of it? 7 0 STATUS (F# 0x03) Bit 5-6 (RP0,RP1) in STATUS are used for RAM Page selection Total Memory becomes 2^9 = 512 Bytes

  7. 7 0 Creating a 9 bit RAM address 13 7 6 0 OPCODE f (File#) STATUS 8 6 0 9 Bit RAM Address

  8. This code should now make sense

  9. RAM location First 32 bytes of every page are reserved. Except on pages 3 and 4 User RAM space. Last 16 Bytes are mirrored

  10. The big picture: where the bits are 6 5 7 0 4 3 7 0 Bit 5-6 (RP0,RP1) in STATUS are used for RAM Page selection Bit 3-4 in PCLATH are usedfor memory access

  11. 2. เร่ง Memory Operations ด้วยIndirect Addressing

  12. ทำไมต้องมี Indirect Addressing? สมมุติว่าเรามี Array ในภาษา C ดังนี้ int value[8]; หลังจากที่ใช้งานมันไปสักพักเราอยาก Clear ค่าใน array ทั้งหมดมีค่าเป็น 0 Code จะเป็นอย่างไรถ้าเราไม่สามารถใช้ตัวแปรอ้างตำแหน่งใน Array เช่นห้ามใช้ value[i] = 0;

  13. With indirect addressing For (i=0 ; i<8 ; i++) { value[i] = 0; } Without indirect addressing Value[0] = 0; Value[1] = 0; Value[2] = 0; Value[3] = 0; Value[4] = 0; Value[5] = 0; Value[6] = 0; Value[7] = 0;

  14. Opcode File PIC’s Indirect Addressing

  15. 7 0 Creating a 9 bit indirect RAM address 7 0 FSR (File #4) 8-bit address STATUS 8 7 0 9 Bit RAM Address

  16. Example: clear RAM locations 0x20 – 0x27 (8 Bytes) 0x20 = 0b0010 0000 0x27 = 0b0010 0111

  17. The big picture: where the bits are 7 6 5 0 Bit 5-6 (RP0,RP1) in STATUS are used for RAM Page selection 4 3 7 0 Bit 7 (IRP) in STATUS is used for indirect Addressing Bit 3-4 in PCLATH are usedfor memory access

  18. Indirect Addressing Ex Find the sum of values in RAM address 0x22-0x25 and store at address 0x21 ; 0x21 = sum result variable clrf 0x21 ; 0x22 - 0x25 = input numbers to be summed movlw 4 movwf 0x22 movlw 3 movwf 0x23 movlw 2 movwf 0x24 movlw 1 movwf 0x25 End Result: Sum = Value1+Value2+Value3+Value4