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.

[参考译文] CCS/BQ76PL455A-Q1:BQ76PL455A-Q1示例代码

Guru**** 2513185 points


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

https://e2e.ti.com/support/power-management-group/power-management/f/power-management-forum/735658/ccs-bq76pl455a-q1-bq76pl455a-q1-example-code

器件型号:BQ76PL455A-Q1

工具/软件:Code Composer Studio

您好!

BQ76PL455A-Q1的示例源代码

SYS_MAIN.c

void main()
{...

CommClear ();
CommReset ();
…
…} 

pl455.c

void CommClear (void)






~ int baudrate;baudrate = scilinREG->BRS;scilinREG->GCR1 &&~(1U <<7U);//将 SCI 置于 RESET SCilinREG->PIO0 &=~

~(
1U <<2U);//禁用传输函数-现在为 GPIO PscilinREG<*1+输出;//将1u 1u (1u 1+ 1)/1u (1)/1u (1)+ 1 (1)/ 1 (1)/ 1 (1)/ 1 (1)/ 1 (1)/ 1 (1 (1)/ 1 (1)/ 1 (1)/ 1 (1)/ 1 (1)/ 1 (1)
sciSetBudrate (scilinREG、BAUDRATE);
}

void CommReset (void)
{
scilinREG->GCR1 &&~(1U <<7U);//将 SCI 置于 RESET
SCilinREG->PIO0 &=~
~(1U <<2U);//禁用传输函数-现在是 GPIO scilinREG <<=

200波特率;//将
其设置为1 (1U)<= 1 (PUBLY)/ PUT <2 (PUT);/ PUBLY (2)
sciSetBudrate (scilinREG、BAUDRATE);
} 

我们使用另一个 MCU 与 BQ76PL455A-Q1进行通信

我的代码如下所示:

pl455.c

void CommClear (void)
{
GPIO_SCI_TX=0;
delayus (200);
sciInit();
sciSetBAURATE (250000);
}

void CommReset (void)
{
GPIO_SCI_TX=0;
delayus (200);
sciInit();
sciSetBAURATE (250000);
}

scilinREG->PIO3 &=~(1U <<2U);//将输出设置为低
delayus (200); 

MCU 在干什么? 它是否将 SCI 的 TX 引脚设置为 LO 为200us?

此致、

JET

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

    您对代码的 CommReset 部分是正确的。

    对于 CommClear、示例代码是将 TX 引脚保持在低电平10位周期(最小值)、在这种情况下接近于(2*AUDRATE)µs

    有关更多信息、请参阅数据表的3.9.4通信清除(中断)检测部分、有关如何进行粗近似的说明、请参阅示例代码中的注释。

    此致、
    Vince