在tms570ls3137开发板上测试sci_uart_9600这个示例,按照示例程序,LIN/SCI串口可以在terminal收到数据,但是通过SCI串口发送确收不到数据。
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.
在tms570ls3137开发板上测试sci_uart_9600这个示例,按照示例程序,LIN/SCI串口可以在terminal收到数据,但是通过SCI串口发送确收不到数据。
我要测SCI模块,不测SCI/LIN模块,我把例程改为SCI driver配置,main函数里的#define UART scilinREG
改为#define UART sciREG,其他不变,但是在ccs的terminal里没有收到数据。
请您参考下面的程序
unsigned char receive_command[4];
unsigned int Task_Number;
void main()
{
/** - Initialize SCI Routines to receive Command and transmit data */
sciInit();
/** - Configure SCI to receive 8 bytes of Command information */
sciReceive(sciREG1, 4, receive_command);
/** - Clear the Task Number */
Task_Number = 0;
while(1)
{
switch(Task_Number)
{
case 1:
Task_Number = 0;
break;
case 2:
Task_Number = 0;
break;
case 3:
Task_Number = 0;
break;
}
}
}
/* The command starts with "*" and ends with "!". For example *02!
* */
void sciNotification(sciBASE_t *sci, unsigned flags)
{
/** Check for the Valid Command
* * - Starter
* ! - End of Command
*/
if(receive_command[0] == '*' && receive_command[3] == '!')
{
/** - 2nd and 3rd byte received are Task Number,
* combine them to form one decimal Number */
Task_Number = (unsigned int)(((receive_command[1] - 48) * 10) + (receive_command[2] - 48));
/** - Get ready to receive the next Command */
sciReceive (sciREG1, 4, receive_command);
/** - Acknowledge once the Valid Command is received */
sciSend (sciREG1, 11, (unsigned char *) "*VALID CMD!");
}else
{
/** - Get ready to receive the next Command */
sciReceive (sciREG1, 4, receive_command);
/** - Acknowledge once the InValid Command is received */
sciSend (sciREG1, 10, (unsigned char *) "Wrong CMD!");
}
}
这是sci接收数据的示例吗?我需要sci发送字节数据的示例,终端是接收端。