TI中文支持网
TI专业的中文技术问题搜集分享网站

MSP430FR2433低功耗后功耗缓慢增涨,堆栈如何设置才不溢出。

各位前辈,我在些请教两个问题。

1.我使用的是MSP430FR2433+NBIoT模块做的物联网水表,但我发现,当系统刚刚进入低功耗模式的工作电流大概在30uA左右,但是继续观察会发现系统的功能会逐渐增大,大概每二三十秒增加1uA的样子,可以达到100多uA甚至更多,在此期间NBIoT模块一直处于低功耗模式,单测NBIoT模块的不到10uA。在电流增加的过程中单片机可以响应IO口中断等功能。是因为我未使用的IO配置问题还是什么问题。

我在程序中使用了如下指令来降低功耗

PM5CTL0 &= ~LOCKLPM5;

__bis_SR_register(LPM3_bits | GIE);   // Enter LPM3 w/ interrupt

2.我使用的编译器是CCS 8.0,我如何设置堆栈才能保证不会溢出,因为程序中使用串口打印和函数回调等,同时还有几个上百字节的数组,在程序运行到部分代码时会出现程序跑飞或部分程序不执行的情况,请问如何解决。

下面是我的程序编译后的空间占用信息。

感谢各位前辈指导。

Susan Yang:

<p>建议您先不接 NBIoT模块 试试还是否会出现这样的情况。</p>
另外关于unused IO,您可以看一下用户指南 www.ti.com.cn/…/slau445h.pdf

8.3.2 Configuration of Unused Port Pins
To prevent a floating input and to reduce power consumption, unused I/O pins should be configured as I/O function, output direction, and left unconnected on the PC board. The value of the PxOUT bit is don't care, because the pin is unconnected. Alternatively, the integrated pullup or pulldown resistor can be enabled by setting the PxREN bit of the unused pin to prevent a floating input. See the System Resets, Interrupts, and Operating Modes, System Control Module (SYS) chapter for termination of unused pins.

NOTE: Configuring port PJ and shared JTAG pins:
The application should make sure that port PJ is configured properly to prevent a floating input. Because port PJ is shared with the JTAG function, floating inputs may not be noticed when in an emulation environment. Port J is initialized to high-impedance inputs by default.

Susan Yang:

堆栈管理可以通过项目选项对话来配置保留堆栈尺寸(Project → Properties → CCS Build → MSP430 Linker → Basic Options → Set C System Stack Size)。 堆栈的尺寸被定义为从 RAM 最后的位置扩展 50 至 80 字节(也就是说,堆栈从RAM 向下延伸 50 至 80 字节,具体扩展的字节数取决于所选器件的 RAM 大小)。

Ling Zhu2:

功耗问题建议检查一下IO口配置,不用的IO口需要配置为固定电平。
还有你有没有用外部晶振呢?

user5350304:

回复 Susan Yang:

 我配置成了1000和500是不是太大了,实际起作用的是多大呢,如果不够用我该怎么办。

user5350304:

回复 Ling Zhu2:

没有外部晶振

Ling Zhu2:

回复 user5350304:

user5350304没有外部晶振

灰小子:

1、这种功耗缓慢增加的情况,很大概率都是io没配置好。没用到的io要设置为固定的电平状态,不然会受外界电磁环境影响从而增加功耗。

2、不建议设置太大的堆栈,可以考虑把大数据定义到FRAM区域。

赞(0)
未经允许不得转载:TI中文支持网 » MSP430FR2433低功耗后功耗缓慢增涨,堆栈如何设置才不溢出。
分享到: 更多 (0)