Discussion in "Project Doubts" started by    sankalp_s    Nov 29, 2014.
Sat Jan 30 2016, 06:47 PM
#71


CALL ALLON
CLR L1
CLR L2
CLR L3
CLR L4
CALL DELAY ;delay to see leds off
CALL ALLON
CALL DELAY ;add a delay to see all leds on


Sorry sir this logic is not working, this logic has changed the pattern. like blinking pattern.
I have tried this method, it's working fine but taking too much space.
I think problem is ALLON instruction.
 DESGN8: ; 
                CALL DELAY
                CLR L1
                CLR L2
                CLR L3
                CLR L4
		SETB L5
		SETB L6
		SETB L7
		SETB L8
		SETB L9
		SETB L10
		SETB L11
		SETB L12
                CALL DELAY		
                CLR L2
                CLR L3
                CLR L4
                CLR L5
	        SETB L6
		SETB L7
		SETB L8
		SETB L9
		SETB L10
		SETB L11
		SETB L12
		SETB L1
                CALL DELAY
                CLR L3
                CLR L4
                CLR L5
                CLR L6
		SETB L7
		SETB L8
		SETB L9
		SETB L10
		SETB L11
		SETB L12
		SETB L1
		SETB L2
                CALL DELAY		
                CLR L4
                CLR L5
                CLR L6
                CLR L7
		SETB L8
		SETB L9
		SETB L10
		SETB L11
		SETB L12
		SETB L1
		SETB L2
		SETB L3
                CALL DELAY
                 
		.........
.......


sir can you code this in any other method?


[ Edited Sat Jan 30 2016, 06:51 PM ]
Sat Jan 30 2016, 06:57 PM
#72
>sir can you code this in any other method?

You need to explain exactly what you want the code to do.
for example

All LEDs on for 2 seconds
All LEDs off for 1 seconds.
All LEDs on for 2 seconds.
All LEDs off for 3 seconds.
All LEDs on for 2 seconds.

Sat Jan 30 2016, 07:40 PM
#73



You need to explain exactly what you want the code to do.
for example

All LEDs on for 2 seconds
All LEDs off for 1 seconds.
All LEDs on for 2 seconds.
All LEDs off for 3 seconds.
All LEDs on for 2 seconds.


ExperimenterUK


I want...
example...

ALL LED ON
LED 1,2,3,4 OFF REST LED ON
THEN LED 2.3,4,5 OFF REST LED ON
THEN LED 3,4,5,6 OFF REST LED ON
......... LIKE THIS.

after removing ALLON instruction it's working fine, so what can be alternet way by using less memory.


[ Edited Sat Jan 30 2016, 07:49 PM ]
Tue Feb 02 2016, 12:25 AM
#74


after removing ALLON instruction it's working fine, so what can be alternet way by using less memory.

sankalp_s


Earlier in the thread I suggested using tables to create the output.
I think that is the best method, but good use of sub routines
will save a lot of code.

Build long patterns from shorter patterns.
Tue Feb 02 2016, 07:26 PM
#75



but good use of sub routines
will save a lot of code.....
&
Build long patterns from shorter patterns....

ExperimenterUK


Sir I didn't understand that. Could you explain above lines in different way?
and 2nd question is, can we look more to rectify the existing code?or should be dump?

thank u sir


[ Edited Tue Feb 02 2016, 07:29 PM ]
Thu Feb 04 2016, 04:10 AM
#76


Sir I didn't understand that. Could you explain above lines in different way?

sankalp_s



Create short runs that turn LEDs on or off.
Then stick them together to form complicated patterns.
eg
 OFF4:   ;turn LEDS off 1 at a time
                CLR L1
                CALL DELAY
                CLR L2
                CALL DELAY
                CLR L3
                CALL DELAY
                CLR L4
                CALL DELAY
                ret

 ON4:   ;turn LEDS on 1 at a time
                SETB L1
                CALL DELAY
                SETB  L2
                CALL DELAY
                SETB  L3
                CALL DELAY
                SETB  L4
                SETB  DELAY
                ret


;next section does a lot with very little extra code

FIRSTLOOP:

  call  ON4; 
  call OFF4;
  call  ON4:  
  call OFF4;
  call  ON4:  
  call OFF4;
  call  ON4:  
  call OFF4;
  ret

;next code does 4 times as much with hardly any more code

  call FIRSTLOOP:
  call FIRSTLOOP:
  call FIRSTLOOP:
  call FIRSTLOOP:






and 2nd question is, can we look more to rectify the existing code?or should be dump?

sankalp_s



If you want to keep creating new sequences, then I would dump your
code and use tables to control the patterns.

If you just want to get your display working
fix the code you have.
There should be enough memory for a good display if you
re-use the sequences as I described above.






[ Edited Fri Feb 12 2016, 11:06 PM ]
Thu Feb 11 2016, 06:28 PM
#77
Hello phil sir finaly i'm dumping my code, now i'm learning table method,
now plz tell me how to add next pattern, can give me example with 2 pattern, it will be very help full to learn.
second thing is how can i design table for more pettern,
for example,
pattern1:
0,0,1,1,1,1,1,1,1,1,1,1
1,0,0,1,1,1,1,1,1,1,1,1
1,1.0,0,1,1,1,1,1,1,1,1
......
.....
where 0= led off
1 = led on
please give some example to create different pattern.

and last one. how can i use that mode function with this table method.

thank you sir.
Fri Feb 12 2016, 11:04 PM
#78
Try this program.
Let me know if it makes sense to you.

 sankalp_s like this.
Sun Feb 14 2016, 08:02 PM
#79


Try this program.
Let me know if it makes sense to you.


ExperimenterUK


Thank you very much sir this program is easy to understand and learn also, now i can understand display pattern.
But i have some queries:-
I) how can i write design pattern in this way eg. db 1,0,2,0,4.....
II)mirrorbyte instruction is not working(it display only in one direction), can we use mirrorbyte instruction for separate design and why we r using of long delay in the code?
III)no of repetition of pattern like this instruction.
MOV R3, #05 ;REPEtion of pattern 
D9: CALL DESGN9
DJNZ R3,D9 

and
MOV R3, #12
D8:		CALL DESGN8
                        JNB P3.5,D8(how to use this)
			DJNZ R3,D8



[ Edited Mon Feb 15 2016, 06:06 PM ]
Wed Feb 17 2016, 12:13 AM
#80


Thank you very much sir this program is easy to understand
and learn also, now i can understand display pattern.

sankalp_s


Great..


I) how can i write design pattern in
this way eg. db 1,0,2,0,4.....

sankalp_s


Your pattern is 12 bits wide, so work in rows of 16 bits
The lines below are the same.
dw 1111111100000000b
dw 0ff00h
db 0ffh,0h
db 255,0 


II)mirrorbyte instruction is not working
can we use mirrorbyte instruction for separate design
and why we r using of long delay in the code?

sankalp_s


I have attached a program that does mirroring.
The long delay is just to separate the sequences.

III)no of repetition of pattern like this instruction.
MOV R3, #05 ;REPEtion of pattern 
D9: CALL DESGN9
DJNZ R3,D9 

It is just a case adding loops to the code,
I'm sure you will work it out.

 sankalp_s like this.

Get Social

Information

Powered by e107 Forum System

Conversation

Tue Mar 26 2019, 08:09 PM
latamdateila
swimming
ExperimenterUK
Thu Mar 14 2019, 08:44 PM
We don't send code,but you can ask for help in the 8051 forum
Thu Mar 14 2019, 11:00 AM
Jui Sanjay Kapare
Hello sir, I want code of interfacing DS18B20 with 8051.plz send the code as early as possible
ExperimenterUK
Mon Jan 07 2019, 03:31 AM
@REVOCATUS please post in the AVR forum
Mon Dec 24 2018, 09:25 AM
REVOCATUS MATEMU
sorry I mean referee boards for player substitution
Mon Dec 24 2018, 09:24 AM
REVOCATUS MATEMU
hi am.looking how to build referee by using Atmega 328 and its codes
Sat Dec 15 2018, 01:45 PM
Arslan ayoub
Hii ,, can I get the simulation of numeric keypad lock on proteus
ExperimenterUK
Mon Dec 03 2018, 05:17 PM
Please post questions in the forum. The chat box is for chat
Mon Dec 03 2018, 06:43 AM
help!me!
help! I don't understand busy flag!
Sun Dec 02 2018, 08:01 PM
ile
hello

Downloads

Comments

tutu10
Tue Mar 12 2019, 07:11 AM
Raj243
Fri Mar 08 2019, 02:08 AM
bharatsb
Thu Mar 07 2019, 04:34 PM
Yass7
Thu Mar 07 2019, 03:55 PM
mashabed
Mon Mar 04 2019, 11:08 PM
AccelMotion
Tue Feb 26 2019, 06:06 PM
turbovps
Mon Feb 25 2019, 06:26 AM
the_Doker
Thu Feb 14 2019, 02:21 PM

Online

Guests: 43, Members: 0 ...

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

Members: 38052
Newest member: tutu10
Forum Activity
ExperimenterUK Avatar
Posted By ExperimenterUK
Sun Mar 24 2019, 09:52 PM
Counting pulses can be as simple asvoid interrupt ...
Ansh12 Avatar
Posted By Ansh12
Sat Mar 23 2019, 05:08 PM
Using the external interrupt on pin B0 is the best...
ExperimenterUK Avatar
Posted By ExperimenterUK
Fri Mar 22 2019, 09:10 PM
Using the external interrupt on pin B0 is the best...
Ansh12 Avatar
Posted By Ansh12
Fri Mar 22 2019, 03:45 PM
I have pic16f877a and MPLABX8 and I want to count ...
ExperimenterUK Avatar
Posted By ExperimenterUK
Wed Mar 13 2019, 02:32 AM
HiI looked at" Atmel AVR042: AVR Design Considera...
tutu10 Avatar
Posted By tutu10
Tue Mar 12 2019, 07:13 AM
Hi...My firmware upgradable code lock seems to be ...
Yass7 Avatar
Posted By Yass7
Sat Mar 09 2019, 12:52 AM
It's exactly that ! it's my teacher who asked me t...
ExperimenterUK Avatar
Posted By ExperimenterUK
Sat Mar 09 2019, 12:27 AM
As I understand it, you want to use a P89LPC952 /...
ExperimenterUK Avatar
Posted By ExperimenterUK
Sat Mar 09 2019, 12:21 AM
After you get the string what do you want to do wi...
bharatsb Avatar
Posted By bharatsb
Thu Mar 07 2019, 04:40 PM
help me to write code for 8051 to receive string ...