Email Contact Us. Both of them are 16 bit timers with several capture compare channels and selectable clock sources. Here A3 indicates the number of Capture Compare registers here 3 registers available in each timer. The DCO clock is temperature dependent and may change depending upon temperature. ACLK when taken from an external clock crystal is usually stable and do not change with temperature.
Timer A Operating Modes. Timer A Interrupts. The register TACCR0 has a separate vector location which has a higher priority compared to the other timer interrupts. Since all of them are combined together the interrupt vector register TAIV is used to determine which flag requested an interrupt.
To identify which flag caused the interrupt it is recommended to use a switch structure like this inside the ISR. Now lets write a small program to blink an LED connected to P1. I am using IAR embedded workbench and launchpad development platform. TAIE is used to enable the timer overflow interrupt maskable.
The TAR starts to run and overflows in about 8 seconds 0. Configuring CCRx interrupts. You have to enable the interrupt enable bits for the corresponding registers and load the values in to the capture compare registers.
Here i am showing only the timer configuration code segment you can find the full code in the zip file. Here we are configuring all the capture compare registers CCR as well as the timer overflow interrupt. After that CCR interrupts for the respective registers are enabled and counter is started in continuous mode. You can then lit up an LED or do something.What is the speed of the MCLK? Is it set with the DCO? Does using ACLK slow my actual chip?
Is that why when I'm debugging, my code seems The following is the code that I I just try to setup the clock and then output it to P1. I am checking the MCLK via From TI TimerA sample codes, it wrote there Did I miss out anything? Please help. MCLK will be used to execute the instructions Thank you in advance! Cheers, Gene. I tried to set P5 to be an output Any ideas?
MCLK doesn't matter. Since writing and erasing flash consumes some cycles and the msp will be jumping to nowhere while doing this, it could be interesting to reduce MCLK to reduce power consumption. Or not?
Timer A of MSP430
Maybe I'm thinking on a wrong way. The example code you used generates a continuous train of pulses. As written, the pulse width is always half of a period and Here I am giving the cEmail Contact Us.
MSP microcontroller is designed for energy constrained applications which should operate reliably over long period of time with as little power as possible like Wireless sensor networks ,body worn medical devices,measuring instruments etc. A simplified block diagram of the MSPx2xxx series is given below. Clock Sources oscillators of MSP The main clock sources oscillators of MSPx2x family are.
Please note that,not all clock features are supported on all mspx2xxx devices. You can only connect a 32KHz watch crystal to the oscillator inputs,higher frequency crystals are not supported.
The oscillator has a first startup time and is the default clock of the MSP after reset. One problem with DCO is that clock frequency is temperature dependent.
Clock Signals of MSP MSP produces 3 different clock signals using a combination of the above mentioned oscillators. The 3 clock signals are.
Clock System and Low Power Modes of MSP430
To conserve power, MSP spends most of its time in sleep and periodically wakes up to perform some operation and again goes back to sleep.
DCO digitally controlled oscillator is disabled. ACLK remains active. The controller can only be waken from this mode by an external interrupt. Back to Main Page. The essay writing industry is a source of interesting statistical data.
California, New York and Texas are the most popular regions where orders were coming from. Since academic writing is becoming one of the most prominent aspects of the educational system, the constant development of the custom-writing industry is clearly justified. Check for essay writing service.
All trademarks and service marks are the properties of their respective owners.Tutorials and explanations on the MSP microprocessor for the uninitiated. This blog is a collection of notes as I learn to use this microprocessor in a scientific laboratory venue and geared specifically to developing science instruments. Very nice post, beretta! This helped my understanding immensely.
Thank you very much, and keep up the great work! Sometimes we refer to these as separate things like independent from each other, but when we slow the clock down for ex: DCO freq 0, 0 then the whole system slows down.
Thanks for caring. Hey man, I am the same anonymous guy not anymore :. I don't know if couple of days ago I was able to post my question. So here we go again. I have couple questions out of these rather confusing ideas I need to clarify.
How do the timers affect the CPU frequency? How do we know the exact CPU frequency? How are the timers related to the CPU frequency? The main timer I am assuming that increments each cycle of the CPU regardless to what happens.
But if we can slow that down and CPU slows down? Am I right? If you can explain the full relation between timers and CPU freq. By CPU I mean micro controller by the way. Again I couldn't have done without your tutorials.
So I had written up a response to your questions, and somehow it never got posted You get some power savings by operating at a lower frequency, but the real impact comes in using the LPMs, where we turn clocks off completely and in some cases, the CPU too until an interrupt indicates that they're needed.
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It only takes a minute to sign up. I'm want to use an external low frequency crystal 32kHz for the timer in my MSPG and the internal oscillator at 8MHz, but in the datasheet I can't see how I should use the external crystal for the timer.
So how would the design for the oscillator look? To use an external In the DIP package, those are pins 18 and No additional components are required for this. TA0CLK has nothing to do with this crystal's connection, please see the pin descriptions in the datasheet. Once the Parts like microcontrollers are often too complex to fit all the data about them into just a datasheet.
Building an external oscillator to feed TACLK will likely use substantially more power than using the the uC's own crystal circuit. Sign up to join this community. The best answers are voted up and rise to the top. Home Questions Tags Users Unanswered. Asked 7 years, 2 months ago. Active 6 years, 2 months ago. Viewed 11k times. Dean Dean 7, 24 24 gold badges 60 60 silver badges bronze badges. MSP generally wants to have a low-frequency crystal attached, then uses its internal oscillator for higher frequencies.
But i'm unsure on how to do this. Active Oldest Votes. See this schematic of the MSP Launchpad Target Microcontroller section: You can see the two 0 Ohm resistors on the pins 18 and 19 - the crystal attaches between them. Instead of crystal, a digital clock from an oscillator can also be supplied to Xin in bypass mode. For crystals of frequency higher than the See the relevant part-specific datasheet for this. If the implementation is on an MSP Launchpad board, note that crystal diagnostic code is provided in Justin's Tech Blog - the gold standard that pretty much everyone followed in the early days of the Launchpad.
An excellent, step by step explanation and verification code is provided in this blog. Most important : Code using LF crystal ACLK does not function as expected while stepping through in debug mode, you have to run the code in "Run" mode for the various diagnostic code fragments mentioned above to work.
Subscribe to RSS
This quirk is apparently not documented anywhere, I spent a fair bit of time removing and resoldering the crystal on my first launchpad, assuming a failure, till I figured this out. Anindo Ghosh Anindo Ghosh 48k 8 8 gold badges 92 92 silver badges bronze badges. An alternate reference for Timer 0, in case you want Timer 0 to use a different reference clock than the MSP system clock or main peripheral clock.
If you want to source ACLK from the The time-base setting orange box added by me is us. I've also over-laid vertical red lines on your screen shot. Each red line highlights the graticule shown in your screen shot. I've changed colours to make things clearer. I count about 3. That is a frequency of Hz. Now being a little more productive than I was in my comment, and trying to solve your X problem rather than the Y problem you asked about see XY problemthere's almost certainly an error either in your calculation of the timer constants, or in your initialization of the MCU's clock.
However, to help you start off your debugging session, I see that there's a 4 MHz oscillator in the board, as well as an internal oscillator with 10 different frequencies 1 MHz, 2. If the program shown is your complete program, then it doesn't look like any clock initializations were performed.
Have a look at the MCU's reference manual and see how the clock is initialized by default. Probably the frequency is different from what you're expecting; maybe you assumed the 4 MHz external oscillator would be automatically used, while by default the MCU uses one of the frequencies above.
Certainly, in the STM32 which I'm familiar with, you need to run some initialization code to use the external oscillator, since at bootup only the internal oscillator is configured. Just so you know, that's not an unusual error. Toggling at Hz yields Hz. Not exactly what you are seeing, but you get the idea.
You need to verify that every mux and divider is set appropriately along the intended path. I get Hz. I know that if you use an interrupt, the count is exact.
You are polling, which could still work depending on how you poll and clear. I don't see the minor discrepancy yet. Also, if you are going to use the LF oscillator, check to see if Q1 is installed.
The schematic leads me to believe that it is optional, but TI sometimes changes little details from rev to rev. Edit2: Thanks to the tip from CLI finally have something working. It doesn't do what you expect, since it uses LFXT. If you are trying something new, always start with a known good code example. TI is a usually a good source, but I have found issues with their code examples.
Sign up to join this community. The best answers are voted up and rise to the top. Home Questions Tags Users Unanswered.
My oscilloscope is not measuring the frequency of my wave accurately Ask Question. Asked 28 days ago. Active 28 days ago. Viewed times. The community's help is very much appreciated.
SamGibson 14k 4 4 gold badges 21 21 silver badges 46 46 bronze badges. Forat Forat 2 2 silver badges 10 10 bronze badges.I have my beacon running but the clock is slowly drifting 30 seconds in 12 hours and the beacon sequence is not synchronized anymore so the receivers are not decoding it.
It defaults to 16MHz for the mspg This value is stored in the boards. I am rather used to solder SMD but this one was not the easiest to solder since the board is already populated For cycles, you have to set CCR to This is explained in SLAU section But I am sure you already figured that one out :- It would be nice if this was possible using a higher level API.
The only problem is that the output power is a bit low mW and propagation conditions not great at this season for the band I choose 30 meters band is more a winter bandbut this RF related, not MSP related.
You can post now and register later. If you have an account, sign in now to post with your account. Paste as plain text instead. Only 75 emoji are allowed. Display as a link instead. Clear editor. Upload or insert images from URL. Reply to this topic Start new topic. Recommended Posts. Posted May 20, Thanks, Yan. Share this post Link to post Share on other sites. Rick, yes I saw the second code you give but missed the board. I think my problem is somewhere else I also use the delay function which make usage of the WatchDogTimer.
I will try to use only my own "delay" using the RTC lib. Regards, Yan. Posted May 21, Anyways, happy you got it to work! Posted May 22, The clock drift is around 1 second less for 4 hours but I have to measure it.
It seems in line with the 20ppm rating of the xtal. Thanks for your help. Join the conversation You can post now and register later. Reply to this topic Go To Topic Listing. Sign In Sign Up.