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.
Tool/software: TI C/C++ Compiler
Dear friends,
I need your help.I send through TA1 (Pin 1.6) the PWM with delay:
#include "msp430f149.h"
#include "stdio.h"
#define XTALL 16.0
#define delay_us(us) __delay_cycles (XTALL * us);
#define delay_ms(ms) delay_us (1000 * ms);
void timerA_PWM()
{
TACCR0= 18;
TACCR1=7;
TACCTL1=OUTMOD_7;
TACTL |= TASSEL_2;
}
void main(void)
{
P1DIR|=BIT6;
P1SEL|=BIT6;
WDTCTL=WDTPW+WDTHOLD;
timerA_PWM();
while(1)
{
TACTL |= MC_1; // Timer ON
delay_ms(50);
TACTL &= ~MC_1; // Timer OFF
delay_ms(100);
}
_BIS_SR(LPM0_bits+GIE);
}
This code is working. But I need to receved to MSP430f149 the signal and count the time. May I use for this issue the pin 2.3 (CA0/TA1)?Or I can use pin 4.0 (TB0).
I don't know how to lunch the timer, when the Timer TA1 is stoped:
TACTL &= ~MC_1; // Timer OFF
delay_ms(100);
One timer TA1 (pin 1.6) need to generate PWM with delay and another Timer need to start to count, when TA1 is stoped, capture the output signal, stop to count and them calculate the time.
How to do it?
Thank you in Advance!!!
**Attention** This is a public forum