i already was able to generate one pwm signal and i a getting the output i need to generate 1 more signal !! how can i achieve this??
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
i already was able to generate one pwm signal and i a getting the output i need to generate 1 more signal !! how can i achieve this??
hi sir .... you have any example program sir ... i already used timer 1 for pwm ... now what can be done???
PERCFG &= ~0X40 ;
P2DIR = (P2DIR & ~0XC0)| 0X80 ;
P0SEL |= 0X08 ;
T1CC0L = 0XFF ;
T1CC0H = 0X7F ;
T1CC1L = 0x78 ;
T1CC1H = 80 ;
//T1CC1H = (int8) zcldata ;
//T1CC1 = 25 ;
T1CCTL1 = 0X1C ;
T1CTL |= 0X0F ;
sir i am already using the above program to generate a PWM using timer1 which will give me the PWM in the pin 11 of P18 .
when i use the program u mentioned above the above wave from pin11 of P18 is not coming and also the pulse which is supposed to come from pin14 of P20 is also not coming sir .. what have i did wrong ????
thank you sir !!! the waves are generated as per ...
in my code for timer 1 i just changed the value in the register T1CC1H for changing the duty cycle but i couldnt figure out how to alter the duty cycle in this code ??? would you tell me how ??
YiKai Chen said:Try my latest test code to output PWM on P1_6 using Timer 3.
PERCFG =0x20; // Select Timer 3 Alternative 0 location
P2SEL =0x20;
P1SEL |= BV(6); // Set P1_6 to peripheral
T3CTL &= ~0x10; // Stop timer 3 (if it was running)
T3CTL |= 0x04; // Clear timer 3
T3CTL &= ~0x08; // Disable Timer 3 overflow interrupts
T3CTL |= 0x03; // Timer 3 mode = 3 - Up/Down
T3CCTL0 &= ~0x40; // Disable channel 0 interrupts
T3CCTL0 |= 0x04; // Ch0 mode = compare
T3CCTL0 |= 0x10; // Ch0 output compare mode = toggle on compare
T3CTL &= ~0xE0; // Clear Prescaler divider value
T3CTL |= 0xA0; //Set Prescaler divider value = Tick frequency /32
T3CC0 = 128; //Set ticks = 128
// Start timer
T3CTL |= 0x10;
I tried your code and I could get 50% duty in P1_6. How could I change the duty? I tried to change the value of T3CC0 , but nothing happened.