4601|7

43

帖子

0

TA的资源

一粒金砂(初级)

楼主
 

CC2530串口收发的问题 [复制链接]

2530能发送数据到串口调试助手,但是串口台式助手发的数据却接收不到,我调试了一下,发现进步了接收中断,到底市场怎么回事呢?
此帖出自无线连接论坛

最新回复

zigbee定位,让网关在一定时间内收不到数据包,就驱动网关的蜂鸣器响。 下面是网关主要程序: //系统上电后,执行ZMain.c的int main()函数实现硬件的初始化,包括osal_int_disable( INTS_ALL );初始化板上硬件设置。。。当完成上述初始化时,执行osal_start_system()开始运行OSAL系统。(如下) ZSEG int main( void ) {       // Turn off interrupts       osal_int_disable( INTS_ALL );       // Initialize HAL       HAL_BOARD_INIT();       // Make sure supply voltage is high enough to run       zmain_vdd_check();       // Initialize stack memory       zmain_ram_init();           // Initialize board I/O       InitBoard( OB_COLD );       // Initialze HAL drivers       HalDriverInit();       // Initialize NV System       osal_nv_init( NULL );       // Determine the extended address       zmain_ext_addr();       // Initialize basic NV items       zgInit();       // Initialize the MAC       ZMacInit();    #ifndef NONWK       // Since the AF isn't a task, call it's initialization routine       afInit();    #endif    #ifdef LCD_SUPPORTED       HalLcdInit();    #endif      // Initialize the operating system       osal_init_system();      // Allow interrupts       osal_int_enable( INTS_ALL );      // Final board initialization       InitBoard( OB_READY );      //HalLcdInit();      // Display information about this device       zmain_dev_info();      /* Display the device info on the LCD */    #ifdef LCD_SUPPORTED       zmain_lcd_init();    #endif       osal_start_system(); // No Return from here } // main() //osal_start_system()一旦执行,就不再返回上面的main()函数。 //之后就进入下面的uint SampleApp_ProcessEvent(uint8 task_id,uint16 events),判断收到的数据包,是什么事件,该函数如下: uint16 SampleApp_ProcessEvent( uint8 task_id, uint16 events ) {   if ( events & SYS_EVENT_MSG )   {       afIncomingMSGPacket_t *MSGpkt = (afIncomingMSGPacket_t *)osal_msg_receive(                                                              SampleApp_TaskID );       while ( MSGpkt != NULL )      {               switch ( MSGpkt->hdr.event )               {               case KEY_CHANGE:                 handleKeys( ((keyChange_t *)MSGpkt)->state, ((keyChange_t *)MSGpkt)->keys );                 break;              case AF_DATA_CONFIRM_CMD:              #if !defined( RTR_NWK )                 {                         // This message is received as a confirmation of a data packet sent.                         // The status is of ZStatus_t type [defined in ZComDef.h]                 afDataConfirm_t *afDataConfirm = (afDataConfirm_t *)MSGpkt;                         /* No ACK from the MAC layer implies that mobile device is out of                  * range of most recent parent. Therefore, begin an orphan scan                  * to try to find a former parent.                  * NOTE: To get the fastest action in the process of finding a new                  * parent, set the MAX_JOIN_ATTEMPTS in ZDApp.c to 1.                  */                         if ( afDataConfirm->hdr.status == ZMacNoACK )                 {                   SampleApp_NoACK();                  }                         // Some other error -- Do something.                         else                         {                          }                         }                #endif                  break;         case AF_INCOMING_MSG_CMD:                  processMSGCmd( MSGpkt );                 break;         case ZDO_STATE_CHANGE:          #if defined( POWER_SAVING )                      if ( rejoinPending )                      {                rejoinPending = FALSE;                 // Ok to resume power saving ops.                SampleApp_Sleep( TRUE );                }          #endif               break;          default:          break;         }        osal_msg_deallocate( (uint8 *)MSGpkt );        MSGpkt = (afIncomingMSGPacket_t *)osal_msg_receive( SampleApp_TaskID );      }     // Return unprocessed events.     return ( events ^ SYS_EVENT_MSG );   }   return 0;  // Discard unknown eve } 现在就是加上逻辑功能没实现,帮帮忙。  详情 回复 发表于 2015-6-11 22:27
点赞 关注
 

回复
举报

22

帖子

0

TA的资源

一粒金砂(中级)

沙发
 
你这样连代码都没有,很难回复你
此帖出自无线连接论坛
 
 

回复

350

帖子

5

TA的资源

纯净的硅(初级)

板凳
 
恩恩,可以先发下代码看看,我相信会有大神帮你解决的,嘿嘿,我也学习学习,
此帖出自无线连接论坛
个人签名成功者找方法,失败者找理由
 
 
 

回复

81

帖子

0

TA的资源

一粒金砂(中级)

4
 
这个不好说,代码看不到没法分析。
此帖出自无线连接论坛

点评

zigbee定位,让网关在一定时间内收不到数据包,就驱动网关的蜂鸣器响。 下面是网关主要程序: //系统上电后,执行ZMain.c的int main()函数实现硬件的初始化,包括osal_int_disable( INTS_ALL );初始化板上硬件设  详情 回复 发表于 2015-6-11 22:27
个人签名51嵌入式,嵌入式开发的家园!51嵌入式官方QQ群52497844,欢迎爱好者加入。
 
 
 

回复

12

帖子

0

TA的资源

一粒金砂(初级)

5
 
试试加载一个USB驱动吧。
此帖出自无线连接论坛
 
 
 

回复

3

帖子

0

TA的资源

一粒金砂(初级)

6
 
现在呢?怎么样了 ?
此帖出自无线连接论坛
 
 
 

回复

8

帖子

0

TA的资源

一粒金砂(中级)

7
 
Hugo801122 发表于 2014-2-28 12:50
这个不好说,代码看不到没法分析。

楼主,怎么在zigbee定位里面,在一定时间收不到数据包,就驱动蜂鸣器响(刚入门,什么都不懂,尽量具体一点,谢谢)
此帖出自无线连接论坛
 
 
 

回复

8

帖子

0

TA的资源

一粒金砂(中级)

8
 
Hugo801122 发表于 2014-2-28 12:50
这个不好说,代码看不到没法分析。

zigbee定位,让网关在一定时间内收不到数据包,就驱动网关的蜂鸣器响。

下面是网关主要程序:
//系统上电后,执行ZMain.c的int main()函数实现硬件的初始化,包括osal_int_disable( INTS_ALL );初始化板上硬件设置。。。当完成上述初始化时,执行osal_start_system()开始运行OSAL系统。(如下)

ZSEG int main( void )
{
      // Turn off interrupts
      osal_int_disable( INTS_ALL );

      // Initialize HAL
      HAL_BOARD_INIT();

      // Make sure supply voltage is high enough to run
      zmain_vdd_check();

      // Initialize stack memory
      zmain_ram_init();
   
      // Initialize board I/O
      InitBoard( OB_COLD );

      // Initialze HAL drivers
      HalDriverInit();

      // Initialize NV System
      osal_nv_init( NULL );

      // Determine the extended address
      zmain_ext_addr();

      // Initialize basic NV items
      zgInit();

      // Initialize the MAC
      ZMacInit();

   #ifndef NONWK
      // Since the AF isn't a task, call it's initialization routine
      afInit();
   #endif

   #ifdef LCD_SUPPORTED
      HalLcdInit();
   #endif
     // Initialize the operating system
      osal_init_system();

     // Allow interrupts
      osal_int_enable( INTS_ALL );

     // Final board initialization
      InitBoard( OB_READY );
     //HalLcdInit();
     // Display information about this device
      zmain_dev_info();
     /* Display the device info on the LCD */
   #ifdef LCD_SUPPORTED
      zmain_lcd_init();
   #endif

      osal_start_system(); // No Return from here
} // main()



//osal_start_system()一旦执行,就不再返回上面的main()函数。

//之后就进入下面的uint SampleApp_ProcessEvent(uint8 task_id,uint16 events),判断收到的数据包,是什么事件,该函数如下:


uint16 SampleApp_ProcessEvent( uint8 task_id, uint16 events )
{
  if ( events & SYS_EVENT_MSG )
  {
      afIncomingMSGPacket_t *MSGpkt = (afIncomingMSGPacket_t *)osal_msg_receive(
                                                             SampleApp_TaskID );

      while ( MSGpkt != NULL )
     {
              switch ( MSGpkt->hdr.event )
              {
              case KEY_CHANGE:
                handleKeys( ((keyChange_t *)MSGpkt)->state, ((keyChange_t *)MSGpkt)->keys );
                break;


             case AF_DATA_CONFIRM_CMD:
             #if !defined( RTR_NWK )
                {
                        // This message is received as a confirmation of a data packet sent.
                        // The status is of ZStatus_t type [defined in ZComDef.h]
                afDataConfirm_t *afDataConfirm = (afDataConfirm_t *)MSGpkt;

                        /* No ACK from the MAC layer implies that mobile device is out of
                 * range of most recent parent. Therefore, begin an orphan scan
                 * to try to find a former parent.
                 * NOTE: To get the fastest action in the process of finding a new
                 * parent, set the MAX_JOIN_ATTEMPTS in ZDApp.c to 1.
                 */
                        if ( afDataConfirm->hdr.status == ZMacNoACK )
                {
                  SampleApp_NoACK();
                 }
                        // Some other error -- Do something.
                        else
                        {
                         }
                        }
               #endif
                 break;


        case AF_INCOMING_MSG_CMD:
                 processMSGCmd( MSGpkt );
                break;

        case ZDO_STATE_CHANGE:
         #if defined( POWER_SAVING )
                     if ( rejoinPending )
                     {
               rejoinPending = FALSE;

                // Ok to resume power saving ops.
               SampleApp_Sleep( TRUE );
               }
         #endif
              break;

         default:
         break;
        }

       osal_msg_deallocate( (uint8 *)MSGpkt );
       MSGpkt = (afIncomingMSGPacket_t *)osal_msg_receive( SampleApp_TaskID );
     }

    // Return unprocessed events.
    return ( events ^ SYS_EVENT_MSG );
  }

  return 0;  // Discard unknown eve
}

现在就是加上逻辑功能没实现,帮帮忙。
此帖出自无线连接论坛
 
 
 

回复
您需要登录后才可以回帖 登录 | 注册

随便看看
查找数据手册?

EEWorld Datasheet 技术支持

相关文章 更多>>
快速回复 返回顶部 返回列表