Quantcast
Channel: Microcontrollers
Viewing all articles
Browse latest Browse all 216518

Forum Post: RE: Pulse Train Generation using TimerA MSP430G2553

$
0
0

[quote user="Anthony Mucciolo"]First, when I was using P1.1 as an output, was it actually functioning correctly[/quote]

Yes, indeed it was functioning correctly but not as you intended. When you use CCR0 as timer period register, timer resets to 0 when it's counter reaches CCR0 value (refer to 2xx series User's Guide. If you configure CCR0 output for PWM generation for timer in up mode you will see what you did see - pulse which length is one timer clock period.

[quote user="Anthony Mucciolo"] only I wasn't probing the correct pin so it looked incorrect?[/quote]

You configured CCR1 for PWM kinda correctly, but did not configure it's output pin and yes, did not probe it's output either. Notice that I changed TIMER_OUT definition to BIT2.

[quote user="Anthony Mucciolo"]line clock calibration?[/quote]

Lines 

BCSCTL1 = CALBC1_1MHZ;                    // Set range
DCOCTL = CALDCO_1MHZ;                     // Set DCO step + modulation */
loads factory calibration constants for 1MHz DCO. So supposedly you are getting clock much closer to 1MHz than using default DCO frequency. Default clock frequency (w/o factory cal) is "somewhere around 1MHz" to say least.
Comparison of flash calibration value with 0xFF and program execution "trap" using while(1); if equal is just precaution against careless msp430 user/programmer who for some reason did erase INFO flash segment containing calibration values thus losing them.

Viewing all articles
Browse latest Browse all 216518

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>