资源简介

cc2420+atmega128基础zigbee无线通信实验-应答ACK帧实验 实验内容 掌握ACK帧格式 如何正确回复ACK帧 全套程序都放上 绝对有价值 可以看程序清单 ├─receive (1 folders, 48 files, 968.48 KB, 0.96 MB in total.) ││adc_sensor.c 2.06 KB ││adc_sensor.h 638 bytes ││adc_sensor.lst 13.62 KB ││adc_sensor.o 8.64 KB ││avrhardware.c 4.27 KB ││avrhardware.h 5.06 KB ││avrhardware.lst 145.28 KB ││avrhardware.o 28.48 KB ││cc2420.c 14.85 KB ││cc2420.h 2.45 KB ││cc2420.lst 85.96 KB ││cc2420.o 19.87 KB ││CC2420Const.h 9.04 KB ││generic.h 1.67 KB ││interupter.c 1.00 KB ││interupter.h 604 bytes ││interupter.lst 9.86 KB ││interupter.o 8.09 KB ││led.c 3.16 KB ││led.h 828 bytes ││led.lst 22.97 KB ││led.o 10.90 KB ││main.c 4.55 KB ││main.cof 85.77 KB ││main.eep 13 bytes ││main.elf 62.13 KB ││main.hex 23.89 KB ││main.lss 180.87 KB ││main.lst 28.78 KB ││main.map 78.18 KB ││main.o 12.50 KB ││main.sym 13.40 KB ││Makefile 10.74 KB ││os.c 2.62 KB ││os.h 1.15 KB ││os.lst 17.67 KB ││os.o 5.92 KB ││project.h 1.60 KB ││receive.pnproj 748 bytes ││timer3.c 2.15 KB ││timer3.h 856 bytes ││timer3.lst 13.68 KB ││timer3.o 8.44 KB ││top.h 653 bytes ││uart0.c 1.04 KB ││uart0.h 691 bytes ││uart0.lst 6.68 KB ││uart0.o 4.56 KB

资源截图

代码片段和文件信息

//----------------------------------------------------//
//-------Institute Of  Computing Technology-----------//
//------------Chinese Academic  Science---------------//
//-----中国科学院计算技术研究所先进测试技术实验室-----//
//----------------------------------------------------//

/**
 * www.wsn.net.cn
 * @copyright:nbicc_lpp
 * @data:2005.11.22
 * @version:0.0.1
 * @updata:$
 *
 */
#include “adc_sensor.h“
 

uint8_t  adc_init(void)
{
     { 
           os_atomic_t _nesc_atomic = os_atomic_start();
  {
           //ADC控制寄存器中ADIE位和ADSC位清零 
                  ADCSRA &=0x86;
           //设置参考电压,配置为默认情形
                  ADMUX=0;
            }
          os_atomic_end(_nesc_atomic);
     }
    ADC_INTERRUPT_FLAG=0;
 
}

uint8_t  sensor_init(void)
{
  { os_atomic_t _nesc_atomic = os_atomic_start();

    {
     
      
      OS_MAKE_INT1_OUTPUT();
      OS_SET_INT1_PIN();
      //whether to configure  the INT2 pin???
    }

    os_atomic_end(_nesc_atomic); }           
          
}

void read_data_task(void)
{
  uint8_t loopnum=0;
  while (loopnum<10)
  {
  
  SENSOR_DATA_VALUE[loopnum]=0;
  { os_atomic_t _nesc_atomic = os_atomic_start();

    {
     //设置ADMUX寄存器
         ADMUX |=0x01;  
     //AD使能开始AD转换
         ADCSRA |=0xe7; 
     }

    os_atomic_end(_nesc_atomic); }       

     //查询ADCSRA中断,
  
   while(ADC_INTERRUPT_FLAG==0)
    {    
          ADC_INTERRUPT_FLAG=(ADCSRA&0x10);
    }
  
    //读取ADCH和ADCL
    
    SENSOR_DATA_VALUE[loopnum]=ADCL;
    SENSOR_DATA_VALUE[loopnum]+=(ADCH<<8);
    printf(“sensor is %04x\n“SENSOR_DATA_VALUE[loopnum]);
  { os_atomic_t _nesc_atomic = os_atomic_start();

    {
     //清除ADC中断标志
          ADCSRA |=0x10;
     //关闭ADC转换使能
          //ADCSRA &=0x7f;
     }
      os_atomic_end(_nesc_atomic); }  
  
   //printf(“sensor is %04x\n“SENSOR_DATA_VALUE);
  // SENSOR_DATA_VALUE=0;
   adc_init();
   //
   //OS_CLR_INT1_PIN();
   ADC_INTERRUPT_FLAG=0;
   //sensor_init();
loopnum++;
  } 
 
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       2481  2007-01-30 16:43  6.5.应答ACK帧实验\receive\.dep\adc_sensor.o.d

     文件       1407  2007-01-30 16:43  6.5.应答ACK帧实验\receive\.dep\avrhardware.o.d

     文件       2443  2007-01-30 16:43  6.5.应答ACK帧实验\receive\.dep\cc2420.o.d

     文件       2481  2007-01-30 16:43  6.5.应答ACK帧实验\receive\.dep\interupter.o.d

     文件       2437  2007-01-30 16:43  6.5.应答ACK帧实验\receive\.dep\led.o.d

     文件       2463  2007-01-30 16:42  6.5.应答ACK帧实验\receive\.dep\main.o.d

     文件         50  2007-01-30 16:43  6.5.应答ACK帧实验\receive\.dep\os.o.d

     文件       2443  2007-01-30 16:43  6.5.应答ACK帧实验\receive\.dep\timer3.o.d

     文件       1590  2007-01-30 16:43  6.5.应答ACK帧实验\receive\.dep\uart0.o.d

     目录          0  2007-04-11 09:24  6.5.应答ACK帧实验\receive\.dep

     文件       2114  2006-01-10 11:27  6.5.应答ACK帧实验\receive\adc_sensor.c

     文件        638  2006-01-10 11:28  6.5.应答ACK帧实验\receive\adc_sensor.h

     文件      13945  2007-01-30 16:43  6.5.应答ACK帧实验\receive\adc_sensor.lst

     文件       8848  2007-01-30 16:43  6.5.应答ACK帧实验\receive\adc_sensor.o

     文件       4377  2006-01-10 11:28  6.5.应答ACK帧实验\receive\avrhardware.c

     文件       5177  2006-04-18 10:18  6.5.应答ACK帧实验\receive\avrhardware.h

     文件     148765  2007-01-30 16:43  6.5.应答ACK帧实验\receive\avrhardware.lst

     文件      29164  2007-01-30 16:43  6.5.应答ACK帧实验\receive\avrhardware.o

     文件      15211  2006-04-19 09:33  6.5.应答ACK帧实验\receive\cc2420.c

     文件       2512  2006-04-18 10:16  6.5.应答ACK帧实验\receive\cc2420.h

     文件      88027  2007-01-30 16:43  6.5.应答ACK帧实验\receive\cc2420.lst

     文件      20348  2007-01-30 16:43  6.5.应答ACK帧实验\receive\cc2420.o

     文件       9252  2006-01-10 11:28  6.5.应答ACK帧实验\receive\CC2420Const.h

     文件       1708  2006-04-17 16:32  6.5.应答ACK帧实验\receive\generic.h

     文件       1025  2006-04-18 17:14  6.5.应答ACK帧实验\receive\interupter.c

     文件        604  2006-01-10 11:28  6.5.应答ACK帧实验\receive\interupter.h

     文件      10098  2007-01-30 16:43  6.5.应答ACK帧实验\receive\interupter.lst

     文件       8280  2007-01-30 16:43  6.5.应答ACK帧实验\receive\interupter.o

     文件       3232  2006-01-10 11:28  6.5.应答ACK帧实验\receive\led.c

     文件        828  2006-01-10 11:28  6.5.应答ACK帧实验\receive\led.h

............此处省略87个文件信息

评论

共有 条评论