FMUSER Wirless Transmit Video And Audio More Easier !

[email protected] WhatsApp +8618078869184
Language

    What should I do when the data of a single-chip of multiple modules needs to be processed?

     

    Here, uses an actual example, a small mistake of the primary engineer, or a detractive correction that is often going to be taken. I hope I can help everyone, the writing is not good, there are many people who have a narrative in the article. This article I don't want to say the programming normative thing. If you want your program file, you can do the least intuitive looks beautiful, readable, and recommends looking for Huawei's "C Language Programming Specification". I just want to say what we should do when our single-chip of data is required to process, similar to "multitasking"? The background is this, and an engineer began to arrange an engineer in September to start the electric vehicle to exchange the charging pile, the mechanical design part is responsible for the company's mechanical structure department. Electronic part of the charging pile is generally divided into X part (for resources), resistance touch screen (RS232), M1 card read-write (RS232), power meter (RS485), voice prompt (SPI), power switch (relay IO), communication interface (RS485, CAN). The process of engineers did very hard work, and the period was also difficult, changed a lot of versions. In June, the charging pile was finally set. Let's check it out, and the results can't handle the touch screen when you read your card. When you play the voice, you can't handle your card. The voice play cannot be interrupted or jumped. Anyway, all events must be a pressed class, once the error requires more Execute, wait, and even recall. How can an engineer working more than 3 years? Take a look at the program! I don't want it, I am scared! The entire program is not logical, and a line will write down ... While (1) {// power-on enter the main program or trigger the touch screen // Play prompt voice delay (); // Wait for playback // read the M1 card information delay (); // Wait for the card data to return // Play Tips Voice delay (); // Waiting for the playback // M1 card data interaction, determine the next step and prompt delay (); // Waiting for the data processing over ............} Here, this engineer basically does not have any overall concepts for its own products, or how the actual effects developed to design it will be unclear. He made a few questions that we were most taboo in procedure: 1. DELAY (dead, etc.) This function is only used during a function of the laboratory. Whether it is the primary loop whiling in the actual product development, or is also an interrupt service program. It is absolutely not available. 2, the logical relationship between the individual submodules of the product design is too strong, for example, you must wait for the broadcast to read the card to enter the next step. We speak, only the logical relationship between the various event processing modules is weakened in product design, and it can be more flexibly processed. For example: Two events A and B, if the program is developed, the essential condition of the B event is developed, and the trigger of the B event must wait for A event. Conversely, if the A event is a special case of B event processing, then the program has become more flexible. 3, did not take into account the architecture of a single-chip machine itself, each event will exclusively CPU kernel. When multiple task modules exist, we should distinguish between all events, we should subgressive, and sub-event real-time requirements. Waiting for the treatment. So what should we deal with such problems or encounter similar items? Several recommendations: 1. Divide the hardware system to stand-alone units alone into the underlying drive function and the application function, and the function should have parameters and return values, where the return value is necessary. How to measure this type of function? Such functions can be portable, as long as one .h file and a .C file can be placed in any project. For example: voice play, M1 card, 485 processing, etc. 2. Time to evaluate all the functions in 1, and two in the evaluation point. One is the execution time t of the function, the second is the time T of the periodic occurrence of the function, and one of the most basic conditions is T< T, ideal should be T<< T. 3. Establish a centralized logic handler, which is scheduled to each of the functions in this function. This function is equivalent to system scheduling in the embedded system. This scheduling is the scheduling of all event processing in the entire hardware logic, its purpose is to complete a process, but never rely on any event necessary to process. This weakens the logical relationship between the events mentioned in Question 2, and it is very flexible to proceed, so that each relationship is not necessary. 4. In order to ensure the normal implementation of the previous content, the cycle of various events needs to establish a necessary time management function. The basis of the time function is generally completed by an internal timer interrupt, and the interrupt cycle is generally considering 5 -10 ms. According to the actual needs, the N timer interrupts are defined as a period TT for an event process. This cycle should ensure that all T that can occur most harsh conditions, and ensure that TT < T. 5, there is also an exception, some incidents with high real-time requirements should be done with interrupts. The processing of the interrupt processing function should be as short as possible, and see 2. , Read the full article, original title: What should I do when the data needs to be handled by a single-chip of multiple modules? Article Source: [Micro Signal: Mouser-Community, WeChat public number: Jiaoheng Fuyi Ai 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