Re: [EE] Saving "printf" arguments for later? Real-time on slow processor.

Jason White <[email protected]>
Newsgroups gmane.comp.hardware.microcontrollers.pic
Message-ID <CAOFvGD5gCABKwSpx_3WeJ87JzK2OS7j30J=oNk=ZkTEhpmGDBw@mail.gmail.com>
I ended up doing a benchmark of the snprintf wrapper that I supply to the
library. I give it 8 large 32 bit numbers (1 hex, and 7 decimal). I found
it takes 10000 cycles (~1ms) round trip to write the formatted string into
the buffer.

The library can easily do 10 of these in a row within the "critical
section", which would take about 10ms, it is not surprising it was failing
to reliably hit a ~1ms window. I would bet different numbers could result
in substantially different speeds.

I determined that I actually need to get through the function call in less
than 500 cycles - which I think I'll be able to do by saving the format
string and all the arguments to a FIFO for later processing. (roughly 64
bytes of format string, and 32 bytes of numbers)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.