Quantcast
Viewing all articles
Browse latest Browse all 116964

Forum Post: c code to send at cmmand and receive ok

hii

i am using TMS320C5515 AND TELIT GL865 AND TXS 0102 as voltage converter

and code composer studio v5

i want to send AT command and receive OK but am not getting ok ,i don't know what is problem and where is it

i am using following code to send AT command

*******************************************

void UartTxChar(unsigned char ch) //function to transmit character
{
CSL_Status status;
while (((hUart->uartRegs->LSR) & (0x0020)) != 0x0020);
status = UART_write(hUart, &ch, 1, 0);
if(status == CSL_SOK)
{
// printf("\n sent %c",ch);
}
else
{
//printf("\n Write Failed");
}
//USBSTK5515_waitusec(1000);
//while(command != ch );

}
void UartTxString(unsigned char *str) //function to transmit string
{

//while(*str != '\0')
{
UartTxChar(*str);
*str++;
}
UartTxChar(0X0D);
UartTxChar(10);
USBSTK5515_waitusec(25000);//put it to wait for sending
USBSTK5515_waitusec(2500000);//put to wait for the ok

}

**************************************

and following code to receive ok

**************************************


void uart_rxIsr(void)
{

//printf("rxc");
//UART_read(hUart,&command,1,0);
command = CSL_FEXT(hUart->uartRegs->RBR,UART_RBR_DATA);
//if (command == 's')
//{
// gcount = 1;

// dsp_call = 0;
//}

Recv[etc] = command;
for( j = 0; j<=etc; j++ )
printf("%c",Recv[j]);
etc++;
}

**********************************************

is any think wrong with is code please help me .


Viewing all articles
Browse latest Browse all 116964

Trending Articles