| ??? 06/28/00 09:21 Read: times |
#3454 - RE: how reset hardware with Interrupts? |
I have just experienced the same problem - how to reset an 8052 without any external h/w or - why this processor does not support a reset instruction, I don't know.
Initially, I just disabled all interrupts and jumped to 0000h. I changed my startup code to reset all the SFRs etc. to their documented defaults and expected this would be OK in lieu of a 'proper' reset. However, I found that whilst this worked most of the time, occaisionaly my ISRs would fail to be called after restart. It turned out that this was due to the "reset" sometimes taking place with an interrupt pending - the solution I used was to fake some RETIs during startup - the code goes something like this - ; disable interrupts, initialise SFRs ; etc. mov r0, #3 ; 2 is enough, ; 3 for luck! LoopRetI: call DummyRetI djnz r0, LoopRetI sjmp Finished DummyRetI: reti Finished: ; continue with startup Cheers, Bill |
| Topic | Author | Date |
| how reset hardware with Interrupts? | 01/01/70 00:00 | |
| RE: how reset hardware with Interrupts? | 01/01/70 00:00 | |
| RE: how reset hardware with Interrupts? | 01/01/70 00:00 | |
| RE: how reset hardware with Interrupts? | 01/01/70 00:00 | |
| RE: how reset hardware with Interrupts? | 01/01/70 00:00 | |
| RE: how reset hardware with Interrupts? | 01/01/70 00:00 | |
| RE: how reset hardware with Interrupts? | 01/01/70 00:00 | |
| RE: how reset hardware with Interrupts? | 01/01/70 00:00 | |
| RE: how reset hardware with Interrupts? | 01/01/70 00:00 | |
| RE: how reset hardware with Interrupts? | 01/01/70 00:00 | |
| RE: how reset hardware with Interrupts? | 01/01/70 00:00 | |
| RE: how reset hardware with Interrupts? | 01/01/70 00:00 | |
RE: how reset hardware with Interrupts? | 01/01/70 00:00 |



