FMUSER Wirless Transmit Video And Audio More Easier !

[email protected] WhatsApp +8618078869184
Language

    51 SMS SCON Register and C Program Analysis

     

    "It feels good to use a computer to control a single chip microcomputer and then control relays and other peripherals. How can it be realized? Step by step. MCU serial port communication, that is, the communication between MCU and computer, to realize, we should understand some basic concepts. (1) Before implementation, please make sure that the serial port is normal. I have done serial port operation before and can't control it after burning. Later, I found that there is an exclamation mark in the serial port in the device manager and there is a problem with the driver. It may be caused by the failure to plug in the development experimental board or the replacement of a USB port (I use serial port to USB, laptop) (2) Serial port initialization, in this regard, it is best to have relevant books to understand the digestion timer and interrupt, so that the operation is easy. One. Set the working mode of the serial port: set the scon register. What is scon? Scon register is an addressable special register of 51 single chip microcomputer, which is used for the control of serial data communication. Its byte address is 98H and bit address is 98H ~ 9fh. The content is: SM0SM1SM2RENTB8RB8TIRI SM0 SM1: serial port working mode selection bit. Sm0sm1 working mode function baud rate 00 mode 0 8-bit synchronous shift register FOSC / 12 01 mode 1 10 bit UART variable 10 mode 2 11 bit UART FOSC / 64 (or FOSC / 32) 11 mode 3 11 bit UART variable ----------------------------------------------------------- SM2: multi machine communication control bit Ren: Reception permission control, 1 is to allow serial port reception, and 0 is to prohibit serial port reception. TB8: the 9th data bit sent. Rb8: the 9th data bit received. Ti: send interrupt flag. After sending a frame of data, the hardware automatically sets 1. The Ti bit must be cleared by the software. RI: receive interrupt flag. After receiving a frame of data, the hardware automatically sets 1. The RI bit must be cleared by the software. Example: use the serial port debugging assistant to debug the serial port and send the hexadecimal number to make the corresponding LED light up. C. The procedure is as follows: #include void main() { TMOD=0x20; // Set timer: Timer1 mode 2 8-bit reload TH1=0xfd; // Baud rate for 9600 baud @ 11.0592Mhz TL1=0xfd; SM0=0; SM1=1; REN=1; // Control RI to allow serial reception. Sm0sm1 and Ren are scon = 0x50; TR1=1; // Start timer 1 while(1) { If (RI = = 1) / / if RI is 1, the data sent from the serial port is received { RI=0; / / the library software is cleared. must P0=SBUF; // SBUF is a buffer. The receiving buffer can only read but not write, and the transmitting buffer can only write but not read. /*They share a byte address and are independent of each other*/ } } } The above are serial control LED lights. You can send which lights you want to display through serial port debugging software. Example: nixie tube display. Only one display is given here. If there are more than one, you can add the relevant program segment yourself. #include void main() { TMOD=0x20; TH1=0xfd; TL1=0xfd; SM0=0; SM1=1; REN=1; // Control ri TR1=1; while(1) { if(RI==1) { RI=0; P0=SBUF; // P0 is the value of nixie tube. P2=0x06; // 8-bit nixie tube, the seventh, P2 port is chip selection, } } } The above program can be debugged and run on AT89S52 single chip microcomputer + keil. Related tools: Serial debugging assistant, 51 serial communication calculator. Exe, which can be searched and downloaded on the Internet., Read the full text, technical section STM32 MCU Tim module timer up overflow output comparison Three development directions of single chip microcomputer chip Analysis of scon register and C program of 51 single chip microcomputer Analysis of port bit operation method of AVR single chip microcomputer How to use the MCU written in C language to control the running water lamp and download the enthusiast app Create an electronic circle of your contacts Pay attention to wechat of electronic enthusiasts Interesting and informative information and technology dry goods Focus on enthusiast class Lock in the live broadcast of the latest course activities and technologies and collect them 0 collections Share:, comment Lin Chaowen PCB Design: pads tutorial, pads video tutorial, Zheng Zhenyu teacher: Altium designer tutorial, Altium designer video tutorial, Zhang Fei actual combat electronic video tutorial, Zhu Youpeng teacher: Hisilicon hi3518e tutorial, hi3518e video tutorial, Li Zeng teacher: signal integrity tutorial, high-speed circuit simulation tutorial, Huawei Hongmeng system tutorial, harmonyos video tutorial, saisheng: EMC design tutorial, EMC video tutorial Mr. Du Yang: STM32 tutorial, STM32 video tutorial, Tang zuolin: basic C language tutorial, basic C language video tutorial, Zhang Fei: Buck Power tutorial, buck power video tutorial, punctual atom: FPGA tutorial, FPGA video tutorial, Mr. Wei Dongshan: embedded tutorial, Embedded video tutorial Zhang Xianfeng: C language basic video tutorial Xu Xiaogang: Modbus communication video tutorial Wang Zhentao: NB IOT development video tutorial mill: FPGA tutorial, zynq video tutorial c language video tutorial linux driver development video tutorial Zhu Youpeng: u-boot source code analysis video tutorial harmonyos,  Press and hold the slider and drag to the far right Learn about new features Published, relevant recommendations Register addressing method of 51 single chip microcomputer 1. There are 32 general-purpose registers in the 4 working register groups, but only the current register group can be used in the instruction (the selection of working register group is specified above Published on November 22, 2018 at 15:46 • 14 readings Pic16f1713 how to configure the pin when the DAC outputs to the pin Published at 15:14, November 22, 2018 • 6 readings DMA output from filter to array using psoc5 Published at 15:00, November 22, 2018 • 15 readings How to understand the continuous software forced register in 28035? Published at 14:22, November 22, 2018 • 16 readings Lsm6dsl on iks01a2 board will not put gyroscope data into FIFO Published at 10:28, November 22, 2018 • 12 readings Some doubts about using STM32 FSMC to control LCD Published at 09:50, November 22, 2018 • 5 readings How to use FPGA to control ad9910 and write the program in Verilog? Published at 08:57, November 22, 2018 • 20 readings STM32F103 false register not found Published at 08:50, November 22, 2018 • 63 readings

     

     

     

     

    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