upon detection of a particular condition within isr dictates that a fresh start is favorable..
So it is OK that the microcontroller keeps on reseting until that condition is cleared? Are you doing anything to fix this "condition"?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
upon detection of a particular condition within isr dictates that a fresh start is favorable..
You need to be FAR specific about exactly what you're trying to do, but ISR's should be short and fast, and it sounds a REALLY bad idea to want to reset from within one.
I suspect you're probably going about your requirements very poorly?.
Incidentally - to cover myself - the reason I'm familiar with the RESET command in the enhanced mid range series is because I use it to reset a GSM modem based alarm in response to a specific text message command, restoring the device to it's start-up point (which is running at 32KHz in sleep mode, checking every second for being turned ON).
There doesn't seem anything particularly complicated about that at all?, and certainly no need for long ISR's or software resets.
Probably the only routine needed in the ISR would be to generate the inverter signals, triggered by a timer interrupt - the rest in a simple endless loop in the main program.
But again, if you choose your PIC correctly, I believe there are ones that have specific hardware for generating the required inverter signals.
So what are you actually trying to do in your ISR?, and why does it take a long time?.
Checking for battery low in the main loop seems a pretty sensible place to be doing that, and as I said ISR's should be as short and fast as possible - you can send 'signals' to and from an ISR using flags - so the main program sets a flag to run the inverter or not, and the ISR checks the flag before it does anything else, and only runs the inverter outputs if it's told to run.
Why would you want to check the battery voltage every 10mS?, it seems incredibly pointless? - batteries don't work that fast.
probably i could not explain it well. i am not checking battery voltage within ISR. that will be done in the main loop which also contains the battery charging code. but if the voltage checking is done in every 2 minutes, solves the whole thing right away.I'm also a little puzzled why you would be checking for low voltage during charging?, surely you would only check for low battery while it's NOT charging?