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串口发送数据,在terminal没有收到

Other Parts Discussed in Thread: TMS570LS3137, HALCOGEN

在tms570ls3137开发板上测试sci_uart_9600这个示例,按照示例程序,LIN/SCI串口可以在terminal收到数据,但是通过SCI串口发送确收不到数据。

  • 在例程说明中

    Enable SCILIN driver 而不是SCI driver

    器件上有两个SCI模块。一个SCI / LIN模块(TRM)在数据表中称为LIN,另一个是SCI,在HALCoGen中也称为SCI 。可以将SCI / LIN模块编程为作为SCI或LIN工作。该模块的核心是SCI。增强了SCI的硬件功能,以实现LIN兼容性。

    另外请参考 www.ti.com/.../spna124a.pdf
  • 我要测SCI模块,不测SCI/LIN模块,我把例程改为SCI driver配置,main函数里的#define UART scilinREG
    改为#define UART sciREG,其他不变,但是在ccs的terminal里没有收到数据。

  • 在终端上键入任何内容之前,应先调用sciReceive。
  • 调用sciReceive终端还是没有收到数据,能给我一个测试sci(不是lin/sci)收发数据的示例吗?
  • 请您参考下面的程序

    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发送字节数据的示例,终端是接收端。

  • 请问您有测试该程序吗?可以成功运行吗?