Discussion in "Project Help" started by    cenadius    Aug 19, 2007.
Thu Aug 23 2007, 06:07 PM
#11
well this function can be implemented later on.. because this is the final interface. First you need to write drivers for your peripherals like ADC, keys, Fan and its speed control and 7-segment LED. After you finish the basic building blocks of your project.. you can easily make the final interface.. I hope you got my point. So you can first start with the simplest.. "Fan switching and speed control".
where is your schematic?
 tienduhieu like this.
Fri Aug 24 2007, 12:52 PM
#12
i maybe want add something to my circuit so i remove it first.So can u teach me how to write the code for control the fan speed in manual mode?i need write the code to control fan speed for manual and auto separately or just write 1 can d?


[ Edited Fri Aug 24 2007, 12:54 PM ]
 tienduhieu like this.
Fri Aug 24 2007, 01:44 PM
#13
ok.. i tell you something.. controlling via manual or auto is the later part of your project it will be according to the keys user press.. that is the interface part. But basically you need to write for controlling and switching of FAN first.

And yes i will help you writing it..
So as i told you about PWM, you need a timer (either Timer 0 or Timer 1). and we need to load the timer for 2 different values, One for ON timer and one for OFF time (as explained for PWM square wave).
The value of ON, OFF depends on the mode selected by the user. i.e. If manual then you can have 5 preset values for user to select from and load them according to the selected value.
In automatic mode, i don't know how it suppose to work in auto mode..
So I hope you understood the basic idea.. can you make a simple code to generate a square wave? I will help you to modify it, according to your project waiting for your INPUT
 tienduhieulifeflowers86 like this.
Thu Aug 30 2007, 12:37 PM
#14
sorry for taking so long time to reply u.Do u know what software that can use to draw the circuit schematic?This is the simple code u ask me to do which can get square wave,this program is use to generate 1hz square wave by using timer 1 with duty circle 50%,deration for high low portion of square wave are 0.5 s,T=1s.


[ Edited Thu Aug 30 2007, 12:40 PM ]
 tienduhieu like this.
Thu Aug 30 2007, 12:43 PM
#15
this is my code,why i cannot attch file?i wan attach the file that contain my code but cannot so i have to type it here


ORG 0000
MOV TMOD,#10H ;TIMER 1 IN MODE 1
MAIN: MOV R0,#10 ;COUNTER FOR 10 LOOPING
REPEAT: MOV TH1,#3CH ;MOVE 3CH INTO TH0
MOV TL1,#0B0H ;MOVE B0H INTO TL0
SETB TR1 ;START THE TIMER 1
LOOP: JNB TF1,LOOP ;WAIT FOR TIMER1 OVERFLOW
CLR TR1 ;STOP TIMER 1
CLR TF1 ;CLEAR TIMER 1 OVERFLOW FLAG
DJNZ R0,REPEAT ;IF R0 NOT ZERO GO TO REPEAT
CPL P1.0 ;COMPLEMENT P1.0 TO GET HIGH OR LOW
SJMP MAIN ;RELOAD TH1&TL1
END





[ Edited Thu Aug 30 2007, 01:04 PM ]
 tienduhieulifeflowers86 like this.
Thu Aug 30 2007, 01:04 PM
#16
ok.. but.. i wanted you to make it with timer.. for PWM, the delay should be less otherwise your motor will not run smooth.. you can try connecting an LED to the port to see that.. it will flicker a lot..
where as if you use keep delay smaller like timer in a 13-bit mode.. then you will see a variation in voltage instead of flickering..
I am attaching a sample PWM code for you.. take a look.

MOV R7, #160   ; set pulse width control to dim


The above part of the code will determine the output voltage level. you can test this code.. by changing the value of R7.
 tienduhieu like this.
Thu Aug 30 2007, 01:05 PM
#17
I think there is some problem with the attachment of file.. i need to check that..
By the time.. please try to paste the code..

here is a sample PWM code.. check it..
org 0H
sjmp start
org 0BH
TIMER_0_INTERRUPT:
   JB F0, HIGH_DONE    ; If F0 is set then we just finished the high section of the
LOW_DONE:              ;   cycle so Jump to HIGH_DONE
   SETB F0             ; Make F0=1 to indicate start of high section
   SETB P1.0           ; Turn off LED
   MOV TH0, R7         ; Load high byte of timer with R7 (pulse width control value)
   CLR TF0             ; Clear the Timer 0 interrupt flag
   RETI                ; Return from Interrupt to where the program came from
HIGH_DONE:
   CLR F0              ; Make F0=0 to indicate start of low section
   CLR P1.0            ; Turn on LED
   MOV A, #0FFH         ; Move FFH (255) to A
   CLR C               ; Clear C (the carry bit) so it does not affect the subtraction
   SUBB A, R7          ; Subtract R7 from A. A = 255 - R7.
   MOV TH0, A          ; so the value loaded into TH0 + R7 = 255
   CLR TF0             ; Clear the Timer 0 interrupt flag
   RETI                ; Return from Interrupt to where the program came from 
start:
	MOV TMOD,#00H
	SETB TR0           ; turn on timer 0
	SETB EA            ; Enable Interrupts
	SETB ET0           ; Enable Timer 0 Interrupt
	MOV R7, #160      ; set pulse width control to dim
LOOP:
   SJMP LOOP          ;go to LOOP
   END


[ Edited Thu Aug 30 2007, 01:08 PM ]
 tienduhieulifeflowers86 like this.
Tags PWMpulse width modulation8051 PWM codePWM sample code
Thu Aug 30 2007, 01:08 PM
#18
ok,thanks,but how u see the delay in my code?actually i found this code from book and modify it so i no very understand,and do u know what software that can use to draw the circuit schematic?
 tienduhieu like this.
Thu Aug 30 2007, 01:13 PM
#19
you can use orcad for making schematic.. but is not a free software... the schematic u showed me is made in protel. you can use the same software. or try some free software on internet like eagle.
 tienduhieu like this.
Thu Aug 30 2007, 01:54 PM
#20
Can u explain the function of this PWM code?why we need control output voltage level?The output voltage will affect which part of function of hardware?i not very understand,i am sorry that i only know ask question but i try to learn all this thing through doing this assignment,so i do it all by my own.
 tienduhieulifeflowers86 like this.

Get Social

Information

Powered by e107 Forum System

Conversation

Fri Aug 07 2020, 08:01 AM
Tony Eldredge
{{Are You interested|Interested|Would you be interested} in {advertising|an advertising service} that {costs|charges} less than {$50|$40|$49|$39} {per month|monthly|every month} and {delivers|sends} {hundreds|thousands|tons} of people who are ready to buy directly to your website? {Check out|Visit|Have a look at|For details visit}: http://www.getwebsitevisitors.xyz |{Looking for fresh buyers?|Want more visitors for your website?|Do you want more people to visit your website?} {Get|Receive} {hundreds|thousands|tons} {of people who are ready to buy sent directly to your website|of keyword targeted visitors directly to your site}. {Boost your profits|Boost revenues} {fast|quick|super fast}. Start seeing results in as little as 48 hours. {For more info|To get details|For additional information|To get info} {Check out|Visit|Have a look at}: http://www.getwebsitevisitors.xyz
Thu Jun 11 2020, 06:27 AM
anudee
sir could please send the code for I2C and wifi interfacing with 8051
scena
Tue May 19 2020, 10:29 PM
Does anyone have microcontroller programming software for STC15F104W (core 8051, 4 k, 128 byte, 6 I/O pin, UART ... DIL8), that works?
Sat May 02 2020, 07:38 PM
Tamu Gurung
Hi I am looking for a assembly language program for a digital decimal counter. Time counts max limit of 2 mins starting from 2.00 mins and ending at 0.00. time is to be displayed on 4 7-segment LED displays. Edsim51 simulator to be used. Thanks
Wed Mar 25 2020, 01:39 PM
Tajammul
Sir kindly send the code file i2c for 8051
ExperimenterUK
Fri Mar 13 2020, 10:36 PM
@ Rohitnani,ABEBE..which project ?
Fri Mar 13 2020, 12:55 PM
ABEBE
how can get hadwere of this project
Rohitnani
Sat Mar 07 2020, 05:11 PM
Sir, Could you please send me the zip file input password....
Wed Feb 26 2020, 04:58 PM
Peter Parker
Is it possible to send multiple messages using only 1 GSM module?
Sat Feb 01 2020, 10:12 AM
Pearl Olin
Hello,

Downloads

Comments

Mirza123
Thu Jun 25 2020, 03:46 PM
eunicelove124
Mon Jun 22 2020, 03:03 PM
cerouno
Tue Jun 16 2020, 05:10 PM
Marce
Sat Jun 13 2020, 09:43 PM
Davidthils
Thu May 21 2020, 12:44 PM
Jakeror
Thu May 21 2020, 01:28 AM
motorCar
Wed May 20 2020, 07:05 PM
Vordrync
Wed May 20 2020, 11:52 AM

Online

Guests: 66, Members: 0 ...

most ever online: 182184
(Members: , Guests: 182184) on 06 Aug 2010: 05:37 AM

Members: 38215
Newest member: Mirza123
Forum Activity
liqian Avatar
Posted By liqian
Fri Aug 07 2020, 03:31 AM
I found the part on here https://www.jotrin.com/pr...
ExperimenterUK Avatar
Posted By ExperimenterUK
Wed Jul 01 2020, 11:07 PM
PS: I am a new learner thats why my question may s...
Mirza123 Avatar
Posted By Mirza123
Wed Jul 01 2020, 02:05 PM
Thanks for the assistance. I have read the data sh...
ExperimenterUK Avatar
Posted By ExperimenterUK
Wed Jul 01 2020, 10:12 AM
See section 15 (Ports) of the data sheet. ...
wimac Avatar
Posted By wimac
Tue Jun 30 2020, 10:05 AM
How did you know that it is not 8051. Mirza123It i...
Mirza123 Avatar
Posted By Mirza123
Tue Jun 30 2020, 08:39 AM
It seems ports on the AT89LP2052 is not like on th...
ExperimenterUK Avatar
Posted By ExperimenterUK
Tue Jun 30 2020, 08:34 AM
It seems ports on the AT89LP2052 are not like on t...
Mirza123 Avatar
Posted By Mirza123
Thu Jun 25 2020, 04:07 PM
Hello!i am trying to use AT89LP2052 ( AT89LP2052 h...
ExperimenterUK Avatar
Posted By ExperimenterUK
Wed Jun 17 2020, 09:42 PM
It is about capacitor? i should put it between Vcc...
cerouno Avatar
Posted By cerouno
Wed Jun 17 2020, 10:37 AM
Take another look at the power supply to the LCD.A...