SlideShare ist ein Scribd-Unternehmen logo
1 von 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

Weitere ähnliche Inhalte

Mehr von 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
 

Mehr von 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
 

Kürzlich hochgeladen

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 

Kürzlich hochgeladen (20)

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 

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