FMUSER Wirless Transmit Video And Audio More Easier !

[email protected] WhatsApp +8618078869184
Language

    8051 What are the ways of single-chip data transfer?

     

    Single chip microcomputer CPU and external device exchange information typically have the following ways: unconditional transmission, query transmission mode, and interrupt delivery. We describe these three ways as a single-chip and micro printer interface. Assume that the user wants to print three data, these three data are saved in the internal data stores 10h, 11h, and 12h of the microcontroller, and 8051 is exchanged with the parallel data port DB of the micro printer with the parallel printer. (1) unconditional transmission There is no contact signal in this data transfer mode, that is, the CPU always believes how the printer is in a state in "ready". This transmission mode only needs to be added to the data to P2 in the program, and data transmission can be implemented. However, this data transfer method has a fatal weakness, and the data is easily lost, because the speed of the CPU is quite fast, and the speed of the printer is relatively slow, the result is that the CPU has been delivered within the time of the printer prints a data. Multiple data. (2) Query transmission method The query transfer is also known as the conditional transfer is in this transmission mode, whether it is input or output, is a computer as an active party. For the correctness of the data transfer, the computer must first query whether the external device is in a "ready" state before transmitting data; for output operations, it is to know if the peripheral has completed the data output from the last computer. Only by query, it is aware of the "ready" state, and the computer can send an instruction to access the peripheral to implement data exchange. Status information typically only requires one binary code to indicate "preparing" and "not ready" two states, so only one D trigger can be saved and generated in the interface. For example, "ready" has a D trigger Q = 1 means; "Not ready" is represented by Q = 0. Query method process: query, ready to read "ready" pins, if the pin is "ready" status, perform data transfer, if the pin is "not ready" status, continue to query until this pin For "ready" status, data transfer is performed. In our example, you can add a pin called Busy on the printer. Before the printer starts printing a data, the pin is high. After printing a data, the pin is low, the pin is low. The initialization of the foot is 0. We connect this pin to the pins INT0 of the microcontroller, and the single-chip is queried by 0, if it is 0, it transmits data. Otherwise, continue to query until this pin is 0, then send data, please see example: The BUSY pin of the printer is 0 after power-on. The single-chip runs the first instruction and sets the starting point of the print buffer. The single-chip runs the second instruction and sets the print byte. The single chip runs the third instruction, read into the state of the printer busy pin, and determines whether the status is 0. For 0, the first data is sent, and the printer sets the BUSY pin 0 to start printing. Single chip runs the next instruction, the print buffer plus 1, so that the second data can be sent next time. The determination data has been made, not finished, ready to send the next data, read the status of the printer pin busy. The pin busy status is 1, continue to query. The pin busy state is 0, sends the second data, the print buffer plus 1, so that the next time can send the third data, determine if the data has been made, not finished, ready to send the next data, print buffer plus 1. Judging whether the data has been made. All three data are sent, and the program ends. It can be seen that the disadvantage of this approach is that there is a wait process, especially when continuous data transmission, because the peripheral operating speed is much slower than the CPU, so the CPU is waiting for a long time after completing the data transfer. Time can be carried out next time. In the waiting process, the CPU cannot do other operations, so the efficiency is relatively low, and an effective way to improve CPU efficiency is to use interrupt mode. (3) Interrupt mode Just now, there is no conditional transfer method is unreliable, and the time to query the transmission method is too wasteful. In order to solve this problem, the microcontroller sets another transmission mode - interrupt mode. The so-called interruption means that the central processor CPU is handling something, an externally occurs, requested the CPU to quickly deal with, so the CPU temporarily interrupts the current job, transfer the process of the process; interrupt service processing After returning to the place where the original is interrupted, continue to work, such a process is called interrupt. The components of this function are referred to as an interrupt system, and the source of the interrupt is generated is called the interrupt source. Read more

     

     

     

     

    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