2020-01-27 12:11 PM
Hi,
I have DCMI working with external sync, but what I get in memory is the video data with the sync codes (0xFF 00 00 YY). So in this case I needed to implement a code to extract this sync codes to get only the active video, but it waste processor resources..
How can I get only active vide data? I tried to work with embedded sync, but it didn't work.
According to AN5020 page 41 the embedded mode shows the frame structure that I receive in external sync mode...
Thanks
2020-01-27 01:18 PM
> I tried to work with embedded sync,
How exactly did you set the registers? If you use some "library", read out the registers' content and check against the RM.
> but it didn't work.
What were exactly the symptoms?
JW
2020-01-28 02:57 AM
Hi @Community member
Thanks for reply.
Below you can find my DCMI init for embedded sync mode:
hdcmi.Instance = DCMI;
hdcmi.Init.SynchroMode = DCMI_SYNCHRO_EMBEDDED;
hdcmi.Init.PCKPolarity = DCMI_PCKPOLARITY_RISING;
hdcmi.Init.VSPolarity = DCMI_VSPOLARITY_HIGH;
hdcmi.Init.HSPolarity = DCMI_HSPOLARITY_HIGH;
hdcmi.Init.CaptureRate = DCMI_CR_ALL_FRAME;
hdcmi.Init.ExtendedDataMode = DCMI_EXTEND_DATA_8B;
hdcmi.Init.JPEGMode = DCMI_JPEG_DISABLE;
hdcmi.Init.ByteSelectMode = DCMI_BSM_ALL;
hdcmi.Init.ByteSelectStart = DCMI_OEBS_ODD;
hdcmi.Init.LineSelectMode = DCMI_LSM_ALL;
hdcmi.Init.LineSelectStart = DCMI_OELS_ODD;
hdcmi.Init.SyncroCode.FrameEndCode = 0xB6;
hdcmi.Init.SyncroCode.FrameStartCode = 0xAB;
hdcmi.Init.SyncroCode.LineStartCode = 0x80;
hdcmi.Init.SyncroCode.LineEndCode = 0x9D;
The sync codes (linestart, lineend...) is according to ITU656 pattern, I'm using ADV7182.
The symptoms is:
1- I can't sync the data on the display, I can see that is image data valid, but it is not synchronized...
2- I'm using FrameEvent interrupt, and in embedded sync mode I have interrupt each 5 seconds, so it is very strange..
Here is my DMA init too:
/* DCMI Init */
hdma_dcmi.Instance = DMA2_Stream1;
hdma_dcmi.Init.Channel = DMA_CHANNEL_1;
hdma_dcmi.Init.Direction = DMA_PERIPH_TO_MEMORY;
hdma_dcmi.Init.PeriphInc = DMA_PINC_DISABLE;
hdma_dcmi.Init.MemInc = DMA_MINC_ENABLE;
hdma_dcmi.Init.PeriphDataAlignment = DMA_PDATAALIGN_WORD;
hdma_dcmi.Init.MemDataAlignment = DMA_MDATAALIGN_WORD;
hdma_dcmi.Init.Mode = DMA_CIRCULAR;
hdma_dcmi.Init.Priority = DMA_PRIORITY_VERY_HIGH;
hdma_dcmi.Init.FIFOMode = DMA_FIFOMODE_ENABLE;
hdma_dcmi.Init.FIFOThreshold = DMA_FIFO_THRESHOLD_FULL;
hdma_dcmi.Init.MemBurst = DMA_MBURST_INC4;
hdma_dcmi.Init.PeriphBurst = DMA_PBURST_SINGLE;
Regards,
Anderson
2020-01-28 04:05 AM
I mean, read out the registers' content from DCMI.
JW
2020-01-28 04:29 AM
Hi,
Yes, I've checked, but I couldn't sync with my code adapt from the external sync mode.
I tried to use LineEvent interrupt too..
Thanks,
Anderson