我的图象是靠LM1881分离同步信号,但是我下午刚接上参考电压还可以出图象,现在又什么也没有了,怎么回事?图象提取程序是这样的:
/************************IRQ Interrupt**********************/
#pragma CODE_SEG NON_BANKED
interrupt void IRQ_ISR (void)
{ m_cCCDFrameShiftFlag = m_cCCDFrameShiftFlag|CCD_VS;
if(m_cCCDFrameShiftFlag == 0xfe){
m_cFrameSyncFlag = 1; //同步标志
}
/*if(PORTA_BIT1==1){
m_cFrameSyncFlag = 1;
}else{
m_cFrameSyncFlag =0;
m_cFrameCompleteFlag = 0;
m_cFrameSampeFlag=0 ;
}*/
m_cCCDFrameShiftFlag = m_cCCDFrameShiftFlag<<1;
if(m_cFrameSyncFlag == 1){
m_cMuxPulseCnt++; //==19 COLS=50旁边刚好有两行
if(PORTA_BIT0==0) { //去掉
if(m_cMuxPulseCnt == 22){ //SAMPLE_START_CNT 23
m_cFrameSampeFlag = 1; //奇
m_cFrameSyncFlag = 0; //15 good
m_cMuxPulseCnt = 0;
}
}else{ //去掉
if(m_cMuxPulseCnt ==23){ //偶 22:23刚好不闪烁
m_cFrameSampeFlag = 1;
m_cFrameSyncFlag = 0;
m_cMuxPulseCnt = 0;
}
}
}
if(m_cFrameSampeFlag == 1){
if(m_cCCDRowNum%3==0) //%6
{
m_cRowNum++;
ATD0CTL2=0xC2; // 启动AD转换 开中断
ATD0CTL3 =0x19;//0x19; //00011001顺序转换长度为3 ,调试时保留,no fifl
ATD0CTL4 =0x80;//0x80 ATDclk = 0.08us //实测时间 2.48us/次 //总线25M
ATD0CTL5=0XA0;
ATD0DIEN=0X00;
}
m_cCCDRowNum++;
m_cSampNum =-3; //-20 good
if(m_cRowNum == CCD_ROWS-1){
m_cFrameSampeFlag = 0;
m_cFrameCompleteFlag = 1;
m_cCCDFrameShiftFlag = 0; //
//HUANG
IRQDis(); //huangqin
}
}else{
m_cCCDRowNum =-1;
m_cRowNum = -1;
PORTB=0x00; //test
}
}
#pragma CODE_SEG DEFAULT
/************************ATD0 Interrupt**********************/
#pragma CODE_SEG NON_BANKED
interrupt void ATD0_ISR (void)
{ //char ADDATA;
//ADDATA=ATD0DR0;
//SCI_PutByte('k');
m_cSampNum++;
if(m_cSampNum < CCD_COLS){
if(m_cSampNum>=0){
m_aImage[m_cRowNum][m_cSampNum] =(uchar)ATD0DR0;
}
}else{
m_cSampNum =-3;
ATD0CTL2=0X00;
//PIEJ=0x00;
}
}
#pragma CODE_SEG DEFAULT
|