Hello, we'd like to report a likely bug with the InstaSpin reference design in regards to either its stock oscillator configuration or the inner working of the supplied 'usDelay()' function.
Using a stock DRV8301-HC-EVM board and unmodified TI-provided MotorWare / InstaSpin software, we have found that 'usDelay()' returns 16.6666 times faster than expected.
In other words, calling usDelay(1,000,000) will pause execution for 1/16th of a second instead of the expected one second. These tests were of course conducted well after the board initializes the oscillator and other Picolo peripherals.
To replicate this problem, starting with the stock board & software (for the drv8301kit_revD board and f2806xF Picolo), simply insert code like the following into any sample software (just before the main control loop) and use a chronometer to time the rate-of-increase of g_nTimeInSec
for (;;) {
usDelay(1000000); // Delay program execution for 1 million microseconds = 1 second (###BUG: returns 16.6666 times earlier than expected!)
g_nTimeInSec++; // This variable should increment at the rate of 1 hertz but is instead increasing at the rate of 16.6666 hertz!
}
What could be wrong? Is the oscillator (internal) set correctly in the ref design? Is the usDelay() function broken?
Any hint on what to test next would be greatly appreciated!!
Jean-Pierre
P.S. Incidently, calling usDelay(1,000,000) one thousand times will yield a delay of precisely one minute!