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.

CCS/MSP430F5529: UART problem with Timer

Part Number: MSP430F5529


Tool/software: Code Composer Studio

hello,

im using msp430f5529, Im facing a strange problem where i use UART to send data to ESP8266 wifi module and also receive the same.

my question is while transmitting and receiving data through uart is work properly. but when i used timer in between any function, my transmitting part get stopped when using timer.

my timer is approx 13 sec delay, i.e. my transmitting process holds for 13 sec when timer runs and after that when my timer get suspend the uart start sending data.

please help me.

here im attatching some uart function and timer function.

//////////////////////////// timer function /////////////////
#include <msp430.h>
void timer();
unsigned int count_1=0;

void timer()
{

    P1SEL |= BIT3;                      //Select pin 1.2 as our PWM output.
    TA0CCR0 = 65534;                     //Set the period in the Timer A0 Capture/Compare 0 register to 1000 us.
    TA0CCTL2 = OUTMOD_3;
    TA0CCR2 = 10;                      //The period in microseconds that the power is ON. It's half the time, which translates to a 50% duty cycle.
    TA0CTL = TASSEL_1 + MC_1;           //TASSEL_2 selects SMCLK as the clock source, and MC_1 tells it to count up to the value in TA0CCR0

while(1)
{

    if(TA0R==65534)
    {
        count_1++;
        TA0R=0;
        if(count_1==10)
        {
            P1OUT |= BIT0;
            count_1=0;
            break;
        }
    }
}
}


///////////////////////uart function /////////////////////
P3SEL|=BIT3+BIT4;
UCA0CTL1|=UCSWRST;
UCA0CTL1|=UCSSEL_2;
UCA0BR0 =9;
UCA0BR1 =0;
UCA0CTL1 &=~UCSWRST;
UCA0IE |=UCRXIE;

////////////////////////////////////// UART SEND ////////////////////////////////////////
void send_uart(char *addr)
{
unsigned int i;
unsigned int size =strlen(addr);
for(i=0;i<size;i++)
{
while(!(UCA0IFG & UCTXIFG));
UCA0TXBUF = addr[i];
}
}
//////////////////////////////////UART INTERRUPT///////////////////////////////////////
#if defined(__TI_COMPILER_VERSION__)|| defined(__IAR_SYSTEMS_ICC__)
#pragma vector=USCI_A0_VECTOR
__interrupt void USCI_A0_ISR(void)
#elif defined(__GNUC__)
void__attribute__((interrupt(USCI_A0_VECTOR))) USCI_A0_ISR (void)
#else
#error compiler not supported!
#endif
{
switch(__even_in_range(UCA0IV,4))
{
case 0:break;
case 2:

*tx= UCA0RXBUF;
tx++;

break;

case 4:break;
default:break;
}
}

**Attention** This is a public forum