我用的ov7620摄像头,KL26芯片,只能进入行中断,场中断一直进不去结果图像一直全黑,怎么回事呢???代码如下: void main() {
DisableInterrupts; //禁止总中断 uart_init (UART_PORT, 115200); dma_portx2buff_init(DMA_CH0, (void *)&PTE_B2_IN, (void *)ImageBuf[rowCnt], PTA7, DMA_BYTE1, ); DMA_DIS(DMA_CH0); DMA_IRQ_DIS(DMA_CH0); disable_irq(PORTA_IRQn); port_init(PTA7, ALT1 | DMA_FALLING | PULLDOWN ); port_init(PTA6, ALT1 | IRQ_RISING | PULLDOWN | PF); port_init(PTA5, ALT1 | IRQ_RISING | PULLDOWN | PF); set_vector_handler(PORTA_VECTORn ,PORTA_IRQHandler); set_vector_handler(DMA0_VECTORn ,DMA0_IRQHandler); enable_irq(PORTA_IRQn); EnableInterrupts;//中断允许 while(1) { } } void PORTA_IRQHandler() { if( PORTA_ISFR& (1 << 5)) //PTB23触发中断 {
PORTA_ISFR =~0;// (1 << 23); //写1清中断标志位 dma_repeat(DMA_CH0, (void *)&PTE_B2_IN, (void *)ImageBuf[rowCnt],320); DMA_IRQ_EN(DMA_CH0); rowCnt++; if(rowCnt==ROW) { rowCnt = 0; DMA_DIS(DMA_CH0); z=0; send=1;
}
} //---VSYN场中断处理 if(PORTA_ISFR& (1 << 6)) {
PORTA_ISFR =~0; owCnt = 0; SampleFlag = 1; z=0;
}
void DMA0_IRQHandler()
{
DMA_IRQ_CLEAN(DMA_CH0);
DMA_IRQ_DIS(DMA_CH0);
}
是哪里出现问题了呢???
|