Discussion in "Project Doubts" started by    sankalp_s    Nov 29, 2014.
Thu Dec 18 2014, 04:24 AM
#11
Code is all ok.. just change EXT0 to EX0... By mistake I wrote the wrong bit name. EX0 is for external interrupt 0.
 sankalp_s like this.
Thu Dec 18 2014, 08:32 PM
#12
SIR THIS CODE IS NOT WORKING..

ORG 000H ; starting address
SJMP LABEL
ORG 13H
    JNB P3.3, $
    RETI
SJMP LABEL1

LABEL1:
SETB EX1 ; Enable external interrupt 1
SETB EA   ; Enable interrupts

L1 EQU	 P1.2 ;LED CONECTED TO THIS PORT	
L2 EQU	 P1.3 ;LED CONECTED TO THIS PORT
L3 EQU   P1.4 ;LED CONECTED TO THIS PORT
L4 EQU   P1.5 ;LED CONECTED TO THIS PORT
L5 EQU   P1.6 ;LED CONECTED TO THIS PORT
L6 EQU   P1.7 ;LED CONECTED TO THIS PORT


LABEL:	
MOV R3, #05 ;REPEtion of pattern 
D7:	CALL DESGN7
DJNZ R3,D7	
MOV R3, #05 ;REPEtion of pattern 
D8:	CALL DESGN8
DJNZ R3,D8	
MOV R3, #05 ;REPEtion of pattern 
D9:	CALL DESGN9
DJNZ R3,D9	
JMP LABEL

DESGN7:	CALL ALLON 
CALL DELAY
SETB L1
CALL DELAY
SETB L2
CALL DELAY
SETB L3
CALL DELAY
SETB L4
CALL DELAY
SETB L5
CALL DELAY
SETB L6
CALL DELAY
CALL DELAY	
SETB L6
CALL DELAY	
SETB L5
CALL DELAY	
SETB L4
CALL DELAY	
SETB L3
CALL DELAY	
SETB L2
CALL DELAY
SETB L1
CALL DELAY
RET

DESGN8:	CALL ALLON
SETB L6
SETB L1
CALL DELAY
CALL ALLON	
SETB L5
SETB L2
CALL DELAY
CALL ALLON	
SETB L4
SETB L3
CALL DELAY
RET

DESGN9:	CALL ALLON 
CALL DELAY	
SETB L6
CALL DELAY	
SETB L5
CALL DELAY	
SETB L4
CALL DELAY	
SETB L3
CALL DELAY	
SETB L2
CALL DELAY
SETB L1
CALL DELAY
RET	

CLEAR:	SETB L1
SETB L2
SETB L3
SETB L4
SETB L5
SETB L6
RET

ALLON:	CLR L1
CLR L2
CLR L3
CLR L4
CLR L5
CLR L6
RET

DELAY:	MOV R0,#0FFH
INLOP:	MOV R1,#0FFH
DJNZ R1,$
DJNZ R0,INLOP
RET
END

Thu Dec 18 2014, 08:36 PM
#13



i've tried this code but faced a syntax error on line of setb ext0...
( Symbol not defined: ext0)

sankalp_s


Which compilier are you using ?



sir one thing more can u give me the while loop code
example for my requirement ..

sankalp_s



ORG 03H
JNB P3.2, $
RETI

This is all the code you need to freeze the display.


can i use pin int1 for this operation?

sankalp_s


Yes, but the code changes to..
    ORG 13H
    JNB P3.3, $
    RETI

//and 
SETB EXT1 ; Enable external interrupt 1
SETB EA   ; Enable interrupts


An alternative method does not use an interrupt.
Monitor the key in the delay routine.
DELAY: MOV R0,#0FFH
INLOP: MOV R1,#0FFH
buttonTest:             ;button is the input pin 
JNB button, buttonTest  ;wait while pressed
DJNZ R1,buttonTest
DJNZ R0,INLOP
RET


ExperimenterUK





I'm using mcu8051ide for compiling..
and sorry sir the alternate code is also not working..
Thu Dec 18 2014, 08:40 PM
#14


SIR THIS CODE IS NOT WORKING..

ORG 000H ; starting address
SJMP LABEL
ORG 13H
    JNB P3.3, $
    RETI
SJMP LABEL1

LABEL1:
SETB EX1 ; Enable external interrupt 1
SETB EA   ; Enable interrupts

L1 EQU	 P1.2 ;LED CONECTED TO THIS PORT	
L2 EQU	 P1.3 ;LED CONECTED TO THIS PORT
L3 EQU   P1.4 ;LED CONECTED TO THIS PORT
L4 EQU   P1.5 ;LED CONECTED TO THIS PORT
L5 EQU   P1.6 ;LED CONECTED TO THIS PORT
L6 EQU   P1.7 ;LED CONECTED TO THIS PORT


LABEL:	
MOV R3, #05 ;REPEtion of pattern 
D7:	CALL DESGN7
DJNZ R3,D7	
MOV R3, #05 ;REPEtion of pattern 
D8:	CALL DESGN8
DJNZ R3,D8	
MOV R3, #05 ;REPEtion of pattern 
D9:	CALL DESGN9
DJNZ R3,D9	
JMP LABEL

DESGN7:	CALL ALLON 
CALL DELAY
SETB L1
CALL DELAY
SETB L2
CALL DELAY
SETB L3
CALL DELAY
SETB L4
CALL DELAY
SETB L5
CALL DELAY
SETB L6
CALL DELAY
CALL DELAY	
SETB L6
CALL DELAY	
SETB L5
CALL DELAY	
SETB L4
CALL DELAY	
SETB L3
CALL DELAY	
SETB L2
CALL DELAY
SETB L1
CALL DELAY
RET

DESGN8:	CALL ALLON
SETB L6
SETB L1
CALL DELAY
CALL ALLON	
SETB L5
SETB L2
CALL DELAY
CALL ALLON	
SETB L4
SETB L3
CALL DELAY
RET

DESGN9:	CALL ALLON 
CALL DELAY	
SETB L6
CALL DELAY	
SETB L5
CALL DELAY	
SETB L4
CALL DELAY	
SETB L3
CALL DELAY	
SETB L2
CALL DELAY
SETB L1
CALL DELAY
RET	

CLEAR:	SETB L1
SETB L2
SETB L3
SETB L4
SETB L5
SETB L6
RET

ALLON:	CLR L1
CLR L2
CLR L3
CLR L4
CLR L5
CLR L6
RET

DELAY:	MOV R0,#0FFH
INLOP:	MOV R1,#0FFH
DJNZ R1,$
DJNZ R0,INLOP
RET
END


sankalp_s




sir can you explain what is missing in this code?
what would value of R3 in this code.
Fri Dec 19 2014, 12:21 AM
#15
This version works.
Edit it to use either method.


ORG 000H ; starting address
SJMP LABEL
ORG 13H
    JNB P3.3, $
    RETI


L1 EQU	 P1.2 ;LED CONECTED TO THIS PORT	
L2 EQU	 P1.3 ;LED CONECTED TO THIS PORT
L3 EQU   P1.4 ;LED CONECTED TO THIS PORT
L4 EQU   P1.5 ;LED CONECTED TO THIS PORT
L5 EQU   P1.6 ;LED CONECTED TO THIS PORT
L6 EQU   P1.7 ;LED CONECTED TO THIS PORT


LABEL:	
;SETB EX1 ; Enable external interrupt 1
;SETB EA   ; Enable interrupts

MOV R3, #05 ;REPEtion of pattern 
D7:	CALL DESGN7
DJNZ R3,D7	
MOV R3, #05 ;REPEtion of pattern 
D8:	CALL DESGN8
DJNZ R3,D8	
MOV R3, #05 ;REPEtion of pattern 
D9:	CALL DESGN9
DJNZ R3,D9	
JMP LABEL

DESGN7:	CALL ALLON 
CALL DELAY
SETB L1
CALL DELAY
SETB L2
CALL DELAY
SETB L3
CALL DELAY
SETB L4
CALL DELAY
SETB L5
CALL DELAY
SETB L6
CALL DELAY
CALL DELAY	
SETB L6
CALL DELAY	
SETB L5
CALL DELAY	
SETB L4
CALL DELAY	
SETB L3
CALL DELAY	
SETB L2
CALL DELAY
SETB L1
CALL DELAY
RET

DESGN8:	CALL ALLON
SETB L6
SETB L1
CALL DELAY
CALL ALLON	
SETB L5
SETB L2
CALL DELAY
CALL ALLON	
SETB L4
SETB L3
CALL DELAY
RET

DESGN9:	CALL ALLON 
CALL DELAY	
SETB L6
CALL DELAY	
SETB L5
CALL DELAY	
SETB L4
CALL DELAY	
SETB L3
CALL DELAY	
SETB L2
CALL DELAY
SETB L1
CALL DELAY
RET	

CLEAR:	SETB L1
SETB L2
SETB L3
SETB L4
SETB L5
SETB L6
RET

ALLON:	CLR L1
CLR L2
CLR L3
CLR L4
CLR L5
CLR L6
RET

DELAY:	MOV R0,#0FFH
INLOP:	MOV R1,#0FFH
buttonTest:            
;JNB P3.3, buttonTest  ;enable this line wait while pressed
DJNZ R1,buttonTest

DJNZ R0,INLOP
RET
END




[ Edited Fri Dec 19 2014, 12:40 AM ]
 sankalp_s like this.
Fri Dec 19 2014, 06:04 PM
#16


This version works.
Edit it to use either method.


ORG 000H ; starting address
SJMP LABEL
ORG 13H
    JNB P3.3, $
    RETI


L1 EQU	 P1.2 ;LED CONECTED TO THIS PORT	
L2 EQU	 P1.3 ;LED CONECTED TO THIS PORT
L3 EQU   P1.4 ;LED CONECTED TO THIS PORT
L4 EQU   P1.5 ;LED CONECTED TO THIS PORT
L5 EQU   P1.6 ;LED CONECTED TO THIS PORT
L6 EQU   P1.7 ;LED CONECTED TO THIS PORT


LABEL:	
;SETB EX1 ; Enable external interrupt 1
;SETB EA   ; Enable interrupts

MOV R3, #05 ;REPEtion of pattern 
D7:	CALL DESGN7
DJNZ R3,D7	
MOV R3, #05 ;REPEtion of pattern 
D8:	CALL DESGN8
DJNZ R3,D8	
MOV R3, #05 ;REPEtion of pattern 
D9:	CALL DESGN9
DJNZ R3,D9	
JMP LABEL

DESGN7:	CALL ALLON 
CALL DELAY
SETB L1
CALL DELAY
SETB L2
CALL DELAY
SETB L3
CALL DELAY
SETB L4
CALL DELAY
SETB L5
CALL DELAY
SETB L6
CALL DELAY
CALL DELAY	
SETB L6
CALL DELAY	
SETB L5
CALL DELAY	
SETB L4
CALL DELAY	
SETB L3
CALL DELAY	
SETB L2
CALL DELAY
SETB L1
CALL DELAY
RET

DESGN8:	CALL ALLON
SETB L6
SETB L1
CALL DELAY
CALL ALLON	
SETB L5
SETB L2
CALL DELAY
CALL ALLON	
SETB L4
SETB L3
CALL DELAY
RET

DESGN9:	CALL ALLON 
CALL DELAY	
SETB L6
CALL DELAY	
SETB L5
CALL DELAY	
SETB L4
CALL DELAY	
SETB L3
CALL DELAY	
SETB L2
CALL DELAY
SETB L1
CALL DELAY
RET	

CLEAR:	SETB L1
SETB L2
SETB L3
SETB L4
SETB L5
SETB L6
RET

ALLON:	CLR L1
CLR L2
CLR L3
CLR L4
CLR L5
CLR L6
RET

DELAY:	MOV R0,#0FFH
INLOP:	MOV R1,#0FFH
buttonTest:            
;JNB P3.3, buttonTest  ;enable this line wait while pressed
DJNZ R1,buttonTest

DJNZ R0,INLOP
RET
END



ExperimenterUK



Thank u so much sir for your quick response..
sir code which is posted last time by u is working.. but when interrupt occurs then main function do not work.. only led blow continuously.. but i want something else

I'm very sorry sir it was my mistake that i could no explain exact need.

ok i explain what i want to do.

please look this code


MOV R3, #05 ;REPEtion of pattern 
D7:	CALL DESGN7
DJNZ R3,D7	
MOV R3, #05 ;REPEtion of pattern 
D8:	CALL DESGN8
DJNZ R3,D8	
MOV R3, #05 ;REPEtion of pattern 
D9:	CALL DESGN9
DJNZ R3,D9


first design is D7 , there is line MOV R3, #05 it means D7 will repeat 5 time, then D8 will execute, & after that D9,,
suppose D7 is running, and when we press the switch then repetition number of D7 should be infinite means when is switch pressed then only D7 should will execute, and when switch goes its earlier condition means off condition then design will repeat only five time, after it D8 will execute n after D9 by the chip.
this interrupt should work for every design.

sorry for my mistake, i think this is enough explanation..


[ Edited Fri Dec 19 2014, 06:05 PM ]
Fri Dec 19 2014, 09:58 PM
#17
For what you want,it is easier to not use interrupts.
If the pattern gets much more complicated,
using an interrupt may be better.

Don't enable interrupts and change your code to this.

MOV R3, #05 ;REPEtion of pattern 
D7:	CALL DESGN7
JNB P3.3,D7 
DJNZ R3,D7	


MOV R3, #05 ;REPEtion of pattern 
D8:	CALL DESGN8
JNB P3.3,D8
DJNZ R3,D8	

MOV R3, #05 ;REPEtion of pattern 
D9:	CALL DESGN9
JNB P3.3,D9
DJNZ R3,D9
 ajay_bhargavsankalp_s like this.
Sat Dec 20 2014, 05:31 PM
#18


For what you want,it is easier to not use interrupts.
If the pattern gets much more complicated,
using an interrupt may be better.

Don't enable interrupts and change your code to this.

MOV R3, #05 ;REPEtion of pattern 
D7:	CALL DESGN7
JNB P3.3,D7 
DJNZ R3,D7	


MOV R3, #05 ;REPEtion of pattern 
D8:	CALL DESGN8
JNB P3.3,D8
DJNZ R3,D8	

MOV R3, #05 ;REPEtion of pattern 
D9:	CALL DESGN9
JNB P3.3,D9
DJNZ R3,D9

ExperimenterUK




Thanks a lot sir, its working,
great support, quick response,thanks admin sir & co admin sir..

i've some queries more about this project..
first one is,
if i using 2051 chip then how can i use ANALOG COMPARATOR for blinking speed control of design by the external controller like potentio meter. and what would be code for it?


[ Edited Sat Dec 20 2014, 05:40 PM ]
Sun Dec 21 2014, 10:16 PM
#19


Thanks a lot sir, its working,
great support,

sankalp_s


Thank you.


i've some queries more about this project..
first one is,
if i using 2051 chip then how can i use ANALOG COMPARATOR for blinking speed control of design by the external controller like potentio meter. and what would be code for it?

sankalp_s


The ANALOG COMPARATOR on the 2051 seems to be
just a comparator , that is , not programmable.
You will need extra hardware to use it.

I would suggest adding a 555 timer circuit that generates a
square wave controlled by a pot.
Then just measure the frequency or length of the square waves.



[ Edited Mon Dec 22 2014, 12:35 AM ]
Mon Dec 22 2014, 04:52 PM
#20



Thanks a lot sir, its working,
great support,

sankalp_s


Thank you.


i've some queries more about this project..
first one is,
if i using 2051 chip then how can i use ANALOG COMPARATOR for blinking speed control of design by the external controller like potentio meter. and what would be code for it?

sankalp_s


The ANALOG COMPARATOR on the 2051 seems to be



ExperimenterUK


but sir i have seen speed controlling in 2051 chip without 555 ic,
sir my second query is, there are three program in side the code:
for example in program 1st has three design, program 2nd has two design program 3rd has six design,
now i'm using any two pin for call these design. (ie.pin p3.2 & p3.3)
if no any pin is low then only program 1 will be run
if 3.2 then only program 2
& when 3.3 then only program 3
is this possible with JB & JNB instruction?
i've tried but only 1 program works,
could you please give me code for that.

Get Social

Information

Powered by e107 Forum System

Conversation

Sarvn
Sat Jul 22 2017, 05:12 PM
I wnt to learn embedded could anyone help me
Sarvn
Sat Jul 22 2017, 05:11 PM
Hi
Wed Jul 12 2017, 02:34 PM
Ushiwaka
Any good guides on how to interface an 8255 w/ an 8051?
Tue Jul 11 2017, 06:22 PM
Chiko
i need seconds added to this circuit, can you help me modify it and add codes too
ExperimenterUK
Thu Jul 06 2017, 01:25 AM
@martinsnc115877 The hex file is here http://www.8051projects.net/forum-t65048-post.html
martinsnc115877
Sun Jul 02 2017, 04:28 PM
sir, sorry for the disturbance I can find the small and capital letter,hex file, please send it to me
Sun Jul 02 2017, 11:45 AM
Sam Raj
Can I have the circuit of Simple Digital Voltmeter using 8051
ExperimenterUK
Sun Jul 02 2017, 02:09 AM
Read this http://www.8051projects.net/forum-t65048-post.html. The project download contains lower case letters. It is compiled in Keil
martinsnc115877
Sat Jul 01 2017, 10:45 PM
I mean scrolling massage display using 8051 by pratrik suthar, the hex file I have is just only the capital letters I need the capital letters and the small letters hex, and I will like to no the compiler name he used for the code thanks
ExperimenterUK
Sat Jul 01 2017, 09:13 PM
@martinsnc115877 which project..link ?

Downloads

Comments

Sarvn
Sat Jul 22 2017, 11:34 AM
diablom
Fri Jul 21 2017, 01:44 PM
Alihaider.007
Thu Jul 20 2017, 03:07 PM
Vijaykumarsharma
Fri Jul 14 2017, 11:08 AM
varma495
Tue Jul 11 2017, 01:55 AM
Ramweit
Sat Jul 08 2017, 01:42 PM
Ben_J1
Fri Jul 07 2017, 04:32 PM
labsdg
Fri Jul 07 2017, 02:58 AM

Online

Guests: 50, Members: 0 ...

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

Members: 37860
Newest member: Sarvn
Forum Activity
ExperimenterUK Avatar
Posted By ExperimenterUK
Thu Jul 20 2017, 04:08 PM
can it be possible ?? Alihaider.007No.You will nee...
Alihaider.007 Avatar
Posted By Alihaider.007
Thu Jul 20 2017, 03:14 PM
Sir I am using AT89S8253 I have trying to use this...
Utsavi Avatar
Posted By Utsavi
Mon Jul 17 2017, 09:57 AM
Hello Ajay_Bhargav,Thanks for your reply. Yes, you...
ajay_bhargav Avatar
Posted By ajay_bhargav
Mon Jul 17 2017, 06:41 AM
I do not think it would be a good idea to kind of ...
ajay_bhargav Avatar
Posted By ajay_bhargav
Mon Jul 17 2017, 06:32 AM
Tasking EDE has linker script facility available y...
Ramweit Avatar
Posted By Ramweit
Thu Jul 13 2017, 06:58 AM
Thank you for response,Sim300 gsm Modem am using h...
ExperimenterUK Avatar
Posted By ExperimenterUK
Tue Jul 11 2017, 04:20 PM
After the SMS is sent the modem should respond+CMG...
Ramweit Avatar
Posted By Ramweit
Tue Jul 11 2017, 02:37 PM
From this code gsm modem sending SMS to mobiles mu...
ExperimenterUK Avatar
Posted By ExperimenterUK
Mon Jul 10 2017, 06:09 PM
@RamweitWhat is it you want to know ?
Ramweit Avatar
Posted By Ramweit
Sat Jul 08 2017, 02:12 PM
#include<reg51.h>#include<stdio.h>bit moreov...