Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/15/07 08:48
Read: times


 
Msg Score: -1
 -1 Answer is Wrong
#140825 - You need to set the Stack Pointer Register
Responding to: ???'s previous message
Asif Ali said:

			ORG 0000H
			LJMP MAIN
			ORG 0030H
MAIN:		        LCALL DELAY               ;quater second delay
			MOV P1,#000H
			MOV P3,#000H
			LCALL DELAY       ;quater second delay
			MOV P1,#0FFH
			MOV P3,#0FFH
			SJMP MAIN
DELAY:		MOV R7,#250
AGN:		MOV R6,#250
HRE:		NOP
			NOP
			DJNZ R6,HRE
			DJNZ R7,AGN
			RET
			END


Asif :

You haven't initialized the Stack Pointer. I haven't checked this, but I think the default value of SP is 07h which is R7. In this case, the delay routine returns to 0000H and you will not get blinking.


Jerson


List of 46 messages in thread
TopicAuthorDate
have any one having the Strange prob with 89C51 ?            01/01/70 00:00      
   Post your code            01/01/70 00:00      
      ... and a photo...            01/01/70 00:00      
   "strange" problems have very often roots in...            01/01/70 00:00      
      Sir for Code here it is,            01/01/70 00:00      
         Here is code for Serial,            01/01/70 00:00      
            and what does it do, exactly?            01/01/70 00:00      
               The Problem is that,            01/01/70 00:00      
                  spurious resets            01/01/70 00:00      
                     Well sir,            01/01/70 00:00      
                        power supply is not only the transformer...            01/01/70 00:00      
                           Well Jan, no problem            01/01/70 00:00      
                              What ID?            01/01/70 00:00      
                        incorrect statement            01/01/70 00:00      
                           And whats that SUPERVISOR ?            01/01/70 00:00      
                              How to show the both sides of circuit ?            01/01/70 00:00      
                                 there is your problem            01/01/70 00:00      
                              supervisor = reset IC (roughly)            01/01/70 00:00      
                                 Here is the Pic of Circuit, :-)            01/01/70 00:00      
                                    where's the decoupling            01/01/70 00:00      
                                    The problem you will forever have till you throw y            01/01/70 00:00      
                                       stray capacitance            01/01/70 00:00      
                                          my point exactly            01/01/70 00:00      
                                    No burden caps?            01/01/70 00:00      
                                       no they are there            01/01/70 00:00      
         You need to set the Stack Pointer Register            01/01/70 00:00      
            SP            01/01/70 00:00      
               Clarification            01/01/70 00:00      
                  stack troubles            01/01/70 00:00      
                     dictionary definition of 'easier'            01/01/70 00:00      
                        something like that            01/01/70 00:00      
                           pray explain            01/01/70 00:00      
                              it's not going to solve the problem...            01/01/70 00:00      
                                 Oh yes            01/01/70 00:00      
                                    NO, where have you seen me saying that?            01/01/70 00:00      
                                    WoW what a nice idea ;-) i loved it,            01/01/70 00:00      
                                       so, why did you not \'dare\' to do so?            01/01/70 00:00      
                                          Why Not Sir :-) i am going to do it,            01/01/70 00:00      
   AT89C51            01/01/70 00:00      
   maybe this is your problem            01/01/70 00:00      
      Well is EA should be connected to VCC ?            01/01/70 00:00      
         read the datasheet            01/01/70 00:00      
            hey Charles you are Great :-)            01/01/70 00:00      
               why do you not dare to read the datasheet in the f            01/01/70 00:00      
         an editorial about a recurring issue            01/01/70 00:00      
   Thanks everybody, Problem solved ;-)            01/01/70 00:00      

Back to Subject List