cancel
Showing results for 
Search instead for 
Did you mean: 

Strange image offset from camera to LCD

nghiaho12
Associate II
Posted on November 25, 2015 at 09:47

Hi all,

I've got an STM32F4 Discovery working with an OV7692 camera based on the sample project from ST. I've verified the image comes out fine by sending it over the UART. But every now and them the first image column does not start at column 0 on the LCD but randomly somewhere else and the remaining columns wrap around. It's as if some bytes went missing during the DMA transfer and it gets thrown off forever. I got access to HSYNC and VSYNC, but not sure if it's possible to force the DMA counter to reset to zero on those interrupts.
3 REPLIES 3
Posted on November 25, 2015 at 17:08

I'd imagine you can deinit/init the DMA at the VSYNC. There are probably some shortcuts to doing it but changing the register just accesses a shadow rather than the active one, as I recall.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
nghiaho12
Associate II
Posted on November 25, 2015 at 17:50

Ah, I vaguely thought about doing this, though it feels a tad hacky. I'll give it a shot today and see how that goes.

nghiaho12
Associate II
Posted on November 25, 2015 at 19:43

So disabling/enabling the DMA during the VSYNC interrupt appears to do the trick. I've tested it on a known camera with faulty syncing and it appears to work. Thanks Clive!