I use minunit, http://www.jera.com/techinfo/jtns/jtn002.html, in my embedded projects. The tricky part when unit testing embedded stuff is separating stuff that works on "pure data" from stuff that has a dependency on the hardware. For example, if a function uses a hardware sensor input to calculate a value, you either have to encapsulate that input into a function you can mock, or pass it as a parameter and avoid mocking altogether. The good news is that forces you to use a more well-separated design, eg with separate .c modules to read discrete and analog values, so it ends up being more maintainable.