我最近在用MSP430F5438A写一个fft(快速傅立叶)算法时,发时程序无法时行调试也无法进入中断。在TI的外国论坛上看到原因大概是因为文件中有大量的待初始化数据,在完成数据初始化之前,看门狗不会关闭,当数据初始化用时过多时会因为看门狗复位使程序无法正常运行。据说要在初始化数据之前调用 __system_pre_init() ,但鄙人英文不太好,不知道具体的该如何。希望 大家给予解惑,谢谢!
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.
我最近在用MSP430F5438A写一个fft(快速傅立叶)算法时,发时程序无法时行调试也无法进入中断。在TI的外国论坛上看到原因大概是因为文件中有大量的待初始化数据,在完成数据初始化之前,看门狗不会关闭,当数据初始化用时过多时会因为看门狗复位使程序无法正常运行。据说要在初始化数据之前调用 __system_pre_init() ,但鄙人英文不太好,不知道具体的该如何。希望 大家给予解惑,谢谢!
Qingcui Lu,
将下列代码放在main函数之前即可。你先试试。会在初始化数据之前,会先进入下列函数将看门狗关掉。
#include <intrinsics.h>
#include "msp430.h"
int _system_pre_init(void)
{
/* Insert your low-level initializations here */
/* Disable Watchdog timer to prevent reset during */
/* long variable initialization sequences. */
WDTCTL = WDTPW | WDTHOLD;
/*==================================*/
/* Choose if segment initialization */
/* should be done or not. */
/* Return: 0 to omit initialization */
/* 1 to run initialization */
/*==================================*/
return 1;
}