DatasheetQ Logo
Electronic component search and free download site. Transistors,MosFET ,Diode,Integrated circuits

AY0438 Ver la hoja de datos (PDF) - Microchip Technology

Número de pieza
componentes Descripción
Fabricante
AY0438
Microchip
Microchip Technology Microchip
AY0438 Datasheet PDF : 11 Pages
1 2 3 4 5 6 7 8 9 10
AY0438
retlw B'01111101'
;decode for 6
retlw B'00000111'
;decode for 7
retlw B'01111111'
;decode for 8
retlw B'01101111'
;decode for 9
;
;
start
clrf PORTB
bsf
STATUS,RP0
;set portb 0,1&2 as outputs
movlw B'11111000'
;
/
movwf PORTB
;
/
bcf
OPTION,RBPU
;enable pull-up for switch
bcf
STATUS,RP0
wait
btfsc UPDATELCD
;see if update switch is low
goto wait
;no then wait
bcf
LOAD
;make sure load is disabled
movf LSD,w
;get least significant value
clrf PCLATH
;PCH = 0
call DecodeValue
;decode the value
call Send8
;serially output the seg values
movf SCNDSD,w
;get 2nd significant digit
call DecodeValue
;decode it
call Send8
;serially output it
movf THRDSD,w
;get 3rd significant digit
call DecodeValue
;decode it
call Send8
movf MSD,w
;get Most significant value
call DecodeValue
;decode it
call Send8
;serially send it
bsf
LOAD
;toggle the LOAD line
bcf
LOAD
;to enable the latches
KeyReleased
btfss UPDATELCD
;wait for key to be released
goto KeyReleased
goto wait
;repeat loop.
;
;Send8, sends the 8 bits in the W register
Send8
movwf temp
;save in temp
movlw .8
;init count
movwf count
;to 8
sendloop
bcf
DATAIN
;make sure DATAIN is low
rrf
temp
;rotate value through carry
btfsc STATUS,C
;if bit clear then skip
bsf
DATAIN
;else set data bit
bsf
CLK
;toggle clock
bcf
CLK
;
/
decfsz count
;see if 8 done
goto sendloop
;no then do all
return
;else return
end
DS70010I-page 6
© 1995 Microchip Technology Inc.

Share Link: 

datasheetq.com  [ Privacy Policy ]Request Datasheet ] [ Contact Us ]