AnsweredAssumed Answered

There is problem with DCM colors

Question asked by chuev.vladimir on Oct 29, 2015
Latest reply on Nov 6, 2015 by chuev.vladimir
Hello,
I have some problems with camera. At reception high and low bytes change places. It's make bad image (picture 1)
First I think that I lose a first byte and by myself shifted a buffer on 1 byte. So, I got an acceptable image. but it has low quality (picture 2, there you can see green lines).
After I reordered each high and low bytes in pixel and I got what I whant (picture 3).
But is there no way to do it by DCM or DMA?
There must be solution. I ask your halp with that.
There is my initialization code:

hdcmi->Init.CaptureRate = DCMI_CR_ALL_FRAME;
hdcmi->Init.HSPolarity = DCMI_HSPOLARITY_LOW;
hdcmi->Init.SynchroMode = DCMI_SYNCHRO_HARDWARE;
hdcmi->Init.VSPolarity = DCMI_VSPOLARITY_HIGH;
hdcmi->Init.ExtendedDataMode = DCMI_EXTEND_DATA_8B;
hdcmi->Init.PCKPolarity = DCMI_PCKPOLARITY_RISING;
hdcmi->Init.JPEGMode = DCMI_JPEG_DISABLE;
hdcmi->Instance = DCMI;
 
 
camera_Hdma.Init.Channel = DMA_CHANNEL_1;
camera_Hdma.Init.Direction = DMA_PERIPH_TO_MEMORY;
camera_Hdma.Init.PeriphInc = DMA_PINC_DISABLE;
camera_Hdma.Init.MemInc = DMA_MINC_ENABLE;
camera_Hdma.Init.PeriphDataAlignment = DMA_PDATAALIGN_WORD;
camera_Hdma.Init.MemDataAlignment = DMA_MDATAALIGN_WORD; // DMA_MDATAALIGN_WORD - DMA_MDATAALIGN_HALFWORD
camera_Hdma.Init.Mode = DMA_CIRCULAR; // DMA_CIRCULAR - DMA_NORMAL
camera_Hdma.Init.Priority = DMA_PRIORITY_HIGH;
camera_Hdma.Init.FIFOMode = DMA_FIFOMODE_DISABLE; // DMA_FIFOMODE_DISABLE - DMA_FIFOMODE_ENABLE
camera_Hdma.Init.FIFOThreshold = DMA_FIFO_THRESHOLD_FULL; // DMA_FIFO_THRESHOLD_1QUARTERFULL - DMA_FIFO_THRESHOLD_HALFFULL - DMA_FIFO_THRESHOLD_3QUARTERSFULL - DMA_FIFO_THRESHOLD_FULL
camera_Hdma.Init.MemBurst = DMA_MBURST_SINGLE;
camera_Hdma.Init.PeriphBurst = DMA_PBURST_SINGLE;
camera_Hdma.Instance = DMA2_Stream1;


1.jpg

2.jpg


3.jpg





Outcomes