What do you do when you have a microcontroller you’re trying to optimize? One method is using a debugger, but for AVRs and such that’s not a very common technique. For lower-level electronics projects, it’s nearly impossible, even. [Cnlohr] built a small Minecraft server that listens to in-game redstone circuits, but the performance of his real-world to block-world bridge wasn’t what he hoped. He came up with a pretty clever way of figuring out what was slowing his server down without any special gear at all.
[cnlohr]’s Minecraft server is just a simple AVR microcontroller, Ethernet adapter, and SD card affixed to a beautiful glass PCB. The performance of his server wasn’t what he expected; downloading a largish file from the server resulted in a download rate of about 55kbps, much slower than he expected. He wasn’t quite sure what the hangup was, so he took a camera and with a long exposure time took a very blurry picture.
The Minecraft server has a blue LED to show when the SD card was being accessed. In the picture above, [cnlohr] saw that SD card access was taking far too long, and if he wanted to optimize the code this would be the place to start.
Not bad for a dead-simple method of seeing where the code on your microcontroller project is slowing down.