FMUSER Wirless Transmit Video And Audio More Easier !

[email protected] WhatsApp +8618078869184
Language

    How do the single chip perform code commands, how to assign a single-piece MCU memory?

     

    Detailed process executing instructions microcontroller SCM process execution of the program, we actually perform the process of programming. I.e., instruction by instruction process. A computer execute each instruction can be divided into three stages. That analysis command fetch ----- ----- execute the instructions. Task instruction fetch is: OK instruction read from the program memory appears based on the value of the program counter PC, to the instruction register. Analysis of the task instruction stage: instruction register after decoding the instruction operation code removed, the instruction analyzing properties. The instruction requires an operand, the operand address to find. The process computer is actually executing the program instruction by instruction during the foregoing operation is repeated until it encounters the stop command wait instruction can be recycled. When a general computer work, and the first data into the program through the external device through the input interface circuit and the data bus to the memory, one by one and then fetched for execution. The program of the microcontroller we have previously generally cured by the writer in the chip or external program memory. Thus one can start executing instructions. Below we will give you an example to illustrate the process of execution of instructions: When turned on, the program goes calculator PC 0000H. The microcontroller then enters the automatic procedure performed at the timing circuit action. Process is actually executed instruction is fetched (taken out instructions stored in a memory in advance in phase) and execute instructions (instruction execution and analysis) of the cycle. For example, executes instructions: MOV A, # 0E0H, which machine code is "74H E0H", the function of this instruction is the operand into the accumulator E0H, 0000H unit has been stored 74H, 0001H E0H unit has been stored. When the device starts running, first into the fetch stage, the order is: The contents of a program counter (in this case 0000H) to the address register; 2 program counter content incremented (changed 0001H); The contents of the address register 3 (0000H) to the memory through the internal address bus to the memory address decoding circuit with the address 0000H of the cell is selected; 4 CPU controls the read line is active; 5 under control of a read command to the contents of the selected memory cell (in this case should be 74H) onto the internal data bus, as is the fetch stage, the contents of which the data bus is supplied to the instruction register. Thus, the fetch stage is completed, the instruction into the decode stage and execute analysis. Since this into the contents of the instruction register is 74H (opcode) to the decoder decodes the microcontroller will know that the instruction is a number you want to accumulator A, which is at a number of the code The storage unit. Therefore, executing the instruction must also take the data (E0H) from the memory to the CPU, ie, the second byte is taken in the memory. The procedure is very similar to the fetch stage, but this time the PC is to 0001H. Timing instruction decoder binding member, the series of operations to produce micro-opcode 74H, 0001H of the digital E0H removed from the unit. Because the number of required instructions are made to the accumulator A, is extracted via an internal digital data bus A into the accumulator, rather than into the instruction register. So far, the execution of an instruction is completed. Microcontroller PC = 0002H, PC each time the CPU to fetch or memory access automatically increased by 1, and the microcontroller proceeds to the next fetch stage. This process is repeated it, until it receives a pause command pause or wait instruction cycle. CPU is such a one to execute instructions to complete all required functions. For a mcu, the time described the performance will tell sram, flash size capacity, for starters, and it will not bother to consider these things, to get things only. In actual fact, these quantities are very important, think about it, why the code can be run, how much the amount of code, int, short, and so the type of variable definitions of exactly how the distribution and storage of these problems and have inner-inch relation. First microcontroller and the memory may be size into ram rom, will not be explained here the difference between the ram and rom, we can be equivalent to the flash and sram, wherein the definition of available sram and flash, which flash off data to save power, the sram can not, but the execution speed faster than the sram flash, the microcontroller program may be divided into code (code memory), RO-data (read-only data storage area), RW-data ( read and write data storage area) and ZI-data (zero initialized data area). In the MDK compiler we can observe four values ​​in the code amount, as shown in Figure 1: figure 1: Wherein RO-data and code stored in the flash, so the sum of both is needed flash microcontroller space allocated to them (and equal to the generated code size .bin file), and further RW-data ZI-data stored in the sram, the same as the sum of both microcontrollers need sram space allocated to them. In addition, we inevitably think of the stack area (stack), the relationship heap (heap), global area (static area) (staTIc), code words constant area and the program code area and introduced above, RO-data and the like. 1, the stack area (stack): allocated by the compiler automatically released, the stored function parameters, local variables, and the like. Operate similarly to a stack data structure. These values ​​are read, then the stack should be included in the RW-data (read and write data storage area), i.e. the microcontroller sram. 2, the heap area (heap): generally released assigned by the programmer, if the programmer does not release at the end of the program may be recovered by the OS. It will be appreciated that these are also included in the microcontroller sram. 3, the global zone (quiescent zone) (staTIc): global variables and static variables are stored in one and initialized global and static variables in an area, uninitialized global variables and static variables uninitialized adjacent another piece of the region, after the end of the program released by the system. These data are readable and writable, and a stack, heap, as is contained in the sram. 4, literals area: constant string is placed here. The data is read-only, partitioned RO-data (read-only data storage area), were included in the flash. 5, the program code area: binary code stored function body, it is conceivable also be included in the flash, because for MCU, when it re-power, the code will continue to run, and will not disappear, so in flash memory. In summary, memory allocation of MCU nearly so, and no mention of the storage space where the address corresponding to the flash and sram, which will be mentioned later! If wrong, please correct me. , Reading the full text, the technology area MYBATIS Dynamic SQL Detailed Design the HDB3 encoder in the data transmission system with VHDL language How does the bare metal program drive hardware? What is the seniors say? Typical examples of object-oriented programming SOC principles Introduction to Java Common Development Tools for Embedded Development

     

     

     

     

    List all Question

    Nickname

    Email

    Questions

    Our other product:

    Professional FM Radio Station Equipment Package

     



     

    Hotel IPTV Solution

     


      Enter email  to get a surprise

      fmuser.org

      es.fmuser.org
      it.fmuser.org
      fr.fmuser.org
      de.fmuser.org
      af.fmuser.org ->Afrikaans
      sq.fmuser.org ->Albanian
      ar.fmuser.org ->Arabic
      hy.fmuser.org ->Armenian
      az.fmuser.org ->Azerbaijani
      eu.fmuser.org ->Basque
      be.fmuser.org ->Belarusian
      bg.fmuser.org ->Bulgarian
      ca.fmuser.org ->Catalan
      zh-CN.fmuser.org ->Chinese (Simplified)
      zh-TW.fmuser.org ->Chinese (Traditional)
      hr.fmuser.org ->Croatian
      cs.fmuser.org ->Czech
      da.fmuser.org ->Danish
      nl.fmuser.org ->Dutch
      et.fmuser.org ->Estonian
      tl.fmuser.org ->Filipino
      fi.fmuser.org ->Finnish
      fr.fmuser.org ->French
      gl.fmuser.org ->Galician
      ka.fmuser.org ->Georgian
      de.fmuser.org ->German
      el.fmuser.org ->Greek
      ht.fmuser.org ->Haitian Creole
      iw.fmuser.org ->Hebrew
      hi.fmuser.org ->Hindi
      hu.fmuser.org ->Hungarian
      is.fmuser.org ->Icelandic
      id.fmuser.org ->Indonesian
      ga.fmuser.org ->Irish
      it.fmuser.org ->Italian
      ja.fmuser.org ->Japanese
      ko.fmuser.org ->Korean
      lv.fmuser.org ->Latvian
      lt.fmuser.org ->Lithuanian
      mk.fmuser.org ->Macedonian
      ms.fmuser.org ->Malay
      mt.fmuser.org ->Maltese
      no.fmuser.org ->Norwegian
      fa.fmuser.org ->Persian
      pl.fmuser.org ->Polish
      pt.fmuser.org ->Portuguese
      ro.fmuser.org ->Romanian
      ru.fmuser.org ->Russian
      sr.fmuser.org ->Serbian
      sk.fmuser.org ->Slovak
      sl.fmuser.org ->Slovenian
      es.fmuser.org ->Spanish
      sw.fmuser.org ->Swahili
      sv.fmuser.org ->Swedish
      th.fmuser.org ->Thai
      tr.fmuser.org ->Turkish
      uk.fmuser.org ->Ukrainian
      ur.fmuser.org ->Urdu
      vi.fmuser.org ->Vietnamese
      cy.fmuser.org ->Welsh
      yi.fmuser.org ->Yiddish

       
  •  

    FMUSER Wirless Transmit Video And Audio More Easier !

  • Contact

    Address:
    No.305 Room HuiLan Building No.273 Huanpu Road Guangzhou China 510620

    E-mail:
    [email protected]

    Tel / WhatApps:
    +8618078869184

  • Categories

  • Newsletter

    FIRST OR FULL NAME

    E-mail

  • paypal solution  Western UnionBank OF China
    E-mail:[email protected]   WhatsApp:+8618078869184   Skype:sky198710021 Chat with me
    Copyright 2006-2020 Powered By www.fmuser.org

    Contact Us