M0516LAN测量工频信号
M0516LAN中,从P4.0中送入一个50HZ方波信号,测量周期。初始化如下:
SYSCLK->CLKSEL1.PWM01_S = 0x00;
PWMA->CSR.CSR0 = 0x04;
PWMA->PPR.CP01 = 12;
PWMA->CCR0.INV0 = 0;
PWMA->CCR0.CRL_IE0 = 1;
PWMA->CCR0.CAPCH0EN = 1;
PWMA->CNR0 = 0xffff;
PWMA->CAPENR = 0x01;
SYS->P4_MFP.SCHMITT = 0X01;
SYS->P4_MFP.ALT0_PWM0 = 0X00;
SYS->P4_MFP.MFP0_PWM0 = 0X01;
PWMA->PCR.CH0EN = 1;
中断一直进不去,P0.0上没有反应:
void PWMA_IRQHandler(void)
{
if (giv_temp0==0)
{
giv_temp0 = 1;
DrvGPIO_SetBit(E_PORT0,E_PIN0);
}
else
{
giv_temp0 = 0;
DrvGPIO_ClrBit(E_PORT0,E_PIN0);
}
}
谁能帮忙看看,是不是哪里设置错了,谢谢! 已解决,封贴。 估计也要封ID了 LZ,既然你发帖子问人了,在解决问题的同时起码也要把答案公布吧!
这种行为确实该封ID
页:
[1]