chipKIT® Development Platform

Inspired by Arduino™

Using coreTimerService with callback functions that use i2c

Created Tue, 29 Mar 2016 03:38:15 +0000 by lopezr


lopezr

Tue, 29 Mar 2016 03:38:15 +0000

So i'm working on this project that requires me to have sample rate of 100 Hz. I'm using an IMU and is communicated with a Max32 microcontroller via i2c. This project also include writing the data sampled onto an SD card. I understand that it takes a while to write anything to an SD card because of how its being written into. I figured I could just attach a coreTimerService that would run ever 10ms to read the data off the sensors, but every time I try to attach the callback function to the timer interrupt, the code stops. I have tested everything before i tried moving to coreTimerService. I've used millis() to check how long it takes to read the data from the sensors and it takes 2ms. Is this too long for a coreTimerService?