Discussion in "Project Doubts" started by    sankalp_s    Nov 30, 2014.
Fri Feb 20 2015, 12:43 am
#31



sir any alternate option for making mirror effect actually the code i'm using for mirroring is taking much space.

sankalp_s


What is mirroring ?


Thank you Dear experimenteruk sir.. its working after completion of all design of running program. what can we do for instant change of program..please suggest.

sankalp_s


This code should do it.
It makes the "DELAY: " routine return to the main loop.
Remember it works here because "DELAY: " is always
3 calls away from the main loop.
This method is not usually a safe method.
popByte  equ 0x40  ;dump stack here ; (add to top of program)

DELAY: 
JNB P3.2,FULL
JB P3.1,$
JNB P3.2,FULL
JNB P3.1,$
JNB P3.2,FULL
RET
;************************************************* ***********************************************
; ROUTINE FOR BREAK
;************************************************* ***********************************************

FULL: MOV P1,#11000000B
JNB P3.2,$
MOV P1,#11111111B
pop popByte ;dump return address
pop popByte ;dump return address
pop popByte ;dump return address
pop popByte ;dump return address
RET


ExperimenterUK


Sir its also not working.
the result is same as before we got.
Fri Feb 20 2015, 04:58 am
#32


Sir its also not working.
the result is same as before we got.

sankalp_s


Saying "it's not working" does not really help.

What are you doing.. ?
what does the display do ?
What do you expect it to do ?
Please zip and post your latest code.

Sat Feb 21 2015, 01:23 am
#33



Sir its also not working.
the result is same as before we got.

sankalp_s


Saying "it's not working" does not really help.

What are you doing.. ?
what does the display do ?
What do you expect it to do ?
Please zip and post your latest code.


ExperimenterUK


sir program is not changing when switch is pressed.. it changes after completion of all design of particular program.
suppose when circuit starts, the default program runs but as i press the switch, it makes no changes until all design of "program 0" is being executed.
i want to change program by pressing the switch immediately.

Sat Feb 21 2015, 07:10 am
#34
Okay..first your problem seemed complicated..
then it seemed simple
then it didn't work
Finally , try this.

I put most of your program text into an "include file".
This keeps thing tidy, it does not affect how the program works.
Just keep the .asm file in the same folder as the .inc file.

I also put back the software delay.
partly to help with testing, but also because it is better than using
a 555.
Do you have a reason to use a 555 ?

Attachment


[ Edited Sat Feb 21 2015, 07:22 am ]
Sun Feb 22 2015, 01:28 am
#35
Thank u very much sir.. still there is an issue with code, it is working with momentory switch. means when switch is pressed then program not works only one led blow. as switch get released then program change according to the code.
i want to run program during switch is pressed.
and please tell me which compiler should be used for compiling with inc file. because i'm using mcu8051 ide but i'm unable to compile with inc file so put the code in asm file then compiled the asm code.



[ Edited Sun Feb 22 2015, 11:27 am ]
Sun Feb 22 2015, 01:37 am
#36


Do you have a reason to use a 555 ?

sankalp_s


Actually sir, variable delay is my need, so i'm using 555,
sir please please help me for make it with 555.
Mon Feb 23 2015, 01:50 am
#37


i want to run program during switch is pressed.
and please tell me which compiler should be used for compiling with inc file. because i'm using mcu8051 ide but i'm unable to compile with inc file so put the code in asm file then compiled the asm code.

sankalp_s


I use uVision from Keil, but I would expect most assemblers to
accept include files.
mcu8051 ide might need different instructions.
I would have to pay for mcu8051 ide so have not tried it

I think this version does what you want.
It can use software delays or a 555.

Attachment


[ Edited Mon Feb 23 2015, 01:55 am ]
 sankalp_s like this.
Mon Feb 23 2015, 02:09 am
#38

I think this version does what you want.
It can use software delays or a 555.


Thank you dear phil sir thank you so much, now it's working great support sir... great forum great support
 ExperimenterUK like this.
Mon Feb 23 2015, 02:26 am
#39

What is mirroring ?


sorry for my poor language,
i meant , in this code every design has mirror design mean it runs in opposite direction, for this operation i have to write same code to run in opposite direction it takes much space of chip, so i want to know any other idea for making mirror effect, which use less space.
Mon Feb 23 2015, 04:18 am
#40


What is mirroring ?


sorry for my poor language,
i meant , in this code every design has mirror design mean it runs in opposite direction, for this operation i have to write same code to run in opposite direction it takes much space of chip, so i want to know any other idea for making mirror effect, which use less space.

sankalp_s


You need to use tables.
That will make designing and reversing much easier.
Here is an example.
seq1: db  5,1,2,4,8,16,32,64,128,64,32,16,8,4,2,1,5 ;17
save_A      equ 43h
table_count equ 44h

         mov dptr,#seq1     ;point to table
         mov table_count,#17  ;size of table 
         mov A,#0        ;first byte of table
displayloop:     
         mov save_A,A
         movc A,@A+dptr ;get the next pattern
	 mov P0,A
	 call delay2
	 mov A,save_A
	 inc A     ;next byte	 
	 djnz table_count,displayloop
	 mov P0,0
	 jmp $     ;stop

	
  ;software delay
delay2:
     mov r2,#10
outloop:  
    MOV R0,#0FFH
INLOP:
        MOV R1,#0FFH	
	DJNZ R1,$
	DJNZ R0,INLOP
	DJNZ R2,outloop
	ret



[ Edited Mon Feb 23 2015, 04:50 am ]
 sankalp_s like this.

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

RodneyKnorb
Thu Apr 25 2024, 07:08 pm
Williamjef
Thu Apr 25 2024, 02:08 pm
SamuelSmise
Thu Apr 25 2024, 09:56 am
DustinErele
Thu Apr 25 2024, 08:44 am
ztaletpzca
Wed Apr 24 2024, 11:19 pm
IrardlPex
Wed Apr 24 2024, 08:42 pm
Charlestehed
Wed Apr 24 2024, 05:20 pm
Robertgurse
Wed Apr 24 2024, 02:43 pm