FMUSER Wirless Transmit Video And Audio More Easier !

[email protected] WhatsApp +8618078869184
Language

    PIC microcontroller two-machine synchronous communication design

     

    "Single chip microcomputer dual computer synchronous communication 1. MCU pic1 programming (master control sending) LIST P=16F876 #INCLUDE P16F876.INC CBLOCK 0X24 ; Three bytes are reserved for display COUNT ; Used as a counter or register ENDC ORG 0X0000 ; Program reset entry NOP START GOTO MAIN ORG 0X0100 MAIN MOVLW 0X30 MOVWF FSR ; The RAM contents starting from 30h unit will be initialized below MOVLW 0X30 ; Assign the value 30h to the unit 30h MOVWF COUNT INTRAM MOVF COUNT,0 ; Assign 30h ~ 7FH to units 30h ~ 7FH MOVWF INDF INCF COUNT,1 INCF FSR,1 BTFSS COUNT,7 GOTO INTRAM BSF STATUS,RP0 ; Initialize SCI part MOVLW 0X19 ; Set the baud rate for transmission to approximately 9600 bps MOVWF SPBRG MOVLW 0X94 ; Select synchronous high-speed mode to transmit 8-bit data MOVWF TXSTA BCF STATUS,RP0 MOVLW 0X80 ; Allow synchronous serial port operation MOVWF RCSTA BSF STATUS,RP0 BSF TRISC,7 ; Set RC6 and RC7 as input mode and disconnect from external circuit BSF TRISC,6 BSF STATUS,RP0 MOVLW 0X30 ; Transfer the content from 30h unit to pic2 MOVWF FSR MOVF INDF,0 MOVWF TXREG ; Write the data to be transmitted to the transmission buffer txreg BSF STATUS,RP0 BSF TXSTA,TXEN ; Send allow BCF STATUS,RP0 TX1 BTFSS PIR1,TXIF ; Wait until the last data is written GOTO TX1 INCF FSR ; Ready to send next data MOVF INDF,0 MOVWF TXREG ; Write new data to txreg BTFSS FSR,7 ; Judge whether the contents of all 30h ~ 7FH units have been sent? GOTO TX1 ; If not, continue to send other bytes TX2 BTFSS PIR1,TXIF ; Wait until all the data required to be sent has been sent, and then add additional data GOTO TX2 ; Write a byte to txreg so that the last data can be sent smoothly MOVWF TXREG NOP ; After a delay of several microseconds, turn off the transmission permission NOP NOP NOP NOP BSF STATUS,RP0 BCF TXSTA,TXEN BCF STATUS,RP0 CALL LED ; Call the display subroutine to display the sent data END ; Program finished 2. MCU pic2 programming (slave receiving) LIST P=16F876 #INCLUDE P16F876.INC CBLOCK 0X24 COUNT ENDC ORG 0X0000 NOP START GOTO MAIN ORG 0X0100 MAIN BSF STATUS,RP0 MOVLW 0X10 ; Select synchronous driven mode MOVWF TXSTA BCF STATUS,RP0 MOVLW 0X80 ; Serial port enable MOVWF RCSTA BSF STATUS,RP0 BSF TRISC,7 ; Turn off the connection with the external circuit BSF TRISC,6 BCF STATUS,RP0 MOVLW 0X30 ; Store the received data from the 30h unit MOVWF FSR BSF RCSTA,CREN ; Receiving permission WAIT BTFSS PIR1,RCIF ; Waiting to receive GOTO WAIT MOVF RCREG,0 ; Read received data MOVWF INDF ; Store the received data into the ram of pic2 INCF FSR BTFSS FSR,7 ; Have all data been received? GOTO WAIT ; No, continue to receive other bytes NOP ; After a delay of several microseconds, clear the receive permission bit NOP NOP NOP BCF RCSTA,RCEN CALL LED ; Call the display subroutine to display the received data END ; After the program, read the 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