ONDER ARIK

using C code doing basic arithmetic in ISR causing unstability and system crash

Discussion created by ONDER ARIK on Mar 6, 2007
Latest reply on Mar 7, 2007 by bigmac
Hi,
 
I am new at Freescale HC(S)08 series microcontrollers. I have a big problem of using the C code that performs some basic integer arithmetic operations (32 bit division or multiplication) inside an ISR. The system crashes most of the time. I think the default C library for arithmetic operations is not re-entrant and if you use them both in main loop and inside the ISRs causing system crashes. Can you share your experience on this issue? Should I create my own re-entrant integer math library in assembler? (I have written a few of arithmetic operation functions and used them in ISR. They work OK but I am too lazy for writing a lot of them in assembler.) Is there some off-the-shelf re-entrant libraries around? What is the exact problem with the default library?
 
Thanx from now...
 

Outcomes