PQA怎样检测采样通道掉电

来源:互联网 发布:kali linux 校验和 编辑:程序博客网 时间:2024/05/23 19:14

在core0.c中开一个定时器每10周期对比一次捕获的频率是否一致,通常频率是在跳动的,如果检测到频率不跳动了,说明采样通道没有上电;

代码如下:

if( bPwrDwnDetTimeOut )//for power down detect{if(CaptureZeroPointPeriod_Backup != CaptureZeroPointPeriod){CaptureZeroPointPeriod_Backup = CaptureZeroPointPeriod;}else{    memset(AdcData, 0, (uint32_t )sizeof(AdcData)); //Clear the AdcData memory    memset(&FreqAC, 0, (uint32_t )sizeof(FreqAC));  //Clear the FreqAC memoryTriggerCore1ByGpio();}bPwrDwnDetTimeOut = false;}


原创粉丝点击