Jump to content
43oh

skaven

Members
  • Content Count

    5
  • Joined

  • Last visited

  1. So the particular model of the 430 I'm using may only have a Timer_A1, and that's why it's behaving like this? Or possibly the A1 timer is hooked up to different output pins than Timer_A0? ::sigh:: clearly I've got some more reading to do... My only complaint with the TI docs is that they seem to have been written by different people than those who wrote the C header files -- the subtle differences in the various names is a pretty frequent stumbling block for me...
  2. With some more tinkering I was able to get PWM working as expected, and I was able to output PWM to arbitrary pins (though I settled on P1.6 since it's got an LED hooked up already). I wrote this simple little program to ensure I understood how to incorporate interrupts (from a pin, not a timer) along with a PWM output...maybe this will be useful to somebody. This code runs on a MSP430G2231, but I suspect it'll run on any of the 430's... //****************************************************************************** // Description: Toggle P1.0 using interrupt routine. Timer_A is
  3. OK I figured it out -- the register for controlling the output mode of TIMER_A is CCTL1, not CCTL0, and there seems to be some limitations on which output pins you can use. So far I've only been able to get usable PWM to output on P1.2...
  4. Hi, gordon. I've looked at the slau144h document, and I believe I'm doing everything it says. CCTL0 = OUTMOD_7; // CCR0 reset/set mode Output mode 7 should reset (output==1) from zero to CCR1, and set (output==0) from CCR1 to CCR0, thus giving me the desired PWM duty cycle: CCR0 = 100-1; // PWM period CCR1 = 25; // PWM duty cycle The diagram in the PDF shows this very clearly on the mode 7 line for up-mode; the output is high from zero to CCR1 and low from CCR1 to CCR0. Of cours
  5. Hi, everybody. I'm trying to get a simple PWM signal to output and I'm having trouble, even making TI's example code work. Here's my current program: void main(void) { BCSCTL1 = 0x80; BCSCTL2 |= 0x04; WDTCTL = WDTPW + WDTHOLD; // Stop WDT P1DIR |= BIT1; // P1.1 output P1SEL |= BIT1; // P1.1 option select CCTL0 = OUTMOD_7; // CCR0 reset/set mode CCR0 = 100-1; // PWM period CCR1 = 25; // PWM duty cycle TACTL = TASSEL_2 +
×
×
  • Create New...