EmbeddedRelated.com
Forums
Memfault Beyond the Launch

Fast float to string conversion for LPC2xxx + Keil

Started by Colby Boles October 20, 2008
I have a LPC2364 based data logger that has float data that needs to be
converted to strings and recorded to a text file on SD storage. I'm
using the Keil environment and the sprintf() function seems a bit slow
for this task - taking about 40us per conversion at 72MHz. Keil doesn't
seem to expose anything lower level, such as fcvt() that might be
faster. I suspect that the GCC libraries have fcvt() though. Does anyone
have ARM7 assembly code for fcvt() or any other fast function for
converting a single float to a string?

Thanks,

Colby


An Engineer's Guide to the LPC2100 Series

--- In l..., "Colby Boles" wrote:
> Does anyone have ARM7 assembly code for fcvt() or any other fast
> function for converting a single float to a string?

I don't have assembly code for you, but I just checked my arm-elf
toolchain libraries, and newlib seems to offer the fcvt() function. I
haven't used any floating point, so I don't know how well (or whether)
it works, but I think newlib might be a good starting point for you.

d.

Memfault Beyond the Launch