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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
08/16/01 17:38
Read: times


 
#14163 - RE: CPU reset by SW
Privet, Oleg,
It is possible, I did it. There are several things to be delicate about.
To be sure that nothing will trouble you, you disable all the interrupts:
mov IE, #0
First of all - and it is not obvious - you should reset your interrupt system. The thing is that interrupt flags cannot be reset with soft. That is why usually they use a cycle of the following form:
metka:
reti
vhod:
lcall metka
djnz schotchik, vhod

The instruction RETI works as well as RET, but at the same time resets the interrupts. This cycle should be performed a sufficient number of times to be sure that interrupts are entirely reset. If you overcome the actual number of interrupts, it is not dangerous. After this you should drive initial number into the stack pointer:
mov SP, #7
On hardware reset it is 7. You should also take care of PSW: it contains the choice of the register bank.
mov PSW, #0
Some more or less obvious attributions:
mov IP, #0
mov TMOD, #0
mov TCON, #0
mov SCON, #0 ...
Don't forget P0...P3, TH0, TH1, TL0, TL1 and so on. Now we are ready for our final instruction :
ljmp 0

Sincerely,
Misha.


List of 18 messages in thread
TopicAuthorDate
CPU reset by SW            01/01/70 00:00      
RE: CPU reset by SW            01/01/70 00:00      
RE: CPU reset by SW            01/01/70 00:00      
RE: CPU reset by SW            01/01/70 00:00      
RE: CPU reset by SW            01/01/70 00:00      
RE: CPU reset by SW            01/01/70 00:00      
RE: CPU reset by SW            01/01/70 00:00      
RE: Michal: CPU reset by SW            01/01/70 00:00      
RE: Sans: CPU reset by SW            01/01/70 00:00      
RE: Sans: CPU reset by SW            01/01/70 00:00      
RE:San Brgmns: CPU reset by SW            01/01/70 00:00      
RE: RE:San Brgmns: CPU reset by SW            01/01/70 00:00      
RE: Sans: CPU reset by SW            01/01/70 00:00      
RE: CPU reset by SW            01/01/70 00:00      
RE: CPU reset by SW            01/01/70 00:00      
RE: CPU reset by SW            01/01/70 00:00      
RE: CPU reset by SW            01/01/70 00:00      
RE: CPU reset by SW            01/01/70 00:00      

Back to Subject List