tag:blogger.com,1999:blog-2168992611451428662.post409083891199386311..comments2023-05-24T09:37:45.708-04:00Comments on MSP430 LaunchPad: Using ACLK and the 32kHz CrystalNJChttp://www.blogger.com/profile/05101156243681023963noreply@blogger.comBlogger38125tag:blogger.com,1999:blog-2168992611451428662.post-41484136949417414932017-03-15T11:17:35.390-04:002017-03-15T11:17:35.390-04:00Kingsley,
I would highly recommend Energia to you...Kingsley,<br /><br />I would highly recommend Energia to you. They abstract away the complexity of working directly with the MSP430 peripherals. The following link provides the exact functionality you need. If you are unable to use Energia for any reason, you can always look at their source code as a reference.<br /><br />http://energia.nu/reference/millis/<br /><br />Best of luck!<br /><br />NJCNJChttps://www.blogger.com/profile/05101156243681023963noreply@blogger.comtag:blogger.com,1999:blog-2168992611451428662.post-71734397025833238722017-03-03T15:12:16.390-05:002017-03-03T15:12:16.390-05:00Hello NJC,
I am still new in using RTC to generat...Hello NJC,<br /><br />I am still new in using RTC to generate timer actions. I have confusion as regards to your answer on setting the interrupt at every 100ms(using 32KHz crystal). How can I compare or retrieve the time in milliseconds with the previous time. For instance with the example code below:<br /><br />int t = 200;//in milliseconds<br /> int GetTimeMs = now; /*now is the milliseconds time to be retrieved from ACLK clock source*/<br /> while (now - GetTimeMs < t)<br /> {<br /> //perform an action<br /> }Anonymoushttps://www.blogger.com/profile/16212195419479128395noreply@blogger.comtag:blogger.com,1999:blog-2168992611451428662.post-73251122831043972352015-12-21T09:38:47.242-05:002015-12-21T09:38:47.242-05:00It depends. If you care about power consumption, y...It depends. If you care about power consumption, your goal should be to keep the MCU asleep as much as possible. This means minimizing how long your code (including interrupts) is actively running. If you only need 1 second interrupts, set it for one second. If you need 100 ms interrupts, set for 100 ms. Not sure if I perfectly understood your question, but hopefully I answered it.NJChttps://www.blogger.com/profile/05101156243681023963noreply@blogger.comtag:blogger.com,1999:blog-2168992611451428662.post-29521652839939756532015-12-04T00:27:44.206-05:002015-12-04T00:27:44.206-05:00which is better method,
1. accessing counter regi...which is better method, <br />1. accessing counter register for millisecond reading and implementing 1 second interrupt <br />2. implementing 100 ms interrupt.<br /><br />Thanks NJCAnonymoushttps://www.blogger.com/profile/02018681467876670210noreply@blogger.comtag:blogger.com,1999:blog-2168992611451428662.post-80006879694667302142015-12-02T12:13:29.687-05:002015-12-02T12:13:29.687-05:00It is impossible to get exactly a clock that trigg...It is impossible to get exactly a clock that triggers exactly every 100ms using a 32kHz crystal. The closest you can get is with a clock divider of 3277. This results in 3277/32768 = 100.006 ms.NJChttps://www.blogger.com/profile/05101156243681023963noreply@blogger.comtag:blogger.com,1999:blog-2168992611451428662.post-62002034787331584152015-12-02T01:04:09.169-05:002015-12-02T01:04:09.169-05:00i want service routine to be triggered at every 10...i want service routine to be triggered at every 100ms.<br /><br />Is this possible with the 32KHz clock ?<br /> Anonymoushttps://www.blogger.com/profile/02018681467876670210noreply@blogger.comtag:blogger.com,1999:blog-2168992611451428662.post-19487696167234919542015-11-03T21:37:52.646-05:002015-11-03T21:37:52.646-05:00For a 32768 Hz crystal, you have clock ticks that ...For a 32768 Hz crystal, you have clock ticks that are spaced out with a period of 1/32768. If you want 512 Hz, you want a period of 1/512. You need (1/512)/(1/32768) clock ticks at 32768 Hz to get clock of 512.<br /><br />Another simpler way to think about it is how many times does 512 go into 32768? You need 32768/512 = 64 clock ticks to have a 512 Hz clock.<br /><br />As Barrett noted, you have to be careful with how you count clock ticks. 0 to 512 is 513 ticks, which results in an error of 0.2%.NJChttps://www.blogger.com/profile/05101156243681023963noreply@blogger.comtag:blogger.com,1999:blog-2168992611451428662.post-46138675900215621342015-11-03T11:01:23.032-05:002015-11-03T11:01:23.032-05:00As posted on 9/1/13 and 9/2/13, this gives an erro...As posted on 9/1/13 and 9/2/13, this gives an error of 0.2%Anonymoushttps://www.blogger.com/profile/00423566893993672190noreply@blogger.comtag:blogger.com,1999:blog-2168992611451428662.post-18852784616792818432015-11-03T10:09:51.417-05:002015-11-03T10:09:51.417-05:00can you tell me how you get 512 hz from 32768 hz, ...can you tell me how you get 512 hz from 32768 hz, as i am not getting the calculation waqashttps://www.blogger.com/profile/12836715944180878022noreply@blogger.comtag:blogger.com,1999:blog-2168992611451428662.post-87281292728773376612014-02-04T10:22:27.977-05:002014-02-04T10:22:27.977-05:00I recommend pulling ACLK out to an external pin so...I recommend pulling ACLK out to an external pin so that you can measure it with a scope or logic analyzer. If your clock speed is wrong, check the registers to make sure it is setup correctly for your device, and check the solder job. Best of luck!NJChttps://www.blogger.com/profile/05101156243681023963noreply@blogger.comtag:blogger.com,1999:blog-2168992611451428662.post-6959580033409145832014-01-28T18:53:07.852-05:002014-01-28T18:53:07.852-05:00HI,
I am having the same problem, with CCR0 = 511;...HI,<br />I am having the same problem, with CCR0 = 511; the cycle time is about 2.5s.<br />Is there something wrong with the way I inserted the Xtal?<br /><br />Did you work out what your problem was?JustWilliamhttps://www.blogger.com/profile/02557769440083193837noreply@blogger.comtag:blogger.com,1999:blog-2168992611451428662.post-30385156121584840842013-12-20T15:38:49.027-05:002013-12-20T15:38:49.027-05:00Nice post. I was having trouble with finding a goo...Nice post. I was having trouble with finding a good reference to setting up the ACLK for the last few days, but this seems to answer most of my questions.<br /><br />One thing I am not sure on, does setting ID_3 work for the ACLK? The family users guide was unclear on this part, it seemed like it only was used on the DCO when it was used for the timer.<br /><br />Another thing, shouldn't the caps be set to 12.5 pF by default? At least this should seem the case, if not I am very surprised I got my circuit to work when I hooked it up to a breadboard without adding load capacitors.<br /><br />I also want to thank Jens-Michael, I have been seeing his work on the forums for the MSP430 page and they have been super helpful.Anonymoushttps://www.blogger.com/profile/00423566893993672190noreply@blogger.comtag:blogger.com,1999:blog-2168992611451428662.post-64345806045046439212013-12-20T15:37:46.057-05:002013-12-20T15:37:46.057-05:00This comment has been removed by the author.Anonymoushttps://www.blogger.com/profile/00423566893993672190noreply@blogger.comtag:blogger.com,1999:blog-2168992611451428662.post-80867799914427375472013-09-29T23:07:28.360-04:002013-09-29T23:07:28.360-04:00Nice¡ Thanks.Nice¡ Thanks.EinSoldiatGotthttps://www.blogger.com/profile/11248706064625173260noreply@blogger.comtag:blogger.com,1999:blog-2168992611451428662.post-35929019583827338332013-09-02T19:33:19.652-04:002013-09-02T19:33:19.652-04:00Thank you for pointing that out. This is a perfect...Thank you for pointing that out. This is a perfect example of a mistake that is very easy to make that has very real consequences for certain applications. A 0.2% error in the timer results in an error of over 2.5 minutes a day. Thank you again.NJChttps://www.blogger.com/profile/05101156243681023963noreply@blogger.comtag:blogger.com,1999:blog-2168992611451428662.post-18549562254602385442013-09-01T22:46:42.126-04:002013-09-01T22:46:42.126-04:00This code does not work as intended: The clock is...This code does not work as intended: The clock is off by about 0.2%. The family guide has the following description for MC_1: "The timer repeatedly counts from zero to the value of TACCR0". So if you count from 0 to 512, the frequency is actually 512/513 Hz.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2168992611451428662.post-21699025737930200182013-05-05T18:45:45.744-04:002013-05-05T18:45:45.744-04:00I tested your code but led was turn on cca 2,5s. W...I tested your code but led was turn on cca 2,5s. When I changed CCR0 on 30720 led turn on cca 2:30 (2.5m). Can you help my?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2168992611451428662.post-47835613594492153592013-04-30T11:44:59.300-04:002013-04-30T11:44:59.300-04:00Hi Nicholas, has the "printf()" been rev...Hi Nicholas, has the "printf()" been revised to be used in a MSP430G2553.<br />I am unable to use it in the form as available on your blog <br />of 08 June 2012.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2168992611451428662.post-31621021763135908762012-10-11T18:10:48.630-04:002012-10-11T18:10:48.630-04:00According to the datasheet on the MSP430G2553, the...According to the datasheet on the MSP430G2553, the crystals which you can use on XT1 must be between 10kHz and 50kHz. I'm there these numbers can be stretched a bit (although it is not recommended). You should ask on the e2e.ti.com forums fora more detailed explanation.NJChttps://www.blogger.com/profile/05101156243681023963noreply@blogger.comtag:blogger.com,1999:blog-2168992611451428662.post-67172224637012295122012-10-11T18:08:14.287-04:002012-10-11T18:08:14.287-04:00Actually, by changing a few parameters you can cha...Actually, by changing a few parameters you can change the interrupt time to anything you want (as long as it is less than your clock rate). Check out one of my earlier posts for more information on MSP430 timers.<br /><br />http://www.msp430launchpad.com/2010/07/timers-and-clocks-and-pwm-oh-my.htmlNJChttps://www.blogger.com/profile/05101156243681023963noreply@blogger.comtag:blogger.com,1999:blog-2168992611451428662.post-57482072049120758282012-10-11T18:07:04.326-04:002012-10-11T18:07:04.326-04:00As long as you are using the crystal provided in t...As long as you are using the crystal provided in the LaunchPad kit and follow the directions exactly (and keep the code the same), everything should work fine. There is no reason to hook up a pull-up or pull-down resistor to a crystal, it is just not how they work. It might be possible that you have a solder bridge somewhere as well. Sorry I can't be of more help.NJChttps://www.blogger.com/profile/05101156243681023963noreply@blogger.comtag:blogger.com,1999:blog-2168992611451428662.post-85274571885768180072012-10-10T14:56:14.642-04:002012-10-10T14:56:14.642-04:00I am completely new to msp430. I want to use this ...I am completely new to msp430. I want to use this board for controlling some LEDs accurately in the order of milliseconds. By the explanation that has been given it seems that the minimum is 1 second. Is that so?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2168992611451428662.post-90152264587934255162012-09-30T15:07:07.108-04:002012-09-30T15:07:07.108-04:00My clock is acting strangely because it seems that...My clock is acting strangely because it seems that my XIN has no pull-up or pull-down. The interrupts are delayed and erratic.<br /><br />However, when I pull XIN up or down manually using an external resistor, the timer works perfectly.<br /><br />I'm using your code exactly as posted here.<br /><br />Any idea how I can enable the internal pullup or pulldown resistors for XIN? Is there something similar to writing 1 or 0 (for pullup/pulldown) to the respective bit in PxOUT and then writing 1 to the respective bit PxREN?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2168992611451428662.post-51895833436185836932012-09-25T11:03:51.062-04:002012-09-25T11:03:51.062-04:00can we use a crystal of higher frequency than the ...can we use a crystal of higher frequency than the normal 32KHz available with the launchpad?Anonymoushttps://www.blogger.com/profile/05218253875738413524noreply@blogger.comtag:blogger.com,1999:blog-2168992611451428662.post-61251086688129201992012-09-01T00:31:43.847-04:002012-09-01T00:31:43.847-04:00hey GREAT WORK..........explains everything in a w...hey GREAT WORK..........explains everything in a well defined manner<br />but can u pls group all the tuts on msp430 in an ascending order as it is very difficult to find the tuts<br />thx reply soon.............sruteeshhttps://www.blogger.com/profile/16821497491257931421noreply@blogger.com