FMUSER Wirless Transmit Video And Audio More Easier !

[email protected] WhatsApp +8618078869184
Language

    What questions need to pay attention to when processing a PIC microcontroller?

     

    Interrupt system in single chip microcomputer is the best way to solve emergencies and multitasking real-time processing, and the application of the interruption technology is a must-have to qualified electronic engineers. A significant difference between the PIC and the 51 Series MCU is that the PIC has only one interrupt entry address (for 04h), and 51 has multiple interrupt sources. In this regard for the PIC, no matter what the interrupt program will automatically transfer the program statement of 04H, in order to distinguish it, it must be determined and transferred to the corresponding interrupt by judging the interrupt flag in the interrupt service program. Service programs. When an interrupt occurs, the breakpoint address is first pressed into the hardware stack, and some parameters of the field must be saved by software, and the registers that must be saved include W registers, the high byte of the program register PCLATH and status flag registers, etc., others The registers used in the interrupt service program and the main program must also be saved, otherwise the unpredictable error may be caused. If you need to save too much on-site parameters, you will come to two draws: First, the waste of RAM resources, especially for RAM resource-tight applications; the second is to increase the runtime of interrupt service procedures, resulting in real-time system Deterfa, even affect the implementation of normal functions, such as the measurement of the high-speed pulse width with the CCP module in the microcontroller, the shorter the running time of the interrupt service program, otherwise the capture chance will cause errors. It is therefore recommended to use the registers used in the main program in the interrupt service program to set the registers in the interrupt to dedicated, so that the protection and recovery procedures of these registers are eliminated and the chances of errors are reduced. Another note is that in the interrupt service program, try to avoid the use of multi-stage nested subroutines, I have encountered such problems in the actual application, and I can't find the root of the problem in a long time. The hardware stack of the PIC mandarr machine is 8, if a subroutine with a 6-level neck is called in the main program, and when the main program executes the innermost subroutine, the 8-level stack has been used to go to 6 Level, if an interrupt is just happened, the breakpoint is pressed into the stack. At this time, seven addresses are saved in the stack, and if there is a secondary nested subroutine in the interrupt service program, the stack will overflow. This must cause the program to not return to the original address correctly, causing the program to run. Since the occurrence of this situation needs to meet certain conditions, it is interrupted when the main program is running to the innermost subroutine, and therefore has a large uncertainty. In the product development and development and commissioning phase, there may be no problems at all, When the product was exposed when the product was used for a long time, it has caused a very bad impact on the image of the product in the user's mind, and the loss has not been saved. Therefore, as a developer should pay special attention. Another problem is also worth noting, just avoid opening a global interrupt permission bit in the interrupt service program, because the PIC microcontroller does not support interrupt nesting, otherwise, after executing an interrupt service program has not ended, enter another interrupt service program, The on-site parameters of the previous interrupt will be destroyed, resulting in a unpredictable error. Source; 21IC, read full text

     

     

     

     

    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