在线时间40 小时
UID3122873
注册时间2015-4-30
NXP金币0
该用户从未签到
注册会员

- 积分
- 190
- 最后登录
- 2016-2-17
|

楼主 |
发表于 2015-11-25 17:24:18
|
显示全部楼层
_int_install_isr()第一个参数我用的INT_CMP0,从39pin CMP0_IN4 送了一些脉冲信号进去,发现没有触发中断.
初始化的代码如下
//Set up HSCMP0 in NVIC. ISR put into vector table in isr.h file
_int_install_isr(INT_CMP0, cmp0_isr, 0);
//Enable HSCMP module clock
SIM_SCGC4 |= (SIM_SCGC4_CMP_MASK );
// Configure CMP.
CMP_CR0_REG(CMP0_BASE_PTR) = 0x00; // Filter and digital hysteresis disabled
CMP_CR1_REG(CMP0_BASE_PTR) = 0x15; // Continuous mode, high-speed compare, unfiltered output, output pin disabled
CMP_FPR_REG(CMP0_BASE_PTR) = 0x00; // Filter disabled
CMP_SCR_REG(CMP0_BASE_PTR) = 0x1E; // Enable rising and falling edge interrupts, clear flags
CMP_DACCR_REG(CMP0_BASE_PTR) = 0xAA; // 6-bit reference DAC enabled, output set to vdd/64*(42+1)= 0.80v, (Vin selected is vin1=Vdd)
CMP_MUXCR_REG(CMP0_BASE_PTR) = 0x27; // P-input as external channel 4. M-input as 6b DAC = 0.80v, it is adjustable with CMP_DACCR_REG
CMP_CR1_REG(CMP0_BASE_PTR) |= CMP_CR1_OPE_MASK; // Enable output pin for HSCMP0.
是不是哪里配置的有问题? |
|