free 8051 Microcontroller Projects AVR PIC Microcontroller Projects Tutorials Ebooks Libraries, interfacing tutorials, lcd tutorial, stepper motor, dc motor 8051 assembly language programming electronics and communication ECE CSE pdf ebooks library BE final year project ideas Embedded systems

 
8051 microcontroller 8051 microcontroller
Forums

8051 Microcontroller Projects AVR PIC Projects Tutorials Ebooks Libraries codes :: Forums :: Project Development :: Project Help
 
<< Previous thread | Next thread >>
An 8051 Based Temperature Controlled Fan project
Go to page  1 2 3 ... 9 [10] 11 12 13 14
Moderators: Ajay, Junied , abbas1707, Arun Kumar V, pdi33, Shailesh NAYAK, ۞ TPS ۞, shyam, sashijoseph
Author Post
Ajay
Fri Sep 14 2007, 01:31PM
Rickey's World Admin

 User Offline

Registered Member #1
Joined: Fri Feb 24 2006, 04:56AM

Posts: 3757
Thanked 697 times in 656 posts
what help you need? can you please create a new topic? this discussion is different from your requirement...



www.rickeyworld.info
If you feel satisfied with the user's forum reply please click on the thank button.

Obey forum rules!
Respect others!
Back to top


Ajay
Mon Sep 17 2007, 02:00AM
Rickey's World Admin

 User Offline

Registered Member #1
Joined: Fri Feb 24 2006, 04:56AM

Posts: 3757
Thanked 697 times in 656 posts
here is the complete code.. just read it.. see the instruction set carefully and try to imaging what is going on...
Test it on board directly.. and i cannot guarantee 100% working..
all you need to do is test it..

CODE:
;-------------------------------------------
;
;   Function of switches used in my program
;
;      SPDT = Auto/Manual
;      SW2 = Off
;      SW3 = Low
;      SW4 = Fast
;
;-------------------------------------------

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


Note: Temp 100° cannot be displayed on 2 7-segments.

www.rickeyworld.info
If you feel satisfied with the user's forum reply please click on the thank button.

Obey forum rules!
Respect others!
Back to top

8051 based temperature controlled fan   automatic fan control   seven segment display   



This post has been thanked 1 time
cenadius
Fri Sep 21 2007, 01:04AM
 User Offline
Registered Member #3470
Joined: Sun Aug 19 2007, 08:09AM

Posts: 34
Thanked 13 times in 11 posts
yeah!! At last my projects is ended,however it is a failure, but no matter what i wan post my highly appreciation here to AJAY who have give me so many help and guidelines in doing the coding part of this projects.

[ Edited Fri Sep 21 2007, 01:20AM ]

Back to top


Ajay
Fri Sep 21 2007, 02:02AM
Rickey's World Admin

 User Offline

Registered Member #1
Joined: Fri Feb 24 2006, 04:56AM

Posts: 3757
Thanked 697 times in 656 posts
I am sorry... for that failure.. but thats how you learn. it was a project work an assignment and if i would give you the code directly you could have never learn anything.
Now the working code is there in my last post so you can try it out
Thank you for your comments

www.rickeyworld.info
If you feel satisfied with the user's forum reply please click on the thank button.

Obey forum rules!
Respect others!
Back to top


cenadius
Fri Sep 21 2007, 02:29AM
 User Offline
Registered Member #3470
Joined: Sun Aug 19 2007, 08:09AM

Posts: 34
Thanked 13 times in 11 posts
actually my project failure is no bcause the code not working but the hardware got problem,it make my 8051 cant run,all my group mate even my senior also donno why, 1 of my lecture told e that my 7segment display got problem and have drag all the 8051 current and make it malfunction

Back to top


Ajay
Fri Sep 21 2007, 02:57AM
Rickey's World Admin

 User Offline

Registered Member #1
Joined: Fri Feb 24 2006, 04:56AM

Posts: 3757
Thanked 697 times in 656 posts
hmm.. i saw your circuit and it doesn't look like you have problem with the 7-seg. Could be that during development process of the project it got malfunctioned. Still the real problem could only be found if i see the controller or the board myself.

www.rickeyworld.info
If you feel satisfied with the user's forum reply please click on the thank button.

Obey forum rules!
Respect others!
Back to top


cenadius
Fri Sep 21 2007, 04:55AM
 User Offline
Registered Member #3470
Joined: Sun Aug 19 2007, 08:09AM

Posts: 34
Thanked 13 times in 11 posts
Ajay, can u put the comment on the code to make me can understand how the code that u write flow? thanks

Back to top


Ajay
Fri Sep 21 2007, 07:23AM
Rickey's World Admin

 User Offline

Registered Member #1
Joined: Fri Feb 24 2006, 04:56AM

Posts: 3757
Thanked 697 times in 656 posts
Sure i will update it...

www.rickeyworld.info
If you feel satisfied with the user's forum reply please click on the thank button.

Obey forum rules!
Respect others!
Back to top


cenadius
Wed Oct 03 2007, 04:11PM
 User Offline
Registered Member #3470
Joined: Sun Aug 19 2007, 08:09AM

Posts: 34
Thanked 13 times in 11 posts
hey,ajay,can u teach me how to write the delay code?my exam is near but i stil not understand on how to write the delay code,u just use any example u have and explain to me pls....

Back to top


Ajay
Thu Oct 04 2007, 05:52AM
Rickey's World Admin

 User Offline

Registered Member #1
Joined: Fri Feb 24 2006, 04:56AM

Posts: 3757
Thanked 697 times in 656 posts
can you start a new topic on this? i just don't want to confuse people...
There are common two methods to generate delay.. first is using timers and second is registers... so i will explain both of them and also answer your doubts. Please create another topic

www.rickeyworld.info
If you feel satisfied with the user's forum reply please click on the thank button.

Obey forum rules!
Respect others!
Back to top


Go to page  1 2 3 ... 9 [10] 11 12 13 14  

Jump:     Back to top

Syndicate this thread: rss 0.92 Syndicate this thread: rss 2.0 Syndicate this thread: RDF
Powered by e107 Forum System

8051 Microcontroller Projects 8051 AVR tutorials PIC microcontroller, 8051 assembly language programming electronics and communication ECE CSE pdf ebooks library BE final year project ideas Embedded systems