FMUSER Wirless Transmit Video And Audio More Easier !

[email protected] WhatsApp +8618078869184
Language

    Three data transmission modes of external equipment exchange information based on 8051 single-chip microcomputer

     

    "There are usually several ways to exchange information between MCU CPU and external equipment: unconditional transmission, query transmission and interrupt transmission. We take the interface between MCU and micro printer as an example to describe these three methods. Suppose the user wants to print three data, which are stored in the internal data memories 10h, 11h and 12h of the single chip microcomputer. 8051 uses the parallel port P2 to exchange data with the parallel data port dB of the micro printer. (1) Unconditional transmission mode There is no contact signal in this data transmission mode, that is, the CPU always thinks that the printer is "ready" at any time. In this transmission mode, only the instruction of sending data to P2 needs to be added in the program, and the data transmission can be realized. However, this data transmission method has a fatal weakness, and the data is easy to be lost. This is because the speed of the CPU is quite fast, while the speed of the printer is relatively slow. As a result, the CPU has sent multiple data within the time when the printer prints one data. (2) Query transmission mode Query transmission, also known as conditional transmission, is that in this transmission mode, whether input or output, the computer is the active party. For the correctness of data transmission, before transmitting data, the computer should first query whether the external equipment is in the "ready" state; For the output operation, it is necessary to know whether the peripheral has processed the data output by the computer last time. Only by querying and making sure that the peripherals are in the "ready" state can the computer send instructions to access the peripherals and realize data exchange. Generally, only one binary code is required for status information to represent "ready" and "not ready". Therefore, only one D trigger in the interface can be used to save and generate status information. For example, "ready" is represented by D trigger q = 1“ "Not ready" is represented by q = 0. Query method process: query, that is, read the "ready" pin. If the pin is in the "ready" state, carry out data transmission. If the pin is in the "not ready" state, continue to query until the pin is in the "ready" state, and then carry out data transmission. In our example, a pin named busy can be added to the printer. Before the printer starts printing a data, make the pin high. After printing a data, make the pin low, and the initialization of the pin is 0. We connect the pin with the pin INT0 of the single chip microcomputer. Before sending a data, the single chip microcomputer will query whether the pin status is 0. If it is 0, it will send data. Otherwise, continue to query until the pin is 0, and then send data. See the example: After power on, the busy pin of the printer is 0. The MCU runs the first instruction to set the starting point of the print buffer. The MCU runs the second instruction to set the print bytes. The MCU runs the third instruction, reads the status of the busy pin of the printer, and judges whether the status is 0. If it is 0, the first data is sent, and the printer sets the busy pin to 0 to start printing. The single chip microcomputer runs the next instruction and adds 1 to the print buffer to send the second data next time. Judge whether the data has been sent or not, prepare to send the next data, and read the status of printer pin busy. Pin busy status is 1, continue to query. Pin busy status is 0, send the second data, add 1 to the print buffer, so that the third data can be sent next time, judge whether the data has been sent or not, prepare to send the next data, add 1 to the print buffer, and judge whether the data has been sent. After all three data are sent, the program ends. It can be seen that the disadvantage of this method is that there needs to be a waiting process. Especially when data transmission is carried out continuously, since the working speed of peripherals is much slower than that of CPU, CPU has to wait a long time for the next transmission after completing one data transmission. During the waiting process, the CPU cannot perform other operations, so the efficiency is relatively low. An effective way to improve the CPU efficiency is to use interrupt mode. (3) Interrupt mode As we mentioned just now, the unconditional transmission mode is unreliable, and the query transmission mode wastes CPU time. In order to solve this problem, the MCU sets another transmission mode - interrupt mode. The so-called interrupt means that when the CPU of the central processing unit is processing something, an external event occurs and requests the CPU to handle it quickly. Therefore, the CPU temporarily interrupts the current work and turns to deal with the event; After interrupt service processing, return to the original interrupted place and continue the original work. This process is called interrupt. The component realizing this function is called interrupt system, and the request source generating interrupt is called interrupt source., Read the full text, the original title: how much do you know about the three data transmission modes of 8051 Single Chip Microcomputer? The source of the article: [micro signal: Mouser-Community, WeChat official account: Kaga Fuyoshii electronics] welcome to add attention! Please indicate the source of the article“

     

     

     

     

    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