SlideShare a Scribd company logo
1 of 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

More Related Content

More from 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
 

More from 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
 

Recently uploaded

Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
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
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
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
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 

Recently uploaded (20)

Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
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
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
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
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 

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