Discussion in "Project Doubts" started by    sankalp_s    Nov 29, 2014.
Wed Feb 17 2016, 06:39 PM
#81


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



Thank you so much sir, for great help and great support.
sure sir i'll try for that.
Fri Jan 13 2017, 06:52 PM
#82
Hi phill sir..
testButton1:
               	
				 mov A,BIT_VAR ;debug
				 mov P1,A
				 
              
		        jb progBit1,testButton2	    
				orl P1,#0x20  ;debug
                call program0  ;Run this segment if button pressed
                sjmp testButton1  ;done

testButton2:

              
				jb progBit2,default
				orl P1,#0x40  ;debug
                call program2  ;Run this segment if button pressed
                sjmp testButton1
default:  
                orl P1,#0x80  ;debug
                call program1  ;Run this segment if no buttons pressed
                sjmp testButton1


Above mention code is not working.. only default program executes..whatever conditions of buttons, they are pressed or not it makes no any changes.(This function works fine with old code but not working with this table method)

And sir please also explain me how can add 24 bit display.. i'm unable to increase from 16 to 24 bcoz of DPTR limitations.
Thanks sir.

I've attached the whole code..
Attachment


[ Edited Sun Jan 15 2017, 08:00 PM ]
Sat Jan 14 2017, 11:54 PM
#83
There is a fault in your Proteus design.
If you look carefully (magnify) you will see the ground point is actually a junction dot.
Add a new ground point from the 'Terminal mode ' menu.
The buttons will work now.
Buttons should show as red and blue, and change when pressed,
If not, post your Proteus design and the code you are using.

Sun Jan 15 2017, 07:55 PM
#84


There is a fault in your Proteus design.
If you look carefully (magnify) you will see the ground point is actually a junction dot.
Add a new ground point from the 'Terminal mode ' menu.
The buttons will work now.
Buttons should show as red and blue, and change when pressed,
If not, post your Proteus design and the code you are using.


ExperimenterUK


Hello sir, i'm using the code in development board where every thing is ok..
i'm attaching both non working and working code here.
please look both once. There is no changes in asm files of both codes but include files are different.. in non working code *.inc file is written in table method and other which is working, written in old method which is DUMPED by us.

i've tried both.



[ Edited Sun Jan 15 2017, 07:59 PM ]
Wed Jan 18 2017, 12:56 AM
#85
Here is a new version that works on the circuit you posted.


"And sir please also explain me how can add 24 bit display..
i'm unable to increase from 16 to 24 bcoz of DPTR limitations.
"
The DPTR does not impose any limitation on the number of LEDs.
If you look at "displayloop:" you will see that it moves one byte at a time from the table
to a port.
Just move three bytes (24 bits) instead of 2 (16 bits) in every call to "displayloop:"




 sankalp_s like this.
Wed Jan 18 2017, 07:28 PM
#86
Thank you so much dear sir. I think problem was memory allocation..



The DPTR does not impose any limitation on the number of LEDs.
If you look at "displayloop:" you will see that it moves one byte at a time from the table
to a port.
Just move three bytes (24 bits) instead of 2 (16 bits) in every call to "displayloop:"


ExperimenterUK



I'm doing like dis:





dw 000000000000000000000000b
       dw 100000000000000000000000b  
       dw 110000000000000000000000b  
	   dw 111000000000000000000000b
	   dw 111100000000000000000000b  
	   dw 111110000000000000000000b  
	   dw 111111000000000000000000b
........................
.............................


displayloop:
	 
     mov A,table_count  ;copy the number of lines to display
     mov tmp_table_count,A
	 
d_loop:
     mov A,#0
     movc A,@A+dptr ;get the top 6 bits
	call mirrorbyte; ;reverse pattern to suit hardware
	 mov P1,A      ;display pattern
	 inc dptr  
	   
	 mov A,#0
     movc A,@A+dptr ;get the low 6 bits
	 call mirrorbyte
	 mov P0,A
	 inc dptr

	  mov A,#0
     movc A,@A+dptr ;get the low 6 bits
	 call mirrorbyte
	 mov P2,A
	 inc dptr
	
	 
	 //call delay2       ;pause
	 call delay_keycheck    ;pause and checkbuttons.. can change return address, be careful
	 djnz tmp_table_count,d_loop	;next line of table
     ret	 

It gives result like zig zag and blinking (not according to given instructions.) m i doing wrong sir?
Wed Jan 18 2017, 09:28 PM
#87
This is your error
"dw 000000000000000000000000b"

dw stands for define word, meaning 16 bits of storage.
The assembler only stored 16 bits of the 24 bits you expected.

In the attached file I use.
dw 0000000000000000b
db 00000001b

This stores 16 bits then 8 bits per entry.

Don't forget, I used P1 for debugging, you will need to turn that off.




 sankalp_s like this.
Thu Jan 19 2017, 05:52 PM
#88
Thank you sir.. understood the logic..


But reverse loop is not working for 24 bits only port 2 and port 2 are functioning.
I'm doing this:

	reverse24displayloop:
     mov A,table_count  ;copy the number of lines to display
     mov tmp_table_count,A 
	 rl A ;2 bytes per line
inc_dptr24:	 
	 dec A
	 jz noinc_dptr
	 inc dptr
	 jmp inc_dptr24
noinc_dptr24:	 
r_loop24:	 

     mov A,#0
     movc A,@A+dptr ;get the top 6 bits
	 call mirrorbyte; ;reverse pattern to suit hardware
	 mov P2,A      ;display pattern
	 ;8051 has no "dec dptr" instruction, so do it the hard way.
	 dec DPL
	 MOV R7,DPL
	 cjne R7,#255,rdl1_24
	 dec dph
rdl1_24:	 
	
	 mov A,#0
     movc A,@A+dptr ;get the low 6 bits
	 call mirrorbyte
	 mov P0,A
	 dec DPL
	 MOV R7,DPL
	 cjne R7,#255,rdl2_24
	 dec dph
 rdl2_24:
	 mov A,#0
     movc A,@A+dptr ;get the low 6 bits
	 call mirrorbyte
	 mov P0,A
	 dec DPL
	 MOV R7,DPL
	 cjne R7,#255,rdl3_24
	 dec dph

rdl3_24:

   

	 call delay_keycheck    ;pause and checkbuttons.. can change return address, be careful
	 djnz tmp_table_count,r_loop
     ret

Fri Jan 20 2017, 12:31 AM
#89
The original reverse24displayloop:
was a bit messy.
Try this version.




[ Edited Fri Jan 20 2017, 09:44 PM ]
 sankalp_sajay_bhargav like this.
Fri Jan 20 2017, 04:40 PM
#90
Thank you so much sir for your great response..

Get Social

Information

Powered by e107 Forum System

Conversation

Tue Jul 23 2019, 08:33 AM
Constance Sutherland
ss内容ss
ExperimenterUK
Thu Jul 11 2019, 07:55 PM
@ramos https://www.theengineeringprojects.com/2017/09/l298-motor-driver-library-proteus.html
ExperimenterUK
Thu Jul 11 2019, 07:44 PM
@praveen123. Can you give a link to the project ?
Thu Jul 11 2019, 04:47 PM
ramos
buenos dias alguien podria ayudarme necesito saber como descargar la libreria del l298n para proteus
Thu Jul 11 2019, 11:11 AM
praveen123
anyone can help me
Thu Jul 11 2019, 11:11 AM
praveen123
i need source code for 8051 -smart trolley rfid
Thu Jul 11 2019, 11:10 AM
praveen123
hii
ExperimenterUK
Thu Jun 27 2019, 09:14 PM
Hi.. good to see you again
۞ TPS ۞
Thu Jun 27 2019, 07:31 AM
Hello
AdiGhazi
Tue Jun 18 2019, 11:21 AM
Hlo Dear , I've to program AT89C51AC3 RT-LUM using flip but I'm getting time out error for RS232. Will you please suggest me which programmer will be supportable to program this Chip.

Downloads

Comments

3AAPC
Sun Jul 21 2019, 12:41 AM
rpels7707
Fri Jul 19 2019, 11:31 AM
ameya123
Fri Jul 19 2019, 07:36 AM
anhsieuno
Thu Jul 18 2019, 11:39 AM
zxcvbnm1234
Sat Jul 13 2019, 07:09 AM
surajghayal
Wed Jul 10 2019, 01:17 PM
figureyang
Fri Jul 05 2019, 04:25 AM
mousompal
Sat Jun 29 2019, 05:02 PM

Online

Guests: 56, Members: 0 ...

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

Members: 38081
Newest member: 3AAPC
Forum Activity
3AAPC Avatar
Posted By 3AAPC
Sun Jul 21 2019, 12:51 AM
3AAPC Avatar
Posted By 3AAPC
Sun Jul 21 2019, 12:47 AM
With the GPS antenna in the outdoors, I use the ub...
ameya123 Avatar
Posted By ameya123
Fri Jul 19 2019, 07:42 AM
Hello,Please share 8051 Assembly language code for...
figureyang Avatar
Posted By figureyang
Fri Jul 05 2019, 04:37 AM
here is the source code prepared for you download ...
figureyang Avatar
Posted By figureyang
Fri Jul 05 2019, 04:30 AM
Cheap_Flash_FS(Normal Version)--Embedded FAT16/32 ...
wimac Avatar
Posted By wimac
Sat Jun 22 2019, 01:26 PM
I’ve use the AT89C51ED2 which has a similar progra...
ExperimenterUK Avatar
Posted By ExperimenterUK
Thu Jun 20 2019, 10:08 PM
baud rate is 9600 at stop bits of 2. AdiGhaziThe u...
AdiGhazi Avatar
Posted By AdiGhazi
Thu Jun 20 2019, 05:24 AM
Dear,I'm using RS232 serial port cable to use flip...
ExperimenterUK Avatar
Posted By ExperimenterUK
Tue Jun 18 2019, 10:19 PM
Okay.. I have never programmed the AT89C51AC3 or ...
AdiGhazi Avatar
Posted By AdiGhazi
Tue Jun 18 2019, 11:20 AM
Hlo Dear ,I've to program AT89C51AC3 RT-LUM using ...