When I use a float function the bit 7 of SPIDAT is cleared! Have anyone a idea? Using aduc834-uc Below is a source example. Thank's. Norbert Christof
// Module "main.c" /*****************/ #include <math.h> #include <ADUC834.H> void main (void) { /* main */ char idata tid; float lfoat; /*************/ EA = 0; tid = IEIP2; IEIP2 = tid & 0xFE; EA = 1; SPICON = 0x3F; while(1) { tid = SPICON; // bit 7 of SPICON is clear SPIDAT = 0x03;// because of sending bit 7 is set while((SPICON & 0x80) == 0); tid = SPICON;// bit 7 of SPICON is set lfoat = 1.0; // bit 7 of SPICON still set sqrt(lfoat); tid = SPICON; // bit 7 of SPICON now clear !!! error !!!!!! // Why ??? > because of SQRT-function !!!! // at sqrt(0) bit 7 is not cleared! tid = SPIDAT; // now we are clearing Bit 7 }; } /* main */ /**********************/ // Ende Module "main.c"
Sorry I mean "bit 7 of SPICON" is cleared.