How do I find out if my embedded system has Floating Point Unit(FPU)? I'm using Keil tools. Our target board uses NXP LPC2468 series Microcontroller ? Does this microcontroller have FPU? Looking in the microcontroller manual I couldn't find any information on FPU.
ARM7, No
Even the Cortex-M4(F) only has one that supports 32-bit floats, and is still probably bigger than the CPU core.
Thank you for answering this question.
How do I manipulate floating-point numbers in ARM7 based target?
I'm getting unsigned32 minutes over modbus. I need to convert to hours and send over USB to a PC application.
i.e.
Given: 5351 minutes My embedded application needs to: 5351/60 = 89.18333.. Then, I would send 891 or 892 to PC application. They would divide by 10 and dispaly 891 or 892 hours.
What are my options ?
1) Does Keil provide any floating point library. 2) Usually floaing point math is usually eliminated in embedded systems. Instead, fixed-point math is used. Does Keil provide fixed point math routines? 3) Use shift operations to achieve my goal?
What would be best way to convert minutes to hours in my embedded application?
Why not just send minutes to the PC, and let the PC do the arithmetic?
They tell me it'll break their architecture and break other products.
You are correct! This really needs to be done on the PC side but we are trying to do it on the embedded side. Please provide a possible solution.
Just try a float and see what happens. I should be a bit slower.
But your situation only has 60 answers. So if you insist in eliminating floating point. (5351/60) - (int)(5351/60) = 11 That is 11 times 1/60'th. You can create a lookup table with 60 pre-calculated ascii decimals values in required significance (say 4, a word). Just assemble your full integer as string when you send it to the pc.
But that's just dirty...
My embedded application needs to: 5351/60 = 89.18333..
No, it doesn't. You only think it does, based on insufficient analysis of the task.
For starters, given what you actually want to calculate is 892:
Then, I would send 891 or 892 to PC application.
why on earth do you think you have to calculate 89.18333 instead?
This really needs to be done on the PC side
Nonsense. And that's putting it mildly.