SlideShare una empresa de 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

Más contenido relacionado

Más 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
 

Más 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

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
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
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
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
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
 
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
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
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
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
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
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 

Último (20)

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
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
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
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
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!
 
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
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
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
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
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
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 

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