SlideShare uma empresa Scribd logo
1 de 3
;***********************************************
;***RECEPCIÓN DE UN BYTE MEDIANTE USART***
;***********************************************

           LIST P=16F873
           INCLUDE    P16F873.INC

W_TEMP            EQU         20H
STATUS_TEMP       EQU         21H
DATOB             EQU         22H

           ORG          00H
           GOTO         INICIO
           ORG          04H
           GOTO         INTER

INTERBCF   INTCON,7
           movwf        W_TEMP
           swapf        W_TEMP,1
           movf         STATUS,0
           movwf        STATUS_TEMP
           BTFSS        PIR1,RCIF
           GOTO         VOLVER
           MOVF         RCREG,0
           MOVWF        DATOB
           MOVF         DATOB,0
           MOVWF        PORTB
           BCF          PIR1,RCIF
VOLVER     movf         STATUS_TEMP,0
           movwf        STATUS
           swapf        W_TEMP,0
           BSF          INTCON,7
           RETFIE

INICIO     CLRWDT
           CLRF         PORTB
           CLRF         PORTC
           BSF          STATUS,5
           BCF          STATUS,6
           MOVLW        B'00000000'
           MOVWF        TRISB
           MOVLW        B'10111111'
           MOVWF        TRISC
MOVLW     B'00100100'
          MOVWF     TXSTA
          MOVLW     D'25'
          MOVWF     SPBRG
          BSF       PIE1,RCIE
          BCF       STATUS,5
          BCF       STATUS,6
          MOVLW     B'10010000'
          MOVWF     RCSTA
          MOVLW     B'11000000'
          MOVWF     INTCON

BUCLE     CLRWDT
          GOTO      BUCLE
          END


;*******************************************
;***TRANSMISIÓN DE UN BYTE MEDIANTE USART***
;*******************************************

          LIST      P=16F873
          INCLUDE   P16F873.INC

DATOB     EQU       20H


          ORG       00H
          GOTO      INICIO
          ORG       04H
          RETFIE

INICIO
          BSF       STATUS,6
          BSF       STATUS,5
          MOVLW     B'11111111'
          MOVWF     TRISB
          BCF       STATUS,6
          MOVLW     B'10000000'
          MOVWF     TRISC
PASO1
          BCF       STATUS,6
          BCF       STATUS,5
MOVF     PORTB,0
         MOVWF    DATOB
         CALL     ENVIAR_DATO
         GOTO     PASO1

ENVIAR_DATO
         BCF      STATUS,6
         BSF      STATUS,5
         MOVLW    B'00100110'
         MOVWF    TXSTA
         MOVLW    D'25'
         MOVWF    SPBRG
         BCF      STATUS,5 ;Banco0
         BSF      RCSTA,7     ;SPEN=1 ON USART
         MOVF     DATOB,0
         MOVWF    TXREG

ESPERA   BTFSS    PIR1,4
         GOTO     ESPERA
         RETURN

         END

Mais conteúdo relacionado

Mais de Luis Zurita

TALLER NORMAS APA
TALLER NORMAS APATALLER NORMAS APA
TALLER NORMAS APALuis Zurita
 
PROTOCOLO MODBUS
PROTOCOLO MODBUSPROTOCOLO MODBUS
PROTOCOLO MODBUSLuis Zurita
 
Guía rápidalcd y teclado
Guía rápidalcd y tecladoGuía rápidalcd y teclado
Guía rápidalcd y tecladoLuis Zurita
 
Grupos micro2 13
Grupos micro2 13Grupos micro2 13
Grupos micro2 13Luis Zurita
 
Manejo de perifericos para microcontroladore
Manejo de perifericos para microcontroladoreManejo de perifericos para microcontroladore
Manejo de perifericos para microcontroladoreLuis Zurita
 
Notas def electronica
Notas def electronicaNotas def electronica
Notas def electronicaLuis Zurita
 
Notas proyecto3 iyc
Notas proyecto3 iycNotas proyecto3 iyc
Notas proyecto3 iycLuis Zurita
 
Notas definitivas iyc2013
Notas definitivas iyc2013Notas definitivas iyc2013
Notas definitivas iyc2013Luis Zurita
 
Proyecto 2 electronica
Proyecto 2 electronicaProyecto 2 electronica
Proyecto 2 electronicaLuis Zurita
 

Mais de Luis Zurita (20)

TALLER NORMAS APA
TALLER NORMAS APATALLER NORMAS APA
TALLER NORMAS APA
 
PROTOCOLO MODBUS
PROTOCOLO MODBUSPROTOCOLO MODBUS
PROTOCOLO MODBUS
 
Guía rápidalcd y teclado
Guía rápidalcd y tecladoGuía rápidalcd y teclado
Guía rápidalcd y teclado
 
Pevmicroi ieo
Pevmicroi ieoPevmicroi ieo
Pevmicroi ieo
 
Pevmicroii13 2
Pevmicroii13 2Pevmicroii13 2
Pevmicroii13 2
 
Pevmicro1 t2 13
Pevmicro1 t2 13Pevmicro1 t2 13
Pevmicro1 t2 13
 
Pev electronica
Pev electronicaPev electronica
Pev electronica
 
Grupos micro2 13
Grupos micro2 13Grupos micro2 13
Grupos micro2 13
 
Pevmicro1 t2 13
Pevmicro1 t2 13Pevmicro1 t2 13
Pevmicro1 t2 13
 
Micro2 tema 5
Micro2 tema 5Micro2 tema 5
Micro2 tema 5
 
Micro2 tema 4
Micro2 tema 4Micro2 tema 4
Micro2 tema 4
 
Micro2 tema 3
Micro2 tema 3Micro2 tema 3
Micro2 tema 3
 
Micro2 tema 2
Micro2 tema 2Micro2 tema 2
Micro2 tema 2
 
Micro2 tema 1
Micro2 tema 1Micro2 tema 1
Micro2 tema 1
 
Manejo de perifericos para microcontroladore
Manejo de perifericos para microcontroladoreManejo de perifericos para microcontroladore
Manejo de perifericos para microcontroladore
 
Pevmicroii13 2
Pevmicroii13 2Pevmicroii13 2
Pevmicroii13 2
 
Notas def electronica
Notas def electronicaNotas def electronica
Notas def electronica
 
Notas proyecto3 iyc
Notas proyecto3 iycNotas proyecto3 iyc
Notas proyecto3 iyc
 
Notas definitivas iyc2013
Notas definitivas iyc2013Notas definitivas iyc2013
Notas definitivas iyc2013
 
Proyecto 2 electronica
Proyecto 2 electronicaProyecto 2 electronica
Proyecto 2 electronica
 

Último

Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 

Último (20)

Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 

Rx Tx Microii

  • 1. ;*********************************************** ;***RECEPCIÓN DE UN BYTE MEDIANTE USART*** ;*********************************************** LIST P=16F873 INCLUDE P16F873.INC W_TEMP EQU 20H STATUS_TEMP EQU 21H DATOB EQU 22H ORG 00H GOTO INICIO ORG 04H GOTO INTER INTERBCF INTCON,7 movwf W_TEMP swapf W_TEMP,1 movf STATUS,0 movwf STATUS_TEMP BTFSS PIR1,RCIF GOTO VOLVER MOVF RCREG,0 MOVWF DATOB MOVF DATOB,0 MOVWF PORTB BCF PIR1,RCIF VOLVER movf STATUS_TEMP,0 movwf STATUS swapf W_TEMP,0 BSF INTCON,7 RETFIE INICIO CLRWDT CLRF PORTB CLRF PORTC BSF STATUS,5 BCF STATUS,6 MOVLW B'00000000' MOVWF TRISB MOVLW B'10111111' MOVWF TRISC
  • 2. MOVLW B'00100100' MOVWF TXSTA MOVLW D'25' MOVWF SPBRG BSF PIE1,RCIE BCF STATUS,5 BCF STATUS,6 MOVLW B'10010000' MOVWF RCSTA MOVLW B'11000000' MOVWF INTCON BUCLE CLRWDT GOTO BUCLE END ;******************************************* ;***TRANSMISIÓN DE UN BYTE MEDIANTE USART*** ;******************************************* LIST P=16F873 INCLUDE P16F873.INC DATOB EQU 20H ORG 00H GOTO INICIO ORG 04H RETFIE INICIO BSF STATUS,6 BSF STATUS,5 MOVLW B'11111111' MOVWF TRISB BCF STATUS,6 MOVLW B'10000000' MOVWF TRISC PASO1 BCF STATUS,6 BCF STATUS,5
  • 3. MOVF PORTB,0 MOVWF DATOB CALL ENVIAR_DATO GOTO PASO1 ENVIAR_DATO BCF STATUS,6 BSF STATUS,5 MOVLW B'00100110' MOVWF TXSTA MOVLW D'25' MOVWF SPBRG BCF STATUS,5 ;Banco0 BSF RCSTA,7 ;SPEN=1 ON USART MOVF DATOB,0 MOVWF TXREG ESPERA BTFSS PIR1,4 GOTO ESPERA RETURN END