请教一下,32G8K64 LQFP48,为什么P53置1之后没有输出?
测试代码是例子代码(01-IO-跑马灯)改写的:
- /*---------------------------------------------------------------------*/
- /* --- STC MCU Limited ------------------------------------------------*/
- /* --- STC 1T Series MCU Demo Programme -------------------------------*/
- /* --- Mobile: (86)13922805190 ----------------------------------------*/
- /* --- Fax: 86-0513-55012956,55012947,55012969 ------------------------*/
- /* --- Tel: 86-0513-55012928,55012929,55012966 ------------------------*/
- /* --- Web: www.STCAI.com ---------------------------------------------*/
- /* --- Web: www.STCMCUDATA.com ---------------------------------------*/
- /* --- BBS: www.STCAIMCU.com -----------------------------------------*/
- /* --- QQ: 800003751 -------------------------------------------------*/
- /* 如果要在程序中使用此代码,请在程序中注明使用了STC的资料及程序 */
- /*---------------------------------------------------------------------*/
-
- #include "config.h"
- #include "STC32G_GPIO.h"
- #include "STC32G_Delay.h"
-
- /*************** 功能说明 ****************
-
- 程序使用P6口来演示跑马灯。
-
- 下载时, 选择时钟 24MHz (可以在配置文件"config.h"中修改).
-
- ******************************************/
-
- //========================================================================
- // 本地常量声明
- //========================================================================
-
- u8 code ledNum[]={0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80};
-
- //========================================================================
- // 本地变量声明
- //========================================================================
-
- u8 ledIndex;
-
- //========================================================================
- // 函数: GPIO_config
- // 描述: 用户初始化程序.
- // 参数: None.
- // 返回: None.
- // 版本: V1.0, 2020-09-28
- //========================================================================
- void GPIO_config(void)
- {
- P5_MODE_IO_PU(GPIO_Pin_3); //P0.4设置为准双向口
- P5_MODE_IO_PU(GPIO_Pin_2);
-
- // P0_MODE_IO_PU(GPIO_Pin_4); //P0.4设置为准双向口
-
- // P4_MODE_IO_PU(GPIO_Pin_0); //P4.0设置为准双向口
- // P6_MODE_IO_PU(GPIO_Pin_All); //P6 设置为准双向口
- }
-
- //========================================================================
- // 函数: main
- // 描述: 用户应用程序.
- // 参数: None.
- // 返回: None.
- // 版本: V1.0, 2020-09-23
- //========================================================================
- void main(void)
- {
- WTST = 0; //设置程序指令延时参数,赋值为0可将CPU执行指令的速度设置为最快
- EAXSFR(); //扩展SFR(XFR)访问使能
- CKCON = 0; //提高访问XRAM速度
-
- GPIO_config();
-
- P53 = 1;
- P52 = 1;
-
- // P04 = 0; //打开实验板LED电源
-
- while(1)
- {
- delay_ms(250);
- /*
- P6 = ~ledNum[ledIndex]; //输出低驱动
- ledIndex++;
- if(ledIndex > 7)
- {
- ledIndex = 0;
- }
- */
- }
- }
-
-
-
-
复制代码
万用表测试,P52 有 5V,P53是0.0几V
请教一下这是什么原因??
|