Display

Solo disponible en BuenasTareas
  • Páginas : 4 (945 palabras )
  • Descarga(s) : 0
  • Publicado : 15 de octubre de 2010
Leer documento completo
Vista previa del texto
; Begin
R0L EQU 0x20
R0H EQU 0x21
R1L EQU 0x22
R1H EQU 0x23
R2L EQU 0x24
R2H EQU 0x25
R3L EQU 0x26
R3H EQU 0x27
R4L EQU 0x28
R4H EQU 0x29
R5L EQU 0x2A
R5H EQU 0x2B
W_TEMPEQU 0x7F
STATUS_TEMP EQU 0x7E
ORG 0x0000
BCF PCLATH,3
BCF PCLATH,4
GOTO L0005
ORG 0x0004
MOVWF W_TEMP
SWAPF STATUS,W
CLRF STATUS
MOVWF STATUS_TEMP
CALL L0006
SWAPF STATUS_TEMP,WMOVWF STATUS
SWAPF W_TEMP,F
SWAPF W_TEMP,W
RETFIE
L0005: NOP
; 1: Dim digit As Byte 'input variable for GETMASK subroutine
; The address of 'digit' is 0x2D
; 2: Dim digit1 As Byte'current high digit
; The address of 'digit1' is 0x2E
; 3: Dim digit2 As Byte 'current low digit
; The address of 'digit2' is 0x2F
; 4: Dim mask As Byte 'output variable from GETMASKsubroutine
; The address of 'mask' is 0x30
; 5: Dim mask1 As Byte 'current high digit mask
; The address of 'mask1' is 0x31
; 6: Dim mask2 As Byte 'current low digit mask
; Theaddress of 'mask2' is 0x32
; 7: Dim i As Byte
; The address of 'i' is 0x33
; 8: Dim phase As Bit
; The address of 'phase' is 0x2C,0
; 9:
; 10: Symbol d1enable = PORTC.0 'enable line forhigher 7-segment display
; The address of 'd1enable' is 0x7,0
; 11: Symbol d2enable = PORTC.1 'enable line for lower 7-segment display
; The address of 'd2enable' is 0x7,1
; 12: TRISB= %00000000 'set PORTB pins as outputs
BSF STATUS,RP0
CLRF 0x06
BCF STATUS,RP0
; 13: TRISC.0 = 0 'set RC0 pin as output
BSF STATUS,RP0
BCF 0x07,0
BCF STATUS,RP0
; 14: TRISC.1 = 0 'setRC1 pin as output
BSF STATUS,RP0
BCF 0x07,1
BCF STATUS,RP0
; 15: d1enable = False
BCF 0x07,0
; 16: d2enable = False
BCF 0x07,1
; 17: mask1 = 0
CLRF 0x31
; 18: mask2 = 0
CLRF 0x32
;19: phase = 0
BCF 0x2C,0
; 20: INTCON.T0IE = 1 'enable Timer0 interrupts
BSF 0x0B,5
; 21: INTCON.GIE = 1 'enable all un-masked interrupts
BSF 0x0B,7
; 22: OPTION_REG.T0CS = 0 'set Timer0...
tracking img