When working on digital circuits that operate at high frequencies it helps to have some special tools on hand. Things like oscilloscopes and logic analyzers are priceless when something isn’t working right. Another great tool would be this hardware-based profiler that [Mike] came up with while he was working on another project.
The profiler connects to USB and shows up as a serial port. Normally [Mike] used a set of LEDs to get information about how his microcontrollers work, but for this project that wasn’t enough. The uController Code Profiler can provide the main loop running time, time functions and sections of code, keep track of variables, and a few other tasks as well, all with nanosecond resolution.
The source code isn’t provided but a hex file is available, along with a schematic and an include file, if you want to try this one out on your next project. Like this homemade logic analyzer, this could be a powerful tool in your microcontroller arsenal. Simply include the file with various pieces of your code to get it up and running!
I was thinking about doing an extended version of this project to give more than just 80×25 screen size info, was thinking about showing input pin timers, for more accurate/critical timing of functions, more variable displays, etc.. Let me know if anyone finds this useful?
Mike,
thank you for your work !
Is the uProfiler time dependent ? I would like to try it on a 18F2550 I have in my spare parts but only have 8 & 16MHz crystals to work with.
Yes, it needs to have a 12mhz crystal. When it receives the bytes from the serial port, it has some hard coded tuning values to compensate for uart times so it can narrow down timings less overhead
It looks very interesting but, after browsing on [mike]’s website, I fail to see how I can test it in my project.
Also, if it communicates with computer via B7 pin, what is the use for the USB link?
Scratch that. I just got it.
I thought it was a piece of code to implement into an existing project, not a standalone device.
I always wished we had an arduino simulator like you have for the Picaxe processors.
It would be awesome to do tests in the computer without writing to the hardware.
Atmel studio has a built in AVR simulator. You can run your arduino code in that.
(not my blog) http://www.hilltop-cottage.info/blogs/adam/simulating-arduino-code-using-atmel-studio-6/
For a lot of my AVR projects where I don’t need libraries I actually much prefer writing plain avr C in Atmel studio without the arduino cruft.