ݺߣ

ݺߣShare a Scribd company logo
list
p=16f877A
; list directive to define processor
#include
<p16f877A.inc>
; processor specific variable definitions
__CONFIG _CP_OFF & _WDT_OFF & _BODEN_OFF & _PWRTE_ON & _XT_OSC & _WRT_OFF
& _LVP_OFF & _CPD_OFF
|status equ 0x03
w
equ 0x00
trisa
equ 0x05
trisb
equ 0x06
trisc
equ 0x07
trisd
equ 0x08
trise
equ 0x09
porta
equ 0x85
portb
equ 0x86
adcon1 equ 0x09f
adcon0 equ 0x1f
adresh equ 0x1e
pir1
equ 0x0c
#define rp0 status,5
#define rp1 status,6
#define z
status;2
#define adif pir1,6
#define godon adcon0,2
#define c status,0
org 0x00
goto inicio
org 0x04
inicio
bcf rp1
bsf rp0,cambio de banco
clrf trisb
movlw 0x00
movwf trisc
movlw ob00000000
movwf trisd
movlw ob11111111
movwf trisa
clrf trise
bcf rp1
convertir
movlw ob00000001
movwf adcon0
bcf
godone
no_1 btfss adif
goto no_1
movf adresh
movwf portb
clrf adresh
movlw ob00001001
movwf adcon0
bsf godone
no_2 btfss adif
goto no_2
movf adresh
movwf portc
Conversor

More Related Content

Conversor

  • 1. list p=16f877A ; list directive to define processor #include <p16f877A.inc> ; processor specific variable definitions __CONFIG _CP_OFF & _WDT_OFF & _BODEN_OFF & _PWRTE_ON & _XT_OSC & _WRT_OFF & _LVP_OFF & _CPD_OFF |status equ 0x03 w equ 0x00 trisa equ 0x05 trisb equ 0x06 trisc equ 0x07 trisd equ 0x08 trise equ 0x09 porta equ 0x85 portb equ 0x86 adcon1 equ 0x09f adcon0 equ 0x1f adresh equ 0x1e pir1 equ 0x0c #define rp0 status,5 #define rp1 status,6 #define z status;2 #define adif pir1,6 #define godon adcon0,2 #define c status,0 org 0x00 goto inicio org 0x04 inicio bcf rp1 bsf rp0,cambio de banco clrf trisb movlw 0x00 movwf trisc movlw ob00000000 movwf trisd movlw ob11111111 movwf trisa clrf trise bcf rp1 convertir movlw ob00000001 movwf adcon0 bcf godone no_1 btfss adif goto no_1 movf adresh movwf portb clrf adresh movlw ob00001001 movwf adcon0 bsf godone no_2 btfss adif goto no_2 movf adresh movwf portc