|
发表于 2011-12-20 09:01:46
|
显示全部楼层
不是吧。。。好像CC1100收到数据包后就自动退出WOR模式了吧。。。
#pragma vector=PORT2_VECTOR
__interrupt void port2_ISR (void)
{
unsigned char i;
signed int temperature;
if(CC1100GDO0_INT) //GDO0
{
start_clock(); //等待外部晶振工作稳定
while(CC1100GDO0_STAT);
if(RFReceivePacket(cc1100_rxbuf,4))
{
//接收到定时唤醒命令
if((cc1100_rxbuf[0]==cc1100_address) && (cc1100_rxbuf[1]==0x1f) &&
(cc1100_rxbuf[2]==0x2e) && (cc1100_rxbuf[3]==0x3d))
{
LED_ON;
CC1100_Strobe(CC1100_SPWD);//进入低功耗状态
GetTemp();
battery_voltage();
temperature = (int)(Temper*10);
cc1100_txbuf[0] = 0x01;
cc1100_txbuf[1] = (temperature & 0xff00)>>8;
cc1100_txbuf[2] = temperature & 0x00ff;
cc1100_txbuf[3] = (unsigned char)(u_battery);
for(i=0;i<4;i++) cc1100_rxbuf = 0;
LED_OFF;
CC1100_WriteBurstReg(CC1100_PATABLE, paTable, 8);//Write PATABLE,设置发射功率为+10dB
RFSendPacket(cc1100_txbuf,4);
CC1100_Strobe(CC1100_SWOR);//进入WOR状态
LED_OFF;
}
我的一段程序,这是CC1100在WOR模式下收到数据后,给CPU中断信号后的处理程序,在数据处理完毕后,给主站发送信息后,重新返回WOR模式。 |
|