Summary: This text has examined that employs puls e-width modulation (PWM) that Timer_B of MSP430 exports underneath the comparative mode The wave, realized the operating principle that D/A big change. PWM presenting Timer_B which utilizes MSP430F449 results the technique to create sine wave and direct-current level, and supply circuit and language C source routine from the correspondent hardware. /p>
Keyword: MSP430F449 Puls e-width modulation D/A changes
D/A Conversion According to MSP430 Timer_B
Abstract: This paper analyses the key of employing the PWM to understand D/A once the MSP430 Timer_B is figure ing in compare mode. It describes the technique of utilizing the PWM of MSP449F449’s Timer_B to produce a sine wave along with a Electricity level. Finally, it provides the related hardware circuit and C language program.
Key phrases: MSP430F449 PWM D/A conversion
1.1 MSP430 one-nick computer suggests that though utilizes more one-nick computer systems to stay 8 one-nick computer systems around the domestic market at the moment, but by Texas Instruments (TI) It’s strong and operating fast, such advantages as low energy consumption, order are pretty straight forward that 16 one-nick computer systems MSP430 that the organization introduces have handling capacity. And adopted JTAG technology, Expensive online programming technology, BOOTSTRAP,etc. a lot of advanced technique, have steeply-priced performance, the marketplace has got very extensive employing in Europe. Although the time that MSP430 makes its way into the domestic marketplace is not so lengthy, it’s amazing quality mentioned above, entering, the domestic marketplace is preferred by numerous electronics engineers. Included in this MSP430F449 has 7 work designs and available 16 counters of 8, 10, 12, 16. Can realize D/A changes (D/A conversion) with PWM that his comparative mode produces .
1.2 PWM D/A lots of about embedded microcontrollers (microcontroller) It must make the analog signal to use. Within this situation it’s or perhaps a discrete digital-analogue ripper tools DAC (digital-to-analog ripper tools) to frequently adopt Integratedly Realized. But adopt puls e-width modulation PWM (pulse-width modulated) The signal will realized D/A big change (abbreviates as PWM D/A) Additionally a generally used method. Can establish needed household power or alternate current signal with PWM signal. This short article takes PWM that Timer_B of MSP430F449 output as good examples to create the sine wave of 1 200Hz and direct-current degree of one .5VCC. Actually the same method may be used within the one-nick computer systems of Timer_A and MSP430 other forms.
2. Realize the key of DAC with PWM
2.1 The fundamental principle PWM signal is that certain kind has fixed period (T) Indefinite an obligation ratio ‘ )Digital signal,as proven in Fig. 1. If PWM time different in duty ratio of signal, it filters outcoming signals following the wave to become analog signal of amplitude variation while being open so. So through manipulating the duty ratio of PWM signal, can establish different analog signals. Adopt CCR0 come the intersection of control cycle and T just in MSP430F449, control, take empty while being variable compared to CCRx register akin to timer, after which realize D/A changes.
DAC definition according to Timer_B PWM is equivalent to the size of the counter, it is almost always something of CCR0 register. Minimal Significant Little bit of PWM DAC is really a counter value, the meaning may be the general counter value.
Rcounts = Lcounts
Included in this Rcounts regards counter value because the unit definition, Lcounts is really a final amount worth of the counter. For instance to eight – bit DAC, the size of the counter is 8 bits, or 256 bits of counter value. Then your definition is 8 bits, or 256.
Under more general situation, the meaning according to PWM timer and PWM DAC from the electric-wave filter is equivalent to the phrase PWM signal which creates the analog signal. Minimum duty ratio that length and PWM counter that the phrase PWM signal is made the decision through the counter could be recognized. Make use of the mathematical expression the following:
Rcounts =,Included in this = Lcounts, C is really a minimum duty ratio.
The part of definition is calculated using the following formula:
If the size of PWM counter is 512 bits of counter value, the minimum duty ratio is 2 bits of counter value, then the phrase PWM DAC is: ,Or represent with bit: .
2.3 The needed output frequency from the systematic frequency PWM signal equals the more recent frequency of DAC, samples in once DAC in because each change same as PWM signal duty ratio. The needed frequency of PWM timer is dependent on PWM signal frequency and needed definition. U.i.:
Here, it’s the needed PWM timer frequency, it’s the frequency of PWM signal, it’s the more recent frequency of DAC, n it’s the needed bit definition. The ensuing sections will describe soon how you can adopt 8 – bit PWM DAC to create the sine wave of 1 200Hz synchronously. Can be purchased through the sampling theorem, the cheapest sampling frequency ought to be 400Hz. But generally, the rate the frequency of PWM signal ought to be far greater than Nyquist to sample. It is because the regularity of PWM signal may be the greater, necessitates the lower towards the order from the electric-wave filter, the simpler to understand the right electric-wave filter is. The rate of usually sampling brings 16 of Nyquist speed or 32 occasions.
2.4 The needed example within the piece of MSP430 resource creates the sine wave of 1 200Hz and something .5VCC with Timer_B additionally exterior electric-wave filter of MSP430F449 straight Level flows. Configure Timer_B to 16 – bit, up mode. The counter counts to CCR0 under this type of mode, then totally reset and start to count from again. It’s 8bits to initialise using the length that 255 means the counter for CCR0. CCR1 and TB1 can be used for creating the sine wave, CCR2 and TB2 can be used for creating the direct-current level. The export schemas are chosen as mode 7, PWM starts over / puts the part pattern. As proven in Fig. 2, under this type of mode, the creation of resetting the final every timer may be the higher level, become low-level, the set once the counter achieve CCR0 again before the counter reaches their very own CCRx values. In other words the need for CCRx continues to be determined each exactly pulsing and broadly. If the need for CCRx is transformed, can establish the heart beat from the variable width, the sine wave that hereinafter is created in by doing this Whether it was the heart beat from the fixed width that created without becoming, the direct-current level hereinafter is created such as this. SMCLK can be used because the clock supply of Timer_B finally. The machine switches into the time watching Jingzhen of 32768Hz, through implementing the regularity securing from the internal hardware to surround FLL (frequency-locked-loop) ,To normalize DCO (Digital Control Oscillator) The regularity, to be able to offer MCLK/SMCLK clock methodically.
3. Understand it now is easier the circuit realizes DAC peripheral circuit with Timer_B PWM, as proven in Fig. 3. Actually the peripheral circuit is circuit of Jingzhen and RC low-pass filter.
3.1 The formulation from the sine signal, within this example, a sine wave is created with 32 sample values. Frequency of sine wave 200Hz, so per second to wish, sample 200
To learn more about these, check out our website at