I don't see anything obvious in the code you posted, so I'll throw out some guesses: "count" and "count2" are 16 bits, so they can accommodate a value of 1000. How about "i" in your examples? What are your ISRs doing? A stray write in an ISR would be a way for a variable to suddenly change for no reason. Misspelling a "vector=" name or forgetting to stop the watchdog could cause your program to reset (if you were just watching breakpoints it's conceivable you might miss that). How about a buffer overrun? Does RXData[] really have 14 elements? (I only see 12 used.) Does IMU_DATA[] have 20? Are all your other buffer writes guarded?
↧