Other Parts Discussed in Thread: SYSCONFIG
主题:SysConfig 中讨论的其他器件
工具/软件:
当 L2228 与 1FR5043 通信时、当 L2228 处于低功耗模式时、会出现接收电流过大的情况。 通过使用 uart0、IO 使用 PA0 和 PA1。 接收数据时、电流约为 1.3mA。 您能告诉我如何为串行端口设置低功耗模式吗? 低功耗串行端口工作时的近似功耗是多少? 是否有执行测试的程序?
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.
Other Parts Discussed in Thread: SYSCONFIG
工具/软件:
当 L2228 与 1FR5043 通信时、当 L2228 处于低功耗模式时、会出现接收电流过大的情况。 通过使用 uart0、IO 使用 PA0 和 PA1。 接收数据时、电流约为 1.3mA。 您能告诉我如何为串行端口设置低功耗模式吗? 低功耗串行端口工作时的近似功耗是多少? 是否有执行测试的程序?
您使用的平台是什么? 它是 Launchpad 还是定制板?
PA0 (UART0_TX) 需要一个上拉电阻、因为它无法驱动为高电平(开漏)。 此外、它需要是外部的、因为 PA0(通常为 ODIO)缺少内部上拉电阻。
我指的是 PA1 (UART0_RX)。 只要有器件连接到它、就不需要上拉电阻器、因为另一端正在驱动它。 如果有时它在另一端断开连接的情况下工作、则上拉电阻(也是外部的,因为 PA1 也是 ODIO)可能是一个好主意、但它应该相当弱(可能是 20k?) 以避免您描述的症状。
您考虑了什么类型的测试例程? 似乎您有一个测试用例。 最坏的情况可能是其他字节发送全 0x00 字节。
TI LaunchPad 示例如下:
https://dev.ti.com/tirex/explore/node?node=A__ABvATzSBKGw7HunA5.8.FQ__MSPM0-SDK__a3PaaoK__LATEST
“DriverLib"示“示例通常更简单、因此更容易进行实验。
您能否展示定制电路板的原理图? 使用 LaunchPad 时、是否安装了 J8(PA1 上拉)跳线? [在我的 Rev-E1 LaunchPad 上、这实际上是 J13。]
测试后、功耗仍然相对较高。 该工程用于超声波燃气表 L2228 从 FR5043 接收数据、每秒通信一次。
UART0 是低功耗串行端口吗?
2.执行中断接收时,中断服务例程是否在运行模式下运行?
进入数据接收状态时、大约有 7mS 的高电平。 是什么导致它高于 2mA?
FR5043 每秒传输 33 字节的数据一次、并接收 1.2mA 的瞬时电流。 此接收电流是否正常?
下图显示了收集的电流。

应有的尊重:你没有提供很多线索。 我不确定如何读取您发布的跟踪信息:是 1 字节还是 33 字节? 如果您使用的是 FIFO(尚未满)、则“凸点“本身就是 UART、但如果不是这样、则是 UART 加 CPU (ISR) 运行。
对于我的部分:我破坏了我的 LPM01A 并构建了一个简单的测试程序、猜测您可能使用的配置/代码。 这样,我就无法复制您发布的跟踪信息。 (我注意到 Rx 引脚上拉电阻似乎只会将电流增加约 0.5mA、而不是 1.5mA,这让我有点惊讶。)
要回答您的问题:
1) 我不知道什么构成了“低功耗 UART“。 TRM 似乎不使用该术语。 在某些情况下、我看到了它是指 (a) 低速+少数功能、以及 (b) 在检测到起始位(下降)边沿之前对位 时钟进行门控[TRM (SLAU847E) 第 21.2.3.1 节建议这样做、但“仅在接收时“使该操作有些荒谬]。
2) ISR 以 RUNx 模式 (SysConfig 中的“x")“)运行;在所有其他模式下、CPU 停止。
这是我一直在使用的。
这里没有太多内容:我从 uart_echo_interrupts_standby 示例开始、并添加了第二个 UART、我可以在 SysTick 中断中发送一个字节(标称值为 50ms)。
我的 PA0/PA1 跳接至 PB7/PB6。 (我也可以将 3V3 跳线连接到 J101 上 BAT 的 MCU 侧。) 我的目标是拥有一个自包含单元、我只能使用 VCC LPM01A 的 LPM/GND 进行驱动、这产生了可预测的时间行为。
我 使用 SysConfig 进行了实验、主要是 UART 速度模式和低功耗模式;.syscfg 内容反映了我最近尝试的所有内容。
.c:
#include "ti_msp_dl_config.h"
volatile uint8_t gEchoData0 = 0;
uint8_t Data1 = 0x5A;
int main(void)
{
SYSCFG_DL_init();
NVIC_ClearPendingIRQ(UART_0_INST_INT_IRQN);
NVIC_EnableIRQ(UART_0_INST_INT_IRQN);
DL_SYSCTL_enableSleepOnExit();
while (1) {
__WFI();
}
}
void UART_0_INST_IRQHandler(void)
{
switch (DL_UART_Main_getPendingInterrupt(UART_0_INST)) {
case DL_UART_MAIN_IIDX_RX:
DL_GPIO_togglePins(GPIO_LEDS_PORT,
GPIO_LEDS_USER_LED_1_PIN | GPIO_LEDS_USER_TEST_PIN);
gEchoData0 = DL_UART_Main_receiveData(UART_0_INST);
DL_UART_Main_transmitData(UART_0_INST, gEchoData0);
break;
default:
break;
}
}
void
SysTick_Handler(void)
{
DL_UART_Main_transmitData(UART_1_INST, Data1++);
return;
}
.syscfg:
/**
* These arguments were used when this file was generated. They will be automatically applied on subsequent loads
* via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
* @cliArgs --device "MSPM0L222X" --part "Default" --package "LQFP-80(PN)" --product "mspm0_sdk@2.06.00.06"
* @v2CliArgs --device "MSPM0L2228" --package "LQFP-80(PN)" --product "mspm0_sdk@2.06.00.06"
* @versions {"tool":"1.25.0+4268"}
*/
/**
* Import the modules used in this configuration.
*/
const GPIO = scripting.addModule("/ti/driverlib/GPIO", {}, false);
const GPIO1 = GPIO.addInstance();
const SYSCTL = scripting.addModule("/ti/driverlib/SYSCTL");
const SYSTICK = scripting.addModule("/ti/driverlib/SYSTICK");
const UART = scripting.addModule("/ti/driverlib/UART", {}, false);
const UART1 = UART.addInstance();
const UART2 = UART.addInstance();
/**
* Write custom configuration values to the imported modules.
*/
const mux2 = system.clockTree["EXCLKMUX"];
mux2.inputSelect = "EXCLKMUX_LFCLK";
GPIO1.$name = "GPIO_LEDS";
GPIO1.associatedPins.create(2);
GPIO1.associatedPins[0].$name = "USER_LED_1";
GPIO1.associatedPins[0].initialValue = "SET";
GPIO1.associatedPins[0].assignedPort = "PORTA";
GPIO1.associatedPins[0].assignedPin = "23";
GPIO1.associatedPins[1].$name = "USER_TEST";
GPIO1.associatedPins[1].assignedPort = "PORTA";
GPIO1.associatedPins[1].assignedPin = "21";
GPIO1.associatedPins[1].initialValue = "SET";
const Board = scripting.addModule("/ti/driverlib/Board", {}, false);
SYSCTL.clockTreeEn = true;
SYSCTL.forceDefaultClkConfig = true;
SYSCTL.powerPolicy = "STOP0";
SYSTICK.periodEnable = true;
SYSTICK.period = 1600000;
SYSTICK.interruptEnable = true;
SYSTICK.systickEnable = true;
UART1.$name = "UART_0";
UART1.enabledInterrupts = ["RX"];
UART1.uartClkSrc = "LFCLK";
UART1.ovsRate = "3";
UART1.peripheral.rxPin.$assign = "PA1";
UART1.peripheral.txPin.$assign = "PA0";
UART1.txPinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric0";
UART1.rxPinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric1";
UART2.$name = "UART_1";
UART2.uartClkSrc = "LFCLK";
UART2.ovsRate = "3";
UART2.peripheral.$assign = "UART1";
UART2.peripheral.rxPin.$assign = "PB7";
UART2.peripheral.txPin.$assign = "PB6";
UART2.txPinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric2";
UART2.rxPinConfig.$name = "ti_driverlib_gpio_GPIOPinGeneric3";
/**
* Pinmux solution for unlocked pins/peripherals. This ensures that minor changes to the automatic solver in a future
* version of the tool will not impact the pinmux you originally saw. These lines can be completely deleted in order to
* re-solve from scratch.
*/
GPIO1.associatedPins[0].pin.$suggestSolution = "PA23";
GPIO1.associatedPins[1].pin.$suggestSolution = "PA21";
Board.peripheral.$suggestSolution = "DEBUGSS";
Board.peripheral.swclkPin.$suggestSolution = "PA20";
Board.peripheral.swdioPin.$suggestSolution = "PA19";
UART1.peripheral.$suggestSolution = "UART0";