Hi
About the problem:
I took a lot of time, but I'm still stuck in doing floating point mathematical operations in my MC9S12ZVM MCU program. Maybe the question is elementary, but usually in my other projects, the compiler handles the casting between floats and integers back and forth. In the project I use, which is a demo project of one of your developments board S12ZVMLMINIBRD_BLDC_SW_CW11 the default floating point is turned off that is why once I include any explicit floating point operation I ends up with compilation error like:
Symbol __fdiv in file MC9S12ZVML128_BLDC_Sensorless_c.obj is undefined S12ZVMLMINIBRD_BLDC_SW_CW11 C/C++ Problem
I read parts of AMMCLIB manual and I tried to use the APIs like MLIB_Mul and MLIB_Div and so one, but I ended up with variables coded in 32/16 bit fixed point and did not find how to convert them back to integer.
The question:
One of the thing I want to do is:
1- Read one of the ADCs.
2- Convert to volt by multiplying the nummeric/digital value by 2.5V/1023.
3- Then scale the result using a voltage divider scale 0.85 (in my design).
4- Send the result back using CAN. Here I need to convert back from tFrac32 or tFrac16 to integer (how?)
Also is it possible and safe to enable the usual and direct floating point calculation for the demo project S12ZVMLMINIBRD_BLDC_SW_CW11 ? How (I did not find where from project settings)?
Thanks