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 Jan 22 2019, 06:51 AM
chnlovelyo
writing
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
Mon Nov 12 2018, 05:58 AM
Pavan_user
i have seen your replica of I2C programming using AT89C51 but i am unable to understand the "ack_bit" variable usage ...looks like it is always 1...can you elaborate how acknowledgment is working....
bgk3678
Tue Nov 06 2018, 02:36 PM
kindly any one give solution for my problem

Downloads

Comments

garfield0929
Sun Jan 20 2019, 12:48 AM
servprov
Thu Jan 17 2019, 06:44 AM
marcomilazzo
Wed Jan 16 2019, 04:21 PM
sandhyashree
Wed Jan 16 2019, 04:04 PM
SONACHAI1234
Sun Jan 06 2019, 08:14 AM
manan.gulyaani
Tue Jan 01 2019, 07:58 AM
etech
Sun Dec 30 2018, 07:44 PM
NeilC
Sun Dec 23 2018, 07:39 PM

Online

Guests: 68, Members: 0 ...

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

Members: 38039
Newest member: garfield0929
Forum Activity
ExperimenterUK Avatar
Posted By ExperimenterUK
Sun Jan 06 2019, 10:37 PM
Which 8051 chip are you using ?
SONACHAI1234 Avatar
Posted By SONACHAI1234
Sun Jan 06 2019, 08:21 AM
Hi,By mistakenly i burn rx program in my 8051 micr...
ExperimenterUK Avatar
Posted By ExperimenterUK
Wed Dec 19 2018, 06:27 PM
Nobody knows?sifirsekizThe problem is that you are...
sifirsekiz Avatar
Posted By sifirsekiz
Wed Dec 19 2018, 12:15 PM
sifirsekiz Avatar
Posted By sifirsekiz
Sun Dec 16 2018, 11:13 PM
Guys pleaseeeee :((
sifirsekiz Avatar
Posted By sifirsekiz
Sat Dec 15 2018, 07:09 PM
HiThe pulse-sensor-amped has an analogue output.Th...
ExperimenterUK Avatar
Posted By ExperimenterUK
Sat Dec 15 2018, 07:01 PM
HiThe pulse-sensor-amped has an analogue output.Th...
sifirsekiz Avatar
Posted By sifirsekiz
Sat Dec 15 2018, 09:02 AM
and ı have pulse sensor one out but anolog use 805...
sifirsekiz Avatar
Posted By sifirsekiz
Sat Dec 15 2018, 08:56 AM
HiMembers can supply code and diagrams if they wan...
ExperimenterUK Avatar
Posted By ExperimenterUK
Fri Dec 14 2018, 11:54 PM
HiMembers can supply code and diagrams if they wan...