配置寄存器使CC2540进入PM2模式后,想使用睡眠定时器通过中断唤醒芯片,发现无法触发中断。
但是,如果CC2540处于正常模式下,使用睡眠定时器就能触发中断。请问是什么原因?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
配置寄存器使CC2540进入PM2模式后,想使用睡眠定时器通过中断唤醒芯片,发现无法触发中断。
但是,如果CC2540处于正常模式下,使用睡眠定时器就能触发中断。请问是什么原因?
您的意思是芯片外部的32.768的晶振有问题?还是需要在程序中做什么操作?
因为芯片在PM2模式下,我拿示波器观察32K的晶振,发现是有波形的,所以硬件上应该没有问题。
Sleep timer是在PM2 模式下面, 高速晶振关闭的情况下用32k 时钟驱动的.
请问您的Sleep timer是如何配置的呢?
uint32 sleep_time = 0;
sleep_time |= ST0;
sleep_time |= (uint32)ST1 << 8;
sleep_time |= (uint32)ST2 << 16;
sleep_time += ((uint32)ms * (uint32)32768);
while(!(STLOAD & 1));
ST2 = (uint8)(sleep_time >> 16);
ST1 = (uint8)(sleep_time >> 8);
ST0 = (uint8) sleep_time ;
这是我编写的sleep timer的程序。
同时中断 STIE = 1, STIF = 0,EA = 1 。