Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

how to solve the error...

Status
Not open for further replies.

HiteshDR

New Member
STEPPER EQU P1
KEY EQU P2
KEY_1 EQU P2.0
KEY_2 EQU P2.1
KEY_3 EQU P2.2
KEY_4 EQU P2.3

Org 0h
Ljmp Main

Org 0200h
Main: Mov A, #00h
Mov Stepper, A
Mov Key, A
Setb Key_1
Mov A, Key
Jnz Ant_clk

clk_wise:mov Stepper, #0ch
Acall Delay_1ms
Mov Stepper, #06h
Acall Delay_1ms
Mov Stepper, #03h
Acall Delay_1ms
Mov Stepper, #09h
Acall Delay_1ms
Sjmp Main

Ant_clk:mov Stepper, #09h
Acall Delay_1ms
Mov Stepper, #03h
Acall Delay_1ms
Mov Stepper, #06h
Acall Delay_1ms
Mov Stepper, #0ch
Acall Delay_1ms
Ret

DELAY_1MS: MOV R6, #231D ; 1 MILLISECONDS DELAY
GOTO: NOP
NOP
DJNZ R6, GOTO
RET

i have problem in this code.
the ant_clk loop runs only once
on next time program enters to the ant_clk loop but its not completing the loop. the program is returing to the line one of the program after desplaying 09 on port1.

what should be the reason for not completeing the loop?
wher should be the mistak??
 
HiteshDR said:
i have problem in this code.
the ant_clk loop runs only once
on next time program enters to the ant_clk loop but its not completing the loop. the program is returing to the line one of the program after desplaying 09 on port1.

what should be the reason for not completeing the loop?
wher should be the mistak??

Sir, the equates are case sensitive if I am right. but in the listing that followed, you va used lower case also. please see to it-- ofcourse, I do agree that I am not an expert , not even an ameteur in programming.
 
I have not studied your code but you symptoms suggest the watch dog timer is enabled. Maybe you could post your code and use the
Code:
 tag to post your code rather than the [quote] tag. Also, post all of your code.

Mike.
 
thank you so much

mvs sarma said:
Sir, the equates are case sensitive if I am right. but in the listing that followed, you va used lower case also. please see to it-- ofcourse, I do agree that I am not an expert , not even an ameteur in programming.


thanks for reply....

sir, code is actually written in same case, i mean its in uppercase.
i have got the solution also.
i was using ret while in sjmp call subroutine we have to recall the routine.
so i have changed the ret with sjp main..
now its working fine too.

thank you to you all to take interest and helping me...
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top