Program 5:-
Now its time to start with harder programs. In this program all above facilities are there and two more are included increasing and decreasing RPM. Five switches and four LEDs are used. See the table for key functions and LED indications.
f equ 0fh ; direction flag
Org 00h
mov 30h, #3Ch ; make a table of
mov 31h, #1Eh ; four load values
mov 32h, #14h ; for variable delay
mov 33h, #0Fh
mov r1, #30h ;initial location in r1
mov r0,#01h ; initialize key count
mov p1,#0ffh ; P1 as input port
lop: mov a,p1
cjne a,#0ffh,jmp
ajmp lop ; loop until any key
; is pressed
jmp: clr p0.0 ; indicates keypress
loop: rrc a
jnc num ; get key no.
inc r0
sjmp loop
num: acall dely ; key debounce delay
setb p0.0
cjne r0,#01h,nxt ; for 1st key
acall clkwise ; rotate motor
sjmp over ; clock wise
nxt: cjne r0,#02h,nxt2 ; for 2nd key
acall aclkwise ; rotate anticlock
nxt2: cjne r0,#03h,nxt3 ; for 3rd key
mov p2,#00h ; stop motor
nxt3: cjne r0,#04h,nxt4 ; for 4th key
acall incrpm ; increase RPM
jnb f, aclk ; and continue to rotate
acall clkwise ; motor in same
sjmp over ; direction as it was
aclk: acall aclkwise ; running by
sjmp over ; checking flag f
nxt3: cjne r0,#05h,over ; for 5th key
acall decrpm ; decrease RPM and
jnb f, aclkw ; again continue to
acall clkwise ; rotate motor
sjmp over
aclks: acall aclkwise
sjmp over
over: mov r0,#01h
sjmp lop ; jump to loop again
clkwise:
setb f ; for clkwise set directional
lop: clr p0.1 ; flag
mov p2,#03h ; at a time two coils
acall delay ; energized in double
mov p2,#06h ; coil excitation mode
acall delay
setb p0.1
mov p2,#0Ch
acall delay
mov p2,#09h
acall delay
mov p1, #0FFh ; continue loop
mov a,p1 ; until any key is
cjne a,#0FFh,out ; not pressed
sjmp lop
out: ret
aclkwise:
clr f ; for aclkwise clear
lop1: clr p0.1 ; directional flag
mov p2,#03h
acall delay
mov p2,#09h ; revert the pulse
acall delay ; sequence for
setb p0.1
mov p2,#0Ch ; anticlockwise
acall delay
mov p2,#06h
acall delay
mov p1, #0FFh
mov a,p1
cjne a,#0FFh,out1
sjmp lop1
out1: ret
incrpm:
clr p0.3 ; indication
cjne r1,#33h,incr ; if max limit is
ajmp noin ; reached no increase
incr: inc r1 ; increase otherwise
acall dely
setb p0.3
noin: ret ; led stays on for max limit
decrpm:
clr p0.3 ; indication
cjne r1,#30h,incr ; if min limit is
ajmp noin ; reached no decrease
incr: dec r1 ; decrease otherwise
acall dely
setb p0.3
noin: ret ; led stays on for min limit
delay:
mov 10h,@r1 ; load content of
lop2: mov r6,#FAh ; address in r1
lop1:nop ; so it gives variable
nop ; delay every time
djnz 10h,lop1 ; to give variable
djnz r5,lop2 ; speed of motor
ret
dely:
mov r5,#0C8h ; load count 200
lop2: mov r6,#0FAh ; for 200ms delay
lop1:nop
nop
djnz r6,lop1
djnz r5,lop2
ret
end
da program gives syntax error when it is build in keil software.
its give error for cjne a,#0ffh,jmp. n
jmp clr p0.0……..
Hi, here jmp is used as a label. Please change jmp to some other name. for example
cjne a,#0ffh,keypress
keypress: clr p0.0
it also gives error here
lop2:mov r6,#FAh ; give 1 ms delay :the error is undefined symbol(pass 2).
lop2: mov r6,#0FAh ; for 200ms delay : attempt to define already defined label.
lop1: nop attempt to define already defined label.
hi plz tell me abt these error in program
n i m using of Seiko epson EM-198.
will it operate with 7805.
Hi replace “dely” function as given below.
———————-
dely:
mov r5,#0C8h ; load count 200
lop22: mov r6,#0FAh ; for 200ms delay
lop11:nop
nop
djnz r6,lop11
djnz r5,lop22
ret
———————–
Nothing seems to be easier than seeing someone whom you can help but not helping.
I suggest we start giving it a try. Give love to the ones that need it.
God will appreciate it.
I’m new here on the forum, found it by searching google. I look forward to chatting about various topics with all of you.
It is interesting. Can you mail me the full details of the circuits
Good stuff. I like this blog. I will subscribe to it.
very good circuit … can you mail the full details and explainations of the circuit.
can u tell me how to control pitman motor using at89s51 through h bridge give ,jut move the motor in forward and reverse direction ,and also give me a small cobe to drive the motor through h bridge using at89s51
sperb thank u
А телефон свой не оставите? Хотелось бы кое-что обсудить по теме.
hey the project is nice but is there any problem in the programs is they give error
hi, please give the full information about the stepper motor
Nice project for learners. Is it available in kit form at a reasonable price?
Are the problems solved or still existing?
Cheers, superb post.
Hi . . .can you mail me the full detail of the circuit diagram and the
program.
AS THIS IS IN ASSEMBLY AND NOT IN ‘C’ DONT USE KEIL USE “ASEM” OR “RAISONANCE” INSTEAD.
in new ustzz
Hi there, just wandered by. I have a Cincinnati 4g site. Amazing the amount of information on the web. Wasn’t what I was looking for, but great site. Take care.
hello sir,
I am a final year student of electronics and communication engineering and project implementation. please i need the complete circuit diagram. and I sincerely request you to send the full schematic of the “high-rise car park automation systems” my email id nguyenlinh1092@gmail.com
plz snd me keil code anyone
thankx alot
plz snd me any one keil code
thankx guys
Hi to every one, since I am truly keen of reading this blog post to be updated daily. It contains pleasant information.
hello sir pls send the keil c program for this control circuit
thank u