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.

[参考译文] MSP430FR5969:TimerB 时钟在暂停时停止、忽略调试时钟停止设置

Guru**** 2448780 points
Other Parts Discussed in Thread: MSP430FR5969

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

https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/1499650/msp430fr5969-timerb-clock-is-stopped-upon-pause-ignoring-debug-clock-stop-settings

器件型号:MSP430FR5969

工具/软件:

您好:

设置:

MSPFET USB 编程器、处于 JTAG 模式

MSP430FR5969、4MHz xtal

Ubuntu 22.04.5 LTS

CSSSTUDIO 版本:20.1.0.6__1.7.0

TimerB 使用输出 PWM 信号来控制稳压器的电压输出。  它的连续功能至关重要、PWM 中的暂停会导致向输出提供最大电压。

调试时钟设置明确不会停止 TimerB 时钟。  并且不阻止中断的发生。


重现:

1)重新启动 CSS 后,调试器的第一个启动将运行程序,并在 main()上暂停。

2)点击"继续"、然后 TimerB 被初始化、并开始运行。

3)如果我们点击暂停,或触发断点, TimerB 停止运行。

预期行为:对于步骤3)。 TimerB 应继续运行。

要解决此问题:

1)调试器运行程序、并在 main()上暂停。

2)我们更改调试时钟设置、更改我们不使用的任何外设的值、并将时钟的状态切换为停止或不停止。 例如、RTC 时钟停止、到 RTC 时钟不停止。

3)发出重新启动以更改调试时钟设置。

4)现在、此会话将允许 timerB 时钟按照调试时钟设置中的初始指定运行。  这一直有效直到我们停止程序。  

我尝试了很多方法、更改了 Clock_System 时钟类型、想看看 CS_TimerB 位是否不同、计时器配置是否不同、系统系统系统模块寄存器是否不同、但似乎找不到任何差异。

调试时钟设置似乎没有正确发送给编程器、除非它们发生了更改。

void init_pwm (){
Timer_B_STOP (TIMER_B0_BASE);

Timer_B_outputPWMParam paramB ={0};
paramb.clockSource = TIMER_B_CLOCKSOURCE_SMCLK;
paramB.clockSourceDivider = TIMER_B_CLOCKSOURCE_Divider_1;
paramB.timerPeriod = timer_period;
paramB.compareRegister = TIMER_B_CAPTURECOMPARE_REGISTER_5;
paramB.compareOutputMode = TIMER_B_OUTPUTMODE_RESET_SET;
paramB.dutyCycle = 200
Timer_B_outputPWM (TIMER_B0_BASE、&paramB);
}