This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Part Number: MSP-EXP432P401R
Tool/software: Code Composer Studio
I'm trying to use the TIMER_A module on the MSP432R to generate a a pulse-position modulation signal for a servo. The period needs to be 50 Hz/20 ms. The source clock I'm using is SMCLK which is configured 3 MHz. With clock divider set to 1 a period of 20 ms = 60,000 clock ticks. I then have the TIMER A module at the beginning of the period set the pin high and after 1 clock tick set the pin low using the toggle set configuration.
When probing the pins with a scope I noticed that that the period is around 19.86 ms instead of 20 ms. By playing around the timer period I am able to get close to 20 ms by using 60,421 clock ticks. Even that isn't 100% precise since the period is 19.99777 ms.
Any explanation on why the TIMER A module isn't outputting a period of exactly 20 ms?
Code: Attached and based on the timer_a_upmode_gpio_toggle example from Resource Explorer.
SDK: SimpleLink MSP432P4 SDK v3.20.00.06
IDE: Code Composer Studio 8.2.0.000007
Please note that the period of the timer is always '+1' because there is an additional clock cycle when it roles over to zero.
We are glad that we were able to resolve this issue, and will now proceed to close this thread.
If you have further questions related to this thread, you may click "Ask a related question" below. The newly created question will be automatically linked to this question.
The DCO accuracy is specified as +/-1.2% [Ref Data Sheet (SLAS826G) Table 5-12,] 60421/60000 is about 1.007, i.e. -0.7%, so it is within spec.
To get better clock accuracy you'll need an external crystal.
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.