agaelema

Embedded_Printf

3 posts in this topic

I would like to share with you this library. Is an embedded version of the famous "printf ( )".


 

post-31344-0-91733200-1460306817_thumb.png

 

The start point was this post in the e2e where an user share a code.


 

I modified the code inserting new functions as binary notation, float notation, scientific notation, functions to convert numbers into strings and strings into numbers.

 

The user can enable some #define enabling/disabling functions to use just what is useful.

 

This is an resume comparison between the CCS native "printf" and this library (using th Launchpad EXP430FR6989 at 1MHz).


 

post-31344-0-49485200-1460307318_thumb.png

 

To facilitate the port to other devices there is a separated file. Currently there are two ports: MSP430G2553 and MSP430FR6989.

 

I hope it is useful.

Fmilburn, bluehash and tripwire like this

Share this post


Link to post
Share on other sites

I would like to point out that there has been extensive talk about printf() on these forums, and there is a version that compiled down into 106 bytes if I remember correctly. Which can grow even more rapidly the more functionality you require.

 

http://forum.43oh.com/topic/1289-tiny-printf-c-version/

 

I was rather fond of a version Rickta59 wrote, but I think it was based on the original code from the above post.

tripwire likes this

Share this post


Link to post
Share on other sites
My initial objective is not create the smaller or better code, is just learn more things related to embedded world.

 

This code has a lot to improve in size and performance, but anyway, can be useful for someone, even though there are many others.

 

Thanks for the link, I will study it. The approach to convert the number seems to be more efficient.

tripwire likes this

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now