tm4c-hal icon indicating copy to clipboard operation
tm4c-hal copied to clipboard

Unconfigured Clock

Open spencerdento opened this issue 4 years ago • 1 comments

The clock's default configuration results in the delay function lasting twice as long as specified.

https://gist.github.com/9names/ab435db6bdf9056cd285c2710825ae5f With configuration the led blinks the specified amount of time. Commenting out lines 14-17 makes the led blink for what seems 2x the amount of time specified.

spencerdento avatar May 15 '21 15:05 spencerdento

This is not limited to using unconfigured clocks. Here's a few configurations I tested

Correct delay: Using external crystal and PLL, 80/40/20 mhz work fine. While using internal oscillator with Divider::_2 and above (tested up to Divider::_4) Incorrect delay: Using internal oscillator and setting PLL to 80mhz (4x delay) While using internal oscillator with Divider::_1 (2x delay)

I'm sure there's more permutations where delay does not do what you expect.

9names avatar May 16 '21 05:05 9names