上电复位后,P3.0是默认为I/O功能的,将P3.0设成输出口且输出低电平,80ms后IC会复位,但是将P3.0输出高电平就不会复位,这是为什么?P3.0脚没有外接任何元件,我的程序如下:
#include <stdio.h>
#include "NUC029xAN.h"
/*---------------------------------------------------------------------------------------------------------*/
/* Global variables */
/*---------------------------------------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------------------------------------*/
/* Define functions prototype */
/*---------------------------------------------------------------------------------------------------------*/
int32_t main(void);
void SYS_Init(void)
{
//---------------------------------------------------------------------------------------------------------
// Init System Clock
//---------------------------------------------------------------------------------------------------------
// Enable external XTAL 12MHz clock
CLK_EnableXtalRC(CLK_PWRCON_XTL12M_EN_Msk);
// Waiting for external XTAL clock ready
CLK_WaitClockReady(CLK_CLKSTATUS_XTL12M_STB_Msk);
// Switch HCLK clock source to Internal RC and HCLK source divide 1
CLK_SetHCLK(CLK_CLKSEL0_HCLK_S_HXT, CLK_CLKDIV_HCLK(1));
/* Update System Core Clock */
/* User can use SystemCoreClockUpdate() to calculate PllClock, SystemCoreClock and CycylesPerUs automatically. */
SystemCoreClockUpdate();
}
/*---------------------------------------------------------------------------------------------------------*/
/* MAIN function */
/*---------------------------------------------------------------------------------------------------------*/
int main(void)
{
/* Unlock protected registers */
SYS_UnlockReg();
/* Init System, IP clock and multi-function I/O */
SYS_Init();
/* Lock protected registers */
SYS_LockReg();
GPIO_SetMode(P1, BIT6, GPIO_PMD_OUTPUT);
P16 = 0;
//GPIO_SetMode(P3, BIT0, GPIO_PMD_OUTPUT);
P30 = 0;
while(1);
}
|