I am porting code over to CCS5 and using the driverlib for MSP430F5436A microcontroller. While debugging and going into "privateUCSComputeCLKFrequency()" function the execution of
(XT2ClockFrequency / CLKSourceFrequencyDivider);
gives a truncated result. The "XT2ClockFrequency" is 3686000 and "CLKSourceFrequencyDivider" is 1. So the result in "CLKFrequency" should be 3686000, but I am getting 15984. Is there any any setting in the CCS5 that I am missing?
3686000 is 0x383e70. 15984 is 0x3e70. Seems like CLKFrequency is a 16 bit variable only.
Maybe its purpose is using it in a 16 bit register later (e.g. a counter). So any result that exceeds 65535 is too much anyway.
But it's also possible that just the debugger shows a wrong value, interpreting CLKFrequency as 16 bit variable where it indeed is 32 bit.
That's why I try to not use libraries wher eit is not really necessary. They are usually introducing unnecessary overhead, are slower than optimized code, and even if the documentation is really good (and it often isn't), there's still some doubt whether it really does what one thinks it should.
Time to say goodbye - I don't have the time anymore to read and answer forum posts. After falling behind by two months (900 threads), there's no point in continuing. See my bio for details.Before posting bug reports or ask for help, do at least quick scan over this article. It applies to any kind of problem reporting. On any forum. And/or look here.If you cannot discuss your problem in the public, feel free to start a private conversation: click on my name and then 'start conversation'. But please do so only if you really cannot do it in a public thread, as I usually read all threads. And I prefer to answer where others can profit from it (or contribute to it) too.
In reply to Jens-Michael Gross:
I did check the variable sizes as that was my first doubt.
CLKFrequency is defined as "unsigned long CLKFrequency;" in function "privateUCSComputeCLKFrequency()".
I feel like there are some optimization setting need to be changed in the driverlib project and recompiled to resolve the issue.
I agree the driverlib for 5xx/6xx seem to be not stable at this point.
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. 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 respect to these materials. 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.