FMUSER Wirless Transmit Video And Audio More Easier !

[email protected] WhatsApp +8618078869184
Language

    AT89C52 Single Chip Microcomputer Design of Eight Road Voltage Meter

     

    Eight-circuit voltmeter C procedure / * Using the AT89C52 single-chip microcomputer, 12MHz crystal, P0-port read into the AD value, P2 port as AD control, use common Yang LED digital tube P1 port output segment code, P3 scan, the highest bit indicator channel (0-7). * / #include "reg52.h" // 52 series single-chip definition file #include "intrins.h" // call _nop_(); delay function # Definead_conp2 // AD Control Port # DefineadDataP0 // AD data is included in the entry # definedISDataP1 // Display data segment code output port # DefineucharunsignedChar // No symbolic characters (8 digits) # defineuintunsignedint // No symbol integer (16 digits) sbitale = p2 ^ 3; // Lock address control bit SBitStart = P2 ^ 4; // Start a transition bit SBITOE = P2 ^ 5; // 0809 Output Data Control Bit SBiteoc = P3 ^ 7; // Conversion end flag SBITDISX = DISDATA ^ 7; // LED decimal point Ucharcodedis_7 [11] = {0xc0, 0xF9, 0XA4, 0X999, 0X92, 0X82, 0XF8, 0X80, 0X90, 0xFF}; / * The common sun seven LED segment code table "0" "1" "2" "3" "4" "5" "7" "8" "9" "No" * / Ucharcodescan_con [4] = {0xFE, 0xFD, 0xFb, 0xF7}; // Tourum scan control word Uchardataad_data [8] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; // Define 8 Data Memory Unit UintDataDis [5] = {0x00, 0x00, 0x00, 0x00, 0x00}; // Define 4 display data units, 1 data temporary unit // // / ******** 1 millisecond delay subunies ********** / DELAY1MS (UINTT) { Uinti, J; For (i = 0; ifor (j = 0; J "120; J ++) ; } // // / *********** Display Scan Subfix ********** / SCAN () { Uchark, n; INTH; DIS [3] = 0x00; // The terminal value is 0 For (n = 0; n "8; n ++) / / 8 data each time { DIS [2] = ad_data [n] / 51; // measured value converted to three BCD code, up to 5.00V DIS [4] = ad_data [n]% 51; // Whealth Dis [4] = DIS [4] * 10; // Calculate the first digit DIS [1] = DIS [4] / 51; // DIS [4] = DIS [4]% 51; // Dis [4] = Dis [4] * 10; // Calculate the second bit of the decimal DIS [0] = DIS [4] / 51; // For (h = 0; h "500; h ++) // Each channel value display time control (about 1 second) { FOR (k = 0; k "4; k ++) // four LED scan control { DISDATA = DIS_7 [DIS [k]]; IF (k == 2) {DISX = 0;} P3 = scan_con [k]; delay1ms (1); p3 = 0xFF; } } DIS [3] ++; // channel value plus 1 } } // // / ******* 0809AD conversion subunies *********** / Test () { Ucharm; Uchars = 0x00; AD_CON = S; For (m = 0; m "8; m ++) { Ale = 1; _nop _(); _nop _(); ale = 0; // Convert channel address latch START = 1; _nop _(); _nop _(); start = 0; // Start conversion command _nop _(); _nop _(); _NOP _(); _nop _(); // delay 4 microseconds While (EOC == 0); // Waiting for the end of the conversion OE = 1; ad_data [m] = addata; OE = 0; s ++; ad_con = s; // Take AD value, address plus 1 } AD_CON = 0x00; // Control reset } // // / ************* Main function **************** / Main () { P0 = 0xFF; // Initializing port P2 = 0x00; P1 = 0xFF; P3 = 0xFF; While (1) { SCAN (); // Show 8 channel values ​​once Test (); // Measurement conversion once } } // // //*********************end************************** //, read the full story

     

     

     

     

    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