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.

PIC18F Divide-by-Zero handling

Status
Not open for further replies.

mmaccamy

Newbie level 1
Joined
Feb 8, 2011
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,291
So I'm trying to write behavioral requirements for a project based around the PIC18F platform (specifically the PIC18F4250 and PIC18F8722) and I need to find out if a divide-by-zero exception is encountered. Do these processors simply trigger a reset if an exception like this occurs?

My software is strictly C based and I use MicroChips MPLAB IDE to compile and build my projects. I have a feeling that this sort of thing is an undefined behavior since I was unable to find any information regarding this topic in either of the datasheets, nor the errata. I also have a feeling that the compiler itself doesn't allow something like this to occur.

I'm going to go read up on MPLABs compiler to test my theory. Please share any knowledge that anyone may have regarding this topic.
 

PIC18F does not have a divide instruction so the C code will execute a lib function which is handling the divide by zero situation. PIC18F does have a multimply instruction !. Hope this helps.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top