June 17, 2012
about 3 years ago
I’m using this board just to log accelerometer and gyro data to the serial port, so the test firmware is almost perfect. I’m building and deploying it in the Arduino IDE. All I want to add is a simple timestamp, i.e. to call Arduino’s “millis()” function.
Sadly, millis() seems to return zero if I stick it in this firmware, which is consistent with interrupts being off. Also, down at the bottom of “main.c”, there’s a nice big comment saying “Interrupts are globally disabled!”. But there’s no call to cli() anywhere that I can find, and calling sei() doesn’t seem to fix it… is there some other way that interrupts get disabled?
Maybe someone here has mucked with this firmware and knows something I don’t? Maybe there’s something in the hardware going on that I don’t understand that would cause this behavior?
My metric for determining that millis() is returning zero is printing it out with the other data as a %ul; doing the same for a counter that just increments on each loop prints out just fine.
No public wish lists :(
Forgot your password?
No account? Register one!