We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi everybody How can I restart the controller by internal rautine?(To simulate the external restart button)
Hi The Interrupt routine is stucked also if the reset funtion is out of the interrupt routine. According to my debugging in some situation during the program execution the program is stucked after the while and in some cases the reset is working properly. The question is why in some cases the program is stucked after the while. Thanks Kobi
You haven't explained why you want to do this software reset. Perhaps you could restructure your program so that you don't need to do it? I notice you're doing quite a bit of stuff in your ISR. If you want to make your life a whole lot easier: 1) Don't call functions from ISRs. 2) Don't do anything that takes more than a few tens or hundreds of microseconds in the ISR. 3) Try to avoid modifying multi-byte variables in the ISR. All of the above can be done safely but require you to be fully aware of all the implications. The 'usual' structure for a program that handles interrupts is: In the ISR only do things that are absolutely time critical. Set a bit flag so that the main program loop knows that the interrupt has occurred and can take whatever other action is required. If you stick to these guidelines you will probably spend a lot less time wondering why your program mysteriously hangs or misbehaves. Stefan