|
Re: Floating point math zero
You commented that the problem is occuring with other math functions as well. Are you using any floating point math in an interrupt service routine? If so are you saving the math data context?
Below is exceprt from the C18 users guide:
If an interrupt service routine uses math library functions or calls a function that
returns 24- or 32-bit data, the math data section (which is named MATH_DATA) should
be saved using a save=section("MATH_DATA") qualifier on the interrupt pragma
directive. For example:
#pragma interrupt high_interrupt_service_routine save=section("MATH_DATA")
If this is not done then an interrupt could be trashing the results of floating point operations in the main line code.
__________________
FRC 623 2003,2004,2005,2006,2007,2008, 2009, 2010, 2011
FRC 1900 2007
FVC 60 and 193 2006
FVC 3271 2007
FTC 226 and 369 2008, 2009, 2010, 2011
FTC 3806 2010
|