Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

PLC 877

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 13

LIST P=16F877 RADIX HEX

INCLUDE <P16F877.INC> INCLUDE <MATH16.INC>

DECENA UNIDAD DECIMA

EQU 0x6A EQU 0x6B EQU 0x6C

CENTESIMA EQU 0x6D

ORG 0x00 goto INICIO

ORG 0x04 bcf INTCON,GIE

btfsc goto btfsc goto

INTCON,RBIF TECLA INTCON,T0IF TIMER_0

ORG 0x20

INICIO call call call call INI_PORTS INI_I2C Start_cond SendWrtAddr

call

BANCO_0

clrf bsf call call

SCREEN SCREEN,0 CLS BANCO_0

movlw 0x4A movwf COMANDO call call SEND_C BANCO_0

movlw 0x43 movwf COMANDO call call SEND_C BANCO_0

movlw 0x51 movwf COMANDO call call SEND_C BANCO_0

movlw 0x53 movwf COMANDO call call SEND_C BANCO_0

movlw 0x46 movwf COMANDO call SEND_C

movlw 0xFF call BANCO_0

movwf KEY_P clrf bsf clrf FILA FILA,0 POS_CUR

call call

DEFAULT_PA CALC_K1

call call

CALC_K2 CONF_INT

;-------------------------Call clrf clrf bcf BANCO_0 TMR1H TMR1L PIR1,0

movlw b'00110001' movwf T1CON movlw 0x03 movwf PAUSA

BUC_P

call

BANCO_0

btfss goto bcf

PIR1,0 BUC_P PIR1,0

decfsz PAUSA goto BUC_P

movlw 0x03 movwf PAUSA bcf btfss goto INTCON,GIE SCREEN,0 SKIP_UNO

; ---------------------------------------call TRANS_SP_A

movlw 0x83 movwf BEXP movlw 0x20 movwf BARGB0

clrf

BARGB1

call call call call

FPM24 DISP_5 FLOAT_ASCII TRANS_IN_A

movlw 0x83 movwf BEXP movlw 0x20 movwf BARGB0 clrf call call call BARGB1 FPM24 DISP_6 FLOAT_ASCII

;-------------------------SKIP_UNO call call call call call call call call call call call call call bcf ANALOG_IN CONV_PF TRANS_A_IN TRANS_A_B TRANS_SP_A FPS24 TRANS_A_D TRANS_K1_B FPM24 TRANS_A_GN TRANS_C_A TRANS_BE_B FPS24 STATUS,Z

movlw 0xFF andwf AEXP,0 btfsc STATUS,Z

clrf call call bcf

AARGB0 TRANS_AE_B FPS24 STATUS,Z

movlw 0xFF andwf AEXP,0 btfsc clrf STATUS,Z AARGB0

movlw 0x80 movwf BEXP movlw 0x40 movwf BARGB0 clrf bcf BARGB1 STATUS,Z

movlw 0xFF andwf AEXP,0 btfss call call call call call call call call STATUS,Z FPM24 TRANS_D_B FPA24 TRANS_K2_B FPM24 TRANS_GN_B TRANS_SP_B FPA24

call btfsc goto bsf bcf

BANCO_0 AARGB0,7 CARGA_0 STATUS,C STATUS,Z

movlw 0x81 subwf AEXP,0 btfsc goto btfss goto bcf STATUS,C SI_SUP STATUS,Z NO_SUP STATUS,Z

movlw 0x20 subwf AARGB0,0 btfss goto btfss goto bcf STATUS,C SI_SUP STATUS,Z NO_SUP STATUS,Z

movlw 0x00 subwf AARGB1,0 btfss goto btfss goto SI_SUP movlw 0x81 movwf Y_EXP movwf AEXP movlw 0x20 movwf Y_B0 movwf AARGB0 movlw 0x00 movwf Y_B1 movwf AARGB1 goto CARGA_0 LAB_1 clrf AEXP STATUS,C SI_SUP STATUS,Z NO_SUP

clrf clrf NO_SUP call LAB_1

AARGB0 AARGB1

TRANS_A_Y

movlw 0x84 movwf BEXP movlw 0x4C movwf BARGB0 clrf call call BARGB1 FPM24 INT2416

movf AARGB1,0 movwf PORTD call call call bsf goto CONF_INT call bcf bcf bcf bsf bsf clrf bsf bsf bsf BANCO_1 OPTION_REG,T0CS OPTION_REG,PSA OPTION_REG,PS2 OPTION_REG,PS1 OPTION_REG,PS0 INTCON INTCON,RBIE INTCON,T0IE INTCON,GIE TRANS_BE_AE TRANS_CE_BE TRANS_DE_CE INTCON,GIE BUC_P

RETURN

INI_PORTS call clrf clrf clrf clrf bsf bcf bcf bcf bcf call BANCO_0 PORTA PORTB PORTC PORTD ADCON0,ADCS1 ADCON0,ADCS0 ADCON0,CHS2 ADCON0,CHS1 ADCON0,CHS0 BANCO_1

movlw b'10001110' movwf ADCON1 movwf TRISA clrf call bsf call bsf TRISD BANCO_0 ADCON0,ADON BANCO_1 OPTION_REG,NOT_RBPU

movlw b'11110000' movwf TRISB

movlw b'00011000' movwf TRISC clrf INTCON

RETURN

BANCO_0 bcf return

bcf

STATUS,RP0

STATUS,RP1

BANCO_1 bcf return

bsf

STATUS,RP0

STATUS,RP1

BANCO_2 bsf return

bcf

STATUS,RP0

STATUS,RP1

BANCO_3 bsf return

bsf

STATUS,RP0

STATUS,RP1

CALC_K1 call call call call call call call call TRANS_KP_A TRANS_TN_B FPM24 TRANS_T_B FPM24 TRANS_KP_B FPA24 TRANS_A_K1

RETURN

CALC_K2 call call call call TRANS_KP_A TRANS_TV_B FPM24 BANCO_0

movlw 0x81 movwf BEXP movlw 0x40 clrf BARGB1

call call call call

FPD24 TRANS_T_B FPD24 TRANS_A_K2

RETURN

ANALOG_IN call bsf BANCO_0 ADCON0,GO_DONE

BUC_AN btfsc goto ADCON0,GO_DONE BUC_AN

RETURN

CONV_PF call BANCO_0

movf ADRESH,0 movwf AARGB0 call BANCO_1

movf ADRESL,0 call BANCO_0

movwf AARGB1 call call FLO24 BANCO_0

movlw 0x77 movwf BEXP movlw 0x20 movwf BARGB0 movlw 0x28 movwf BARGB1 call FPM24

RETURN

FLOAT_ASCII call BANCO_0

movlw 0x85 movlw 0x48 movwf BARGB0 clrf call call clrf clrf movlw movwf ;---------------call FXD1616U BARGB1 FPM24 INT24 BARGB0 BEXP 0x0A BARGB1

movf REMB1,W

movwf CENTESIMA movlw 0x30 addwf CENTESIMA,1 ;---------------call FXD1616U

movf REMB1,W movwf DECIMA movlw 0x30 addwf DECIMA,1 ;---------------call FXD1616U

movf REMB1,W movwf UNIDAD movlw 0x30

addwf UNIDAD,1 call FXD1616U

movf REMB1,W movwf DECENA movlw 0x30 addwf DECENA,1 movf DECENA,0 movwf LETRA call call WrtData BANCO_0

movf UNIDAD,0 movwf LETRA call call WrtData BANCO_0

movlw 0x2E movwf LETRA call WrtData

call

BANCO_0

movf DECIMA,0 movwf LETRA call call WrtData BANCO_0

movf CENTESIMA,0 movwf LETRA call WrtData

RETURN

; Librerias usadas INCLUDE <TRANSF.ASM> INCLUDE <FP24.A16> INCLUDE <TECLADO.ASM>

INCLUDE

<I2C.ASM>

INCLUDE <FXD66.A16> END

You might also like