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.

[参考译文] LAUNCHXL-F28379D:SCI 通信:只能读取前几个字符、无法传输

Guru**** 2482225 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1448820/launchxl-f28379d-sci-communication-only-able-to-read-first-few-characters-and-not-able-to-transmit

器件型号:LAUNCHXL-F28379D

工具与软件:

您好!

我将使用与 SCI 示例3相同的参数设置代码、但具有硬件抽象层。 我使用轮询来读取/发送数据。

void sci_write (const uint16_t * const array、uint16_t length)

  INT I=0;
  for (i = 0;i < length;i++)
  {
    while (!SciaRegs.SCICTL2.bit.TXRDY);
    SciaRegs.SCITXBUF.bit.TXDT = array[i];
  }
}

void sci_READ (uint16_t * array、uint16_t length){
INT I=0;
  for (i = 0;i < length;i++)
  {
    while (!SciaRegs.SCIRXST.bit.RXRDY);
    array[i]= SciaRegs.SCIRXBUF.bit.SAR;

  }
}

这是终端中显示的读取结果。 我能够正确读取前几个字符(图1)。 然后、Baudrate 寄存器和 SCICTL2寄存器被强制改变(图2)

图1端子读数

图2寄存器自动更改(左侧:右前:后)

(C2000 ware SCI 示例3运行良好、这意味着硬件、波特率、端口等已正确设置)

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好!

    某些 C2000板需要一个预定义符号来正确设置器件上的时钟和其他配置设置。 请 添加预定义符号 "_LAUNCHXL_F28XXXX"。

    在 CCS 中、右键单击正在使用的项目、然后选择 Properties→Build→C2000 Compiler→Predefined Symbol→然后选择加号按钮"add"符号。 为 device.h 文件中找到的特定器件添加给定的预定义符号(如"_LAUNCHXL_F28379D")。

    此致、

    Allison