Volmetro Pic 18F4550

Páginas: 2 (427 palabras) Publicado: 6 de diciembre de 2012
VOLMETRO (2 CANALES)

Respaldo_w EQU 0x04
PORTB_L EQU 0x05
Cont_l EQU 0x28
Cont_h EQU 0x29
UNIDADES EQU 0x10
DECIMAS EQU 0x11
CENTECIMASEQU 0x12
MILESIMAS EQU 0x13
DIEZMILESIMAS EQU 0x14
RS EQU 0x03
ENABLE EQU 0x02
CONTADOR49 EQU 0x30
;REGISTRO EQU 0x31

ORG 0x00GOTO INICIO
ORG 0x20

INICIO: MOVLW 0x7F
MOVWF OSCCON
MOVLW 0x97
MOVWF ADCON2
MOVLW 0x0D
MOVWF ADCON1MOVLW 0x03
MOVWF TRISB
CALL CONFIG_LCD
LL9: MOVLW 0x01
MOVWF ADCON0
BSF ADCON0,GO_DONE
LL6: BTFSC ADCON0,GO_DONE
GOTO LL6CALL CONVERTIR_PIC
CALL EXH_VOLTS
BCF PORTB,RS
MOVLW 0x80
CALL DISPLAY_PIC
BSF PORTB,RS
BCF ADRESH,F
BCF ADRESL,F;SELECCIONAR CANAL
MOVLW 0x05
MOVWF ADCON0
LL7: BSF ADCON0,GO_DONE
LL8: BTFSC ADCON0,GO_DONE
GOTO LL8
CALL CONVERTIR_PIC
CALLEXH_VOLTS
BCF PORTB,RS
MOVLW 0xC0
CALL DISPLAY_PIC
BSF PORTB,RS
GOTO LL9

CONVERTIR_PIC: TSTFSZ ADRESH
GOTO INICIA_CONVTSTFSZ ADRESL
GOTO INICIA_CONV
RETURN
INICIA_CONV: TSTFSZ ADRESL
GOTO LL4
LL5: DECF ADRESH,F
LL4: DECF ADRESL,FCALL CUARENTA_9
TSTFSZ ADRESL
GOTO LL4
TSTFSZ ADRESH
GOTO LL5
RETURN

EXH_VOLTS: BCF PORTB,RS
CALLDISPLAY_PIC
BSF PORTB,RS
MOVFW UNIDADES
ADDLW 0x30
CALL DISPLAY_PIC
MOVLW "."
CALL DISPLAY_PIC
MOVFW DECIMAS...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Pic 18F4550
  • PIC 18f4550
  • Encoder con pic 18f4550
  • Suma En Pic 18F4550
  • Pic 18f4550
  • Comunicacion Con Usb Del Pic 18F4550
  • Practica con pic 18f4550
  • Control pic 18f4550 usb

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS