Lesson learned: A bit matters 18 Mar 2014
Paying extremely close detail to the data sheet and to the code is a lesson I learned today. Being one port off, one bit off, or one number off can be the difference between a gremlin seemingly appearing in the inner workings of your software (or hardware) and it working as you suspect.

My exact mistake is summed up like this: IEN0 is not IEN1, turning off the fifth bit on IEN0 will disable the sleep timer, whereas, turning the fifth bit off on IEN2 will disable the interrupt. Don’t turn off the sleep timer on a low energy device when you want to disable the interrupt.

Finding this was quite a pain and because of that pain I feel it will stick with me for a very long time time. On a positive note, I am glad I took the time to learn how to use an oscilloscope to measure current draw otherwise this wouldn’t have been detected.

Thanks to Mark Vandervoord @ ThingamaByte for his help with hunting this down and showing me a handful of debugging tricks along the way.


blog comments powered by Disqus