??? 07/28/07 11:53 Read: times |
#142489 - my code to display on 6 digit display Responding to: ???'s previous message |
hello sir!!!
You are right i m developing code for weighing machine which is used both for low and high range as well. Below i have written sample code which which converts my count to 6 ASCII. Now further i would also make it to display on 6 seven segment using look up table concept. Please guide me through.. Thanking you org 0000h ljmp start start: mov sp,#2fh mov r2,low(cout_from_ADC) ;;;;;;;;;;;;;;;;;;it is count from ICL7135 stored in TLO and THO;;;;;;;;;;;;;;;;;;;; mov r3,#high(count_from_ADC) lcall BINTOASC BINTOASC: mov r0,#30h mov dptr,#REFRENCE REPEAT: clr a movc a,@a+dptr mov r7,a inc dptr clr a movc a,@a+dptr mov r6,a mov r4,#'0' AGAIN_SUB: clr c mov a,r2 subb a,r6 ;subtract dw from count mov r2,a mov a,r3 subb a,r7 mov r3,a jc MOV_COUNT ;check for borrow(if Y store r4) inc r4 ;(if N incr. r4 and again sub sjmp AGAIN_SUB ; remaing value from dw) MOV_COUNT: mov a,r4 mov @r0,a ; store r4 in RAM mov a,r2 ; obtain orginal count add a,r6 mov r2,a mov a,r3 addc a,r7 mov r3,a inc r0 movc a,@a+dptr ; inc dptr to point next dw cjne a,#1,INC_DPTR RET INC_DPTR: inc dptr ljmp REPEAT REFRENCE: dw 100000 dw 10000 dw 1000 dw 100 dw 10 dw 1 |