Debugging, testing, and profiling microcontroller programs are notoriously difficult. The lack of supporting software such as an operating system, a narrow interface to the hardware chip, and delicately timed sequences of code present significant challenges which can be exacerbated by the presence of additional debugging or profiling code. In this paper we present a solution to the precision instrumentation problem for microcontroller code that is based upon our open, flexible simulator framework, Avrora. Our simulator preserves all timing and behavior of the instrumented program while allowing precision measurement of application-specific quantities. Categories and Subject Descriptors I.6 [Computing Methodologies]: Simulation and Modeling General Terms Experimentation, Performance Keywords Sensor networks, instruction-level simulation, cycleaccurate, parallel simulation, instrumentation, debugging, monitoring, profiling