Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

pic32mx exception handling

Status
Not open for further replies.

akshaybhavsar

Full Member level 2
Joined
May 5, 2016
Messages
135
Helped
2
Reputation
4
Reaction score
2
Trophy points
18
Activity points
898
Hi,
How to handle exceptions in pic32 firmware.?If exceptions comes then controller will go to exception handler function.But what to do in that routine?
 

The answer is "it depends..." and some of the things it depends on are the nature and criticality of the product (if it is a heart monitor or drug infusion pump then you really don't want it to stop, but who cares if a LED flashing app stops) and which exception it actually is (a "WATCH' exception is might be safe to effectively ignore but an 'Execute Exception' or a 'AdEL [address alignment error] probably means something more significant has gone wrong).
One course of action (which is typically the default if you don't set your own exception handler) is to reset the MCU. If the problem was something that was transient then this will get the device going again.
However if the problem was due to bad programming then you will probably invoke the trap again and end up in a reset/run/trap loop.
Therefore you really need to understand your application and the exception to know what action is the most appropriate.
Susan
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top