Discussion in "Project Help" started by    cenadius    Aug 19, 2007.
Thu Sep 11 2008, 11:11 pm
ermm, can i ask one question about the circuit in page 3?

well its about the 7 segment display...i wish to ask are they common cathode or common anode?

besides that, what is the possible model name of the 7 segment dual digit display?
Thu Sep 11 2008, 11:38 pm
@ silver,
they are common cathode. the model no. for a multiplexed two digit display depends upon the manufacturer. try browsing on the manufacturer site for the model nos.

P.S. the display interface part of the circuit does not seem to have adequate current protection. So pease add suitable buffer/current limiting resistors to the circuit for safety of the uC.
good luck. :-)
Sun Sep 14 2008, 02:07 pm
ermm, i tried to connect and did all programming correctly.

unfortunately it did not work, i feel its really weird. my 7 segment well its trying to produce some number but its just all blur, meaning not giving any fixed value but shows some blinking.

besides that, there is another thing, the switches are not working as well, please help me out. thanks.

is it the programming that is wrong or the circuit?

oh wait, i did not see the page 5 has a circuit as well, let me try that out first...sorry for inconvenience


[ Edited Sun Sep 14 2008, 08:44 pm ]
Sun Sep 14 2008, 07:02 pm
Hi guys, I have a project with LM35 (with ADC) and a fan. how can I control the fan (on/off) with respect to the temperature ?

I mean how to perform these instructions in assembly language ?
Output of ADC is at P2 and stored in A

OFF fan if Temp < 31 Celsius
ON fan if Temp > 31 Celsius

Thanks for your consideration.
Sun Sep 14 2008, 08:43 pm
i finally got the project working, fan working out well, OFF, LOW, FAST switch was fine.

the display of temperature is fine too but, the biggest problem is...the value does not stick at one value at one time, example the temperature now is 27 but it seems to be always blinking the value and when it changes to 26, it blinks as well and change to 26.

mostly if i were to see a proper 7 segment, it stays at 27 then when the temperature drops , it drops as well and does not blink repeatedly.

i hope you all can tell me how to overcome this problem:)...cause my friend tried to solve it last time failed as well. thanks.
Sun Sep 14 2008, 09:59 pm
silver,
the problem may be occurring because the code is executing some other part of the code which takes a bit of time and during the interval the whole display is blank. U can avoid blinking by introducing the scanning of the display in a timer interrupt service routine meant to execute for every 1msecond. If u have written the code in c-language, that would not be very difficult. but if written in assemble , take care to save the different variables before executing the display routine.
post ur code and we can try to find a way out...
:-)
Mon Sep 15 2008, 01:29 am
oh about the code, i am currently using the code on page 10 given by Ajay.

well i wonder if you can help me to look through it and see is there any way i can change the blinking of the 7 segment. thanks for looking through this, pdi33.

well of course its in assembly code form but i am pretty poor in my assembly code, therefore i wonder if you can help me out:)
Mon Sep 15 2008, 09:51 pm


pl.post the code here so that we can help



Arun
Mon Sep 15 2008, 10:27 pm
well its on page 10 of this forum topic, well not being stubborn but no point posting the same code twice on the same topic:). anything you can view page 10 of this forum topic written by Ajay that is.

automan equ P3.4
off     equ P1.4
flow    equ P1.5
ffast   equ P1.6
soc     equ P3.1
read    equ P3.0
fan     equ P3.3
mode    equ 20H
done    equ 21H
adc     equ 30H
adcport equ P2
MSB     equ P1.0
LSB     equ P1.1
seg7    equ P0

        org 0H
        sjmp start

        org 03H
        setb done
        reti

        org 0BH
        ljmp timer0_int

start:
        clr fan
        clr done
        clr mode
        clr MSB
        clr LSB
        mov IE,#10000011B
       
scan:
        acall read_adc
        JNB automan,auto
        clr mode
        sjmp manual
auto:
        setb mode
manual:
        JB mode,inauto
        JNB off,fanoff
        JNB flow,fanlow
        JNB ffast,fanfast
        sjmp scan

fanoff:
        clr TR0
        clr TF0
        clr fan
        JNB off,$
        sjmp scan

fanlow:
        mov r7,#50H
        setb TR0
        JNB flow,$
        sjmp scan

fanfast:
        clr TR0
        clr TF0
        setb fan
        JNB ffast,$
        sjmp scan

inauto:
        mov a,adc
        clr c
        cjne a,#30H,chk
chk:
        jc fanoff
        clr c
        cjne a,#60H,chk1
chk1:
        jc fanlow
        sjmp fanfast

read_adc:
        clr soc
        nop
        setb soc
        jnb done,$
        clr done
        clr read
        mov a,adcport
        setb read

        mov dptr,#ctable
        movc a,@a+dptr
        mov adc,a

        mov dptr,#dtable
        swap a
        anl a,#0FH
        movc a,@a+dptr
        mov seg7,a
        setb MSB
        acall delay
        clr MSB

        mov a,adc
        anl a,#0FH
        movc a,@a+dptr
        mov seg7,a
        setb LSB
        acall delay
        clr LSB
        ret

timer0_int:
   JB F0, HIGH_DONE
LOW_DONE:
   setb F0
   setb fan
   mov TH0, R7
   clr TF0
   reti

HIGH_DONE:
   clr F0
   clr fan
   mov A, #0FFH
   clr C
   subb A, R7
   mov TH0, A
   clr TF0
   reti

delay:
        mov r6,#20
wait:
        mov r5,#255
        djnz r5,$
        djnz r6,wait
        ret

ctable:
DB 0H, 0H, 1H, 1H, 2H, 2H, 2H, 3H
DB 3H, 4H, 4H, 4H, 5H, 5H, 5H, 6H
DB 6H, 7H, 7H, 7H, 8H, 8H, 9H, 9H
DB 9H, 10H, 10H, 11H, 11H, 11H, 12H, 12H
DB 13H, 13H, 13H, 14H, 14H, 15H, 15H, 15H
DB 16H, 16H, 16H, 17H, 17H, 18H, 18H, 18H
DB 19H, 19H, 20H, 20H, 20H, 21H, 21H, 22H
DB 22H, 22H, 23H, 23H, 24H, 24H, 24H, 25H
DB 25H, 25H, 26H, 26H, 27H, 27H, 27H, 28H
DB 28H, 29H, 29H, 29H, 30H, 30H, 31H, 31H
DB 31H, 32H, 32H, 33H, 33H, 33H, 34H, 34H
DB 35H, 35H, 35H, 36H, 36H, 36H, 37H, 37H
DB 38H, 38H, 38H, 39H, 39H, 40H, 40H, 40H
DB 41H, 41H, 42H, 42H, 42H, 43H, 43H, 44H
DB 44H, 44H, 45H, 45H, 45H, 46H, 46H, 47H
DB 47H, 47H, 48H, 48H, 49H, 49H, 49H, 50H
DB 50H, 51H, 51H, 51H, 52H, 52H, 53H, 53H
DB 53H, 54H, 54H, 55H, 55H, 55H, 56H, 56H
DB 56H, 57H, 57H, 58H, 58H, 58H, 59H, 59H
DB 60H, 60H, 60H, 61H, 61H, 62H, 62H, 62H
DB 63H, 63H, 64H, 64H, 64H, 65H, 65H, 65H
DB 66H, 66H, 67H, 67H, 67H, 68H, 68H, 69H
DB 69H, 69H, 70H, 70H, 71H, 71H, 71H, 72H
DB 72H, 73H, 73H, 73H, 74H, 74H, 75H, 75H
DB 75H, 76H, 76H, 76H, 77H, 77H, 78H, 78H
DB 78H, 79H, 79H, 80H, 80H, 80H, 81H, 81H
DB 82H, 82H, 82H, 83H, 83H, 84H, 84H, 84H
DB 85H, 85H, 85H, 86H, 86H, 87H, 87H, 87H
DB 88H, 88H, 89H, 89H, 89H, 90H, 90H, 91H
DB 91H, 91H, 92H, 92H, 93H, 93H, 93H, 94H
DB 94H, 95H, 95H, 95H, 96H, 96H, 96H, 97H
DB 97H, 98H, 98H, 98H, 99H, 99H, 00H, 00H

dtable:
DB 3FH, 06H, 5BH, 4FH, 66H, 6DH, 7DH, 07H, 7FH, 67H

END


in fact i discussed this with my friends who learned the same field as me, unfortunately the assembly code we learned is just one semester and there are a few parts we don't understand, anyway straight to the point is we are trying to solve the 7 segment display blinking problem, so we are not so sure what is the main problem, is it the code? the crystal? or problems in the schematic connection?


[ Edited Mon Sep 15 2008, 10:29 pm ]
Mon Sep 15 2008, 10:49 pm
hi silver,
sorry for not replying earlier. actually, i was trying to find a way out of ur problem. trying to reverse engineer a code written by another person is always difficult ( especially if the code is a good compact one!!! ). anyways, i think the problem could be (possibly ) that the code is holding on to a single display for a bit too long before displaying the next digit.here is the portion:

mov dptr,#dtable
swap a
anl a,#0FH
movc a,@a+dptr
mov seg7,a
setb MSB
acall delay
clr MSB

mov a,adc
anl a,#0FH
movc a,@a+dptr
mov seg7,a
setb LSB
acall delay
clr LSB
ret

Now, i would suggest u to reduce the delay in the delay routine so as to increase the switch over and thus reduce the blinking effect.
do try it and get back.
:-)

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

Williamjaf
Tue Apr 16 2024, 12:25 pm
best_yyPa
Tue Apr 16 2024, 09:42 am
ErnestoExpop
Tue Apr 16 2024, 02:57 am
Jamesclepe
Mon Apr 15 2024, 11:10 am
Aliciaelora
Mon Apr 15 2024, 07:59 am
btaletvpcu
Mon Apr 15 2024, 04:36 am
UbvpwcTib
Mon Apr 15 2024, 03:13 am
AmyJow
Sun Apr 14 2024, 11:54 pm