我设置一个周期性定时的定时器T2CCP0,在中断中开启另两个定时器T3CCP0和T3CCP1的捕捉模式捕捉高电平可以吗?
现在输入端用示波器看有电平变化,但是就是进不去中断,请问为什么呢
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.
我设置一个周期性定时的定时器T2CCP0,在中断中开启另两个定时器T3CCP0和T3CCP1的捕捉模式捕捉高电平可以吗?
现在输入端用示波器看有电平变化,但是就是进不去中断,请问为什么呢
现在设置了中断优先级了,第一个定时器优先级1,后两个0,为什么还是进不去内层中断
设置优先级的代码
IntPriorityGroupingSet(0x03);
……
IntPrioritySet(INT_TIMER2A, 1<<5);
……
IntPrioritySet(INT_TIMER3A, 0<<5);
……
IntPrioritySet(INT_TIMER3B, 0<<5);
对不对呢?为什么要搞这个<<5 ?
为什么要左移5,这是由最低优先级决定的,你看看这个的代码是怎么写的就知道了
请问应该怎么设置呢? 设置优先级的代码能麻烦您给说一下吗
您看我的设置对不对呢?
这样设置T2CCP0中断的时候能不能进T3CCP0和T3CCP1的中断呢
\verbatim
//! //
//! // Set the UART 0 interrupt priority to the lowest priority.
//! //
//! IntPrioritySet(INT_UART0, 0xE0);
//!
//! //
//! // Set the USB 0 interrupt priority to the highest priority.
//! //
//! IntPrioritySet(INT_USB0, 0);
//!
//! \endverbatim
//!
//! \return None.
//
//*****************************************************************************
void
IntPrioritySet(uint32_t ui32Interrupt, uint8_t ui8Priority)
{
uint32_t ui32Temp;
//
// Check the arguments.
//
ASSERT((ui32Interrupt >= 4) && (ui32Interrupt < NUM_INTERRUPTS));
//
// Set the interrupt priority.
//
ui32Temp = HWREG(g_pui32Regs[ui32Interrupt >> 2]);
ui32Temp &= ~(0xFF << (8 * (ui32Interrupt & 3)));
ui32Temp |= ui8Priority << (8 * (ui32Interrupt & 3));
HWREG(g_pui32Regs[ui32Interrupt >> 2]) = ui32Temp;
}
0xE0为最低优先级,0为最高优先级,你这么设置2的中断低于3的中断,明显不可以
我希望的就是3的中断等级更高,可以随时进入中断