Actually i done code for pulse genetor from min 0 count and max 15k count and this count is display on 4 bit lcd. But their is slight problem so i want code in assembly lang for 89c2051 ic. Thank you.
But their is slight problem so i want code in assembly lang for 89c2051 ic
What kind of logic reasoning is that supposed to be? You got some "problem", which you can't even be bothered to name, and just like that, you "want" assembly code for it? What has assembly code to do with anything else in your text?
ORG 0000H LJMP MAIN ORG 0030H
CNT1 EQU 20H CNT2 EQU 22H
EN EQU P1.2 RS EQU P1.0 RW EQU P1.1 DAT EQU P1
MAIN: LCALL LCD_INT MOV SP,#50H SETB P3.0
MOV TH0,#0 MOV TL0,#0 MOV TMOD,#11H //LCALL AGAIN
AGAIN: MOV A,#080H LCALL COM
CLR P3.0 SETB TR0
SETB IT0
SETB TF0 CLR TR0
MOV CNT1,TH0 MOV CNT2,TL0 LCALL hextobcd
L1: SETB TR1 MOV TH1,#0F2H MOV TL1,#0C0H
MOV R0,#20H DEC R0 JNZ L1 //RET
SETB P3.7
MOV TH0,#0FFH MOV TL0,#0D8H
CLR P3.7 CLR TF0 /*MOV CNT1,TH0 MOV CNT2,TL0 */
DEC CNT1 DEC CNT2
JNZ L1 RET
hextobcd: mov r0,#00h mov r1,#00h cjne a,#00h,c1_hextobcd //If number is not 0 then continue ret
c1_hextobcd: clr c mov b,#100 //First divide by 100 div ab mov r0,a //save MSB in R0 clr c mov a,b mov b,#10 //Divide by 10 div ab swap a mov r1,a //save the tens place in the Higher nibble of R1 mov a,b orl a,r1 mov r1,a // save the tens place in the Lower nibble of R1 ret
SJMP AGAIN
//=====================FOR LCD DATA====================================================
LCALL CLEAR LCALL LINE1 MOV DPTR,#MYDATA LCALL LOOP LCALL LINE2 MOV DPTR,#MYDATA2 LCALL LOOP LCALL LINE3 MOV DPTR,#MYDATA3 LCALL LOOP LCALL LINE4 MOV DPTR,#MYDATA4 LCALL LOOP
///=======================ACTUALLY TMR N MODE =================================================
////============================WRITE DATA=======================================================================
W_NIB: PUSH ACC ORL DAT,#0F0H ORL A,#0FH ANL DAT,A SETB EN CLR EN POP ACC SWAP A ORL DAT,#0F0H ORL A,#0FH ANL DAT,A SETB EN CLR EN RET
///================================LCD INITIALISE======================================================
LCD_INT: CLR RS CLR RW CLR RW SETB EN MOV DAT,#028H CLR EN LCALL SDELAY MOV A,#028H LCALL COM MOV A,#0CH LCALL COM MOV A,#06H LCALL COM LCALL CLEAR MOV A,#080H LCALL COM RET
//==================================CLEAR COM========================================================
CLEAR: CLR RS MOV A,#01H LCALL COM RET
//===============================DATA COM============================================================
DATAW: SETB RS CLR RW LCALL W_NIB LCALL LDELAY RET
///================================SDELAY===============================================================
SDELAY: MOV R6,#1 HERE2: MOV R7,#255 HERE: DJNZ R7,HERE DJNZ R6,HERE2 RET
//=============================LDELAY=================================================================
LDELAY: MOV R6,#100 HER2: MOV R7,#255 HER: DJNZ R7,HER DJNZ R6,HER2 RET
//==============================COMMAND===================================================================
COM: CLR RS CLR RW LCALL W_NIB LCALL SDELAY RET
//==============================LINE==================================================================
LINE1: MOV A,#002H LCALL COM RET LINE2: MOV A,#0C0H LCALL COM RET LINE3: MOV A,#002H LCALL COM RET LINE4: MOV A,#0C0H LCALL COM RET
//==============================LOOP======================================================================
LOOP: CLR A MOVC A,@A+DPTR JZ GO_B2 LCALL DATAW LCALL SDELAY INC DPTR SJMP LOOP GO_B2: RET
//===========================MYDATA========================================================================
MYDATA: DB " AUTOMATE ",0 MYDATA2: DB " INDIA,PUNE ",0 MYDATA3: DB " VEHICLE ",0 MYDATA4: DB " SPEED ",0
//==============================================================================================================
END
THIS IS MY CODE CHECK OUT AND TELL ME THIS IS CORRECT OR NOT......
1) You kind of ignored reading the information directly above the message input box. Your "code" is unreadable since you didn't post it, tagged as code.
2) You write (screaming) "CHECK OUT AND TELL ME THIS IS CORRECT OR NOT". It has already been established that it's not correct (since it doesn't work). So why do you ask us to spend time looking at the code when the answer is already known?
3) For some very strange reason, you didn't find it important to tell us exactly what problems you are having with the code? Why not tell what is happening, and what you did expect to happen? You expect us to spend significant amount of time (that we could use to do customer projects and send invoices for) just to look at an unknown problem in source code posted to look like random garbage because you hadn't the time to read the posting instructions? How much time do you spend on the net, giving free help to other people who screams at you?
4) So is this a hobby project? Or maybe a school assignment?
5) Can a pulse generator actually count to zero? What does it then start from, to be able to perform any counting?
6) I see that you did write several paragraphs describing your actual hardware and how everything is connected. Or way a minute - that must have been another thread, because this thread does not contain any such information. You think that helps us help you debug your code? In what way do think that?
7) You think you have a reasonable "density" of comments compared to instructions in your code? Are you sure that you can open this file 1 year from now, and quickly grasp what is happening? Or have you seen any issue that too much comments slows down the assembler in an unacceptable way, leading to too long build times?
there is not much hope
right over the entry window it says Place source code source ....
I posted post the parts of your code fully indented and commented .....
you post the whole mess, which, If I can decipher any of the mess you posted is way more than anyone would want to look at for free.
Erik