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.

TMS570LS1227 SCI

现在正在调试SCI—RS232配置如下图 但就是不发数据 请问哪里不对么

  • 这是程序 按照HAL中的例程写的

    #define TSIZE1 10
    uint8 TEXT1[TSIZE1]= {'H','E','R','C','U','L','E','S',' ',' '};
    #define TSIZE2 18
    uint8 TEXT2[TSIZE2]= {'M','I','C','R','O','C','O','N','T','R','O','L','L','E','R','S',' ',' '};
    #define TSIZE3 19
    uint8 TEXT3[TSIZE3]= {'T','E','X','A','S',' ','I','N','S','T','R','U','M','E','N','T','S','\n','\r'};

    void sciDisplayText(sciBASE_t *sci, uint8 *text, uint32 length);
    void wait(uint32 time);

    #define UART sciREG
    /* USER CODE END */

    /** @fn void main(void)
    * @brief Application main function
    * @note This function is empty by default.
    *
    * This function is called after startup.
    * The user can use this function to implement the application.
    */

    /* USER CODE BEGIN (2) */
    /* USER CODE END */

    void main(void)
    {
    /* USER CODE BEGIN (3) */
    sciInit();
    while(1)
    {
    sciDisplayText(UART,&TEXT1[0],TSIZE1);
    sciDisplayText(UART,&TEXT2[0],TSIZE2);
    sciDisplayText(UART,&TEXT3[0],TSIZE3);
    wait(200);
    };
    /* USER CODE END */
    }

    /* USER CODE BEGIN (4) */
    void sciDisplayText(sciBASE_t *sci, uint8 *text,uint32 length)
    {
    while(length--)
    {
    while ((UART->FLR & 0x4) == 4);
    sciSendByte(UART,*text++);
    }
    }
    void wait(uint32 time)
    {
    time--;
    }

  • 端口复用开了没