OpenEdv-开源电子网

 找回密码
 立即注册
正点原子全套STM32/Linux/FPGA开发资料,上千讲STM32视频教程免费下载...
查看: 23522|回复: 1

STM32F4XX DCMI问题

[复制链接]

9

主题

27

帖子

0

精华

初级会员

Rank: 2

积分
93
金钱
93
注册时间
2012-5-31
在线时间
4 小时
发表于 2012-5-31 15:29:51 | 显示全部楼层 |阅读模式

求DCMI的正确配置;我以下的配置问什么不对啊!数据时TVP5150传送输入的!!求高手!!

//DMA配置

 DMA_InitTypeDef DMA_InitStructure;

 RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_DMA2 , ENABLE);

 DMA_DeInit(DMA2_Stream1);

 while (DMA_GetCmdStatus(DMA2_Stream1) != DISABLE)
 {
 }

 DMA_InitStructure.DMA_Channel = DMA_Channel_1;       //选择DMA通道
 DMA_InitStructure.DMA_PeripheralBaseAddr = DCMI_BASE;          //DMA选择外设基址
 DMA_InitStructure.DMA_Memory0BaseAddr = (u32)&video_dma_buf[0];     //DMA数据传入内存的基址
 DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralToMemory;            //外设到存储器
 DMA_InitStructure.DMA_BufferSize =38400;                             //空间大小  传送最大数据空间
 DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable;    //外设递增不使能
 DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable;       //内存递增使能
 DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_Byte; //数据位  8位
 DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_Byte;   //内存数据
 DMA_InitStructure.DMA_Mode = DMA_Mode_Normal;
 DMA_InitStructure.DMA_Priority = DMA_Priority_High;
    DMA_InitStructure.DMA_FIFOMode = DMA_FIFOMode_Disable;
 DMA_InitStructure.DMA_FIFOThreshold = DMA_FIFOThreshold_Full;
 DMA_InitStructure.DMA_MemoryBurst = DMA_MemoryBurst_Single;
 DMA_InitStructure.DMA_PeripheralBurst = DMA_PeripheralBurst_Single;

 DMA_Init(DMA2_Stream1,&DMA_InitStructure);
 DMA_ITConfig(DMA2_Stream1,DMA_IT_TC,ENABLE);          //开中断
 DMA_Cmd(DMA2_Stream1, ENABLE);     

//DCMI配置

 DCMI_InitTypeDef DCMI_InitStructure;

 RCC_AHB2PeriphClockCmd(RCC_AHB2Periph_DCMI , ENABLE);

 DCMI_InitStructure.DCMI_CaptureMode = DCMI_CaptureMode_Continuous;   //利用DMA传输数据
 DCMI_InitStructure.DCMI_SynchroMode = DCMI_SynchroMode_Embedded;   //嵌入式同步数据采集同步数据流中嵌入同步码
 DCMI_InitStructure.DCMI_PCKPolarity = DCMI_PCKPolarity_Rising;    //像素时钟上升沿触发
 DCMI_InitStructure.DCMI_VSPolarity = DCMI_VSPolarity_High;
 DCMI_InitStructure.DCMI_HSPolarity = DCMI_HSPolarity_High;     //行活跃高
    DCMI_InitStructure.DCMI_CaptureRate = DCMI_CaptureRate_1of4_Frame;   //捕获所有1/4数据
 DCMI_InitStructure.DCMI_ExtendedDataMode = DCMI_ExtendedDataMode_8b;  //8位数据

 DCMI_Init(&DCMI_InitStructure);

//TVP5150寄存器配置值
   { /* 0x00  1*/                                                                      
            0x00,0x00         //视频输入源选择寄存器                                    
    },                                                                                
    { /* 0x01  2*/                                                                      
            0x01,0x15         //模拟通道控制寄存器                                        
    },                                                                                
    { /* 0x02  3*/                                                                      
            0x02,0x00         //操作模式控制寄存器                                         
    },                                                                                
    { /* 0x03  4*/                                                                      
            0x03,0x7f         //杂项控制寄存器  //0d                                           
    },          
    { /* 0x04  5*/                                                                      
            0x04,0xc0                                               
    },                                                                                
    { /* 0x06  6*/                                                                      
            0x06,0x10                                           
    },                                                                                
    { /* 0x07  7*/                                                                      
            0x07,0x40                                              
    },                                                                                
    { /* 0x08  8*/                                                                      
            0x08,0x00                                              
    },                                                                                
    { /* 0x09  9*/                                                                      
            0x09,0x80                                                   
    },                                                                                
    { /* 0x0a 10*/                                                                      
            0x0a,0x80                                               
    },                                                                                
    { /* 0x0b 11*/                                                                      
            0x0b,0x00                                                      
    },                                                                                
    { /* 0x0c 12*/                                                                      
            0x0c,0x80                                                 
    },                                                                                
    { /* 0x0d 13*/                                                                      
            0x0d,0x47                                            
    },                                                                                
    { /* 0x0e 14*/                                                                      
            0x0e,0x00                                              
    },                                                                                
    { /* 0x0f 15*/                                                                      
            0x0f,0x08  //0x08                                              
    },                                                                                
    { /* 0x11 16*/                                                                      
            0x11,0x00           
    },                                                                                
    { /* 0x12 17*/                                                                      
            0x12,0x00       
    },                                                                                
    { /* 0x13 18*/                                                                      
            0x13,0x00       
    },                                                                                
    { /* 0x14 19*/     
            0x14,0x00                                          
    },                                                                                
    { /* 0x15 20*/                                                                      
            0x15,0x01                                                      
    },                                                                                
    { /* 0x16 21*/                                                                      
            0x16,0x80                                             
    },                                                                                
    { /* 0x18 22*/                                                                      
            0x18,0x00                                          
    },                                                                                
    { /* 0x19 23*/                                                                      
            0x19,0x00                                           
    },                                                                                
    { /* 0x1a 24*/                                                                      
            0x1a,0x0c                                            
    },                                                                                
    { /* 0x1b 25*/                                                                      
            0x1b,0x14                                            
    },                                                                                
    { /* 0x1c 26*/                                                                      
            0x1c,0x00                                              
    },                                                                                
    { /* 0x1d 27*/                                                                      
            0x1d,0x00                                             
    },                                                                                
    { /* 0x1e 28*/                                                                      
            0x1e,0x00                                            
    },                                                                                
    { /* 0x28 29*/                                                                      
            0x28,0x00                                                    
    },                                                                                
    { /* 0x2e 30*/                                                                      
            0x2e,0x0f                                           
    },                                                                                
    { /* 0x2f 31*/                                                                      
            0x2f,0x01                                          
    },                                                                                
    { /* 0xbb 32*/                                                                      
            0xbb,0x00                                             
    },                                                                                
    { /* 0xc0 33*/                                                                      
            0xc0,0x00                                             
    },                                                                                
    { /* 0xc1 34*/                                                                      
            0xc1,0x00                                             
    },                                                                                
    { /* 0xc2 35*/                                                                      
            0xc2,0x04                                                     
    },                                                                                
    { /* 0xc8 36*/                                                                      
            0xc8,0x80                                           
    },                                                                                
    { /* 0xc9 37*/                                                                      
            0xc9,0x00                                                   
    },                                                                                
    { /* 0xca 38*/                                                                      
            0xca,0x00                                              
    },                                                                                
    { /* 0xcb 39*/                                                                      
            0xcb,0x4e                                            
    },                                                                                
    { /* 0xcc 40*/                                                                      
            0xcc,0x00                                           
    },                                                                                
    { /* 0xcd 41*/                                                                      
            0xcd,0x01                                                
    },                                                                                
    { /* 0xcf 42*/                                                                      
            0xcf,0x00                                           
    },                                                                                
    { /* 0xd0 43*/                                                                      
            0xd0,0x00                                                    
    },                                                                                
    { /* 0xfc 44*/                                                                      
            0xfc,0x7f                                          
    }     

电是一种神奇的东西!!
正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

530

主题

11万

帖子

34

精华

管理员

Rank: 12Rank: 12Rank: 12

积分
165309
金钱
165309
注册时间
2010-12-1
在线时间
2108 小时
发表于 2012-5-31 16:09:30 | 显示全部楼层
你总要说说你现在配置的结果吧...
病情描述都没有,华佗才知道你得什么病.可惜华佗死了....
我是开源电子网www.openedv.com站长,有关站务问题请与我联系。
正点原子STM32开发板购买店铺http://openedv.taobao.com
正点原子官方微信公众平台,点击这里关注“正点原子”
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则



关闭

原子哥极力推荐上一条 /2 下一条

正点原子公众号

QQ|手机版|OpenEdv-开源电子网 ( 粤ICP备12000418号-1 )

GMT+8, 2024-11-22 10:36

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

快速回复 返回顶部 返回列表