首页 | 新闻 | 新品 | 文库 | 方案 | 视频 | 下载 | 商城 | 开发板 | 数据中心 | 座谈新版 | 培训 | 工具 | 博客 | 论坛 | 百科 | GEC | 活动 | 主题月 | 电子展
返回列表 回复 发帖

有看过SMAC3.1C的Lighting Demo程序的吗

有看过SMAC3.1C的Lighting Demo程序的吗

有看过SMAC3.1C的Lighting Demo程序的吗

它的Lighting_demo_controller程序
它的注释说PB0不是可以唤醒MCU吗
但我发现它的PB1也能唤醒MCU???
 

/**************************************************************
  *    Main Loop, repeated now forever
  **************************************************************/
  for(;;)
  {
    u8DeviceLed = 0x05; /* LEDs all off */
    u8LightLed = 0x05;
    LedDrive(u8DeviceLed);
      u8AppStatus = 0;
    /* Enable keyboard irq. Depressing PB0 will cause a wake up */
    KBI1SC_KBIMOD = 0;
    PB0IE =1;
    KBI1SC_KBI1E = 1;
    /* MC13192 Reset mode and MCU STOP3. */
    /* This is the stand-by low power mode. */
    UseMcuClock(); /* MCU internal clock selected since we'll lose our external clock */
     MC13192ContReset(); /* Place the MC13192 into Reset mode */
    //KBDWAIT(); /* Wait for PB1 to be depressed. Note: requires Rev C GB60 board */
    /* PB0 depressed */
    u8Dsn++; /* increment the data sequence number */
    if (u8Dsn == 0xFF) /* 0xFF is reserved and used at startup only for devices */
    {
        u8Dsn = 0x00;
    }
    /* Restart to external clock appx. 10.8mS */
    MC13192Restart(); /* Bring the MC13192 into the desired Idle condition. */
     RadioInit();
      MLMESetChannelRequest(0); /* Set the selected u8Channel. */
    MLMESetMC13192ClockRate(1); /* Back to 8MHz CLKo */
    UseExternalClock(); /* Use external accurate clock */
   
    u16OldTime = MCUReadTmr1();
    u16NewTime = u16OldTime;
    u8ToCount = 0;
并且从这一段程序来看
好象MCU是自动唤醒的???请斑竹指点一下
那/* Enable keyboard irq. Depressing PB0 will cause a wake up */
这句话怎么解释呢?谢谢斑竹
谢谢seuafu2005
但是还有一点疑问:
本程序开始放开了KBI中断
在让MC13192 Reset mode and MCU STOP3
接着Bring the MC13192 into the desired Idle condition并且MCU被唤醒
我用的是13192SARD的模块
问题是:1.前面程序并没指明是哪个按键唤醒啊
2.唤醒后,程序从哪儿开始执行 是从u8Dsn++; /* increment the data sequence number */这儿吗??
3.斑竹能不能具体说说KBDWAIT(); 的功能,用不用它有何影响?
非常感谢!!!
返回列表