I’m using DMA to get data out of the camera and store it into my 64k of memory using a stm32. I was able to get rgb data working after some time but i’m having a hell of a time with the jpeg.
If someone could answer these questions it would save me tons of time. I’m developing a small inexepensive robot btw, you can see it on my site zonemikel.com
1.) what do i put for restart_int and qscale for the constructor
CreateJpegHeader(char *header, int width, int height, int format, int restart_int, int qscale)
2.) after i’ve generated the jpeg header can i just append the same one to any image created by the camera with the same settings ?
3.) when i call capture image what do i need to do after that to “accept” the image, do i need to rewrite some registers so that the camera knows i’ve accepted the jpeg ?
- Lastly, call the “CAPTURE” command:
• seq.cmd = 2 // ID = 1, Offset = 0x03
4.) I’m Using areospace’s registry settings from page 2 of these forums, I changed the size to 128x96, and turned on binning like it says in the dg. is that all i need to change ?
If the image size is less than or equal to 800 x 600, binning mode with 1ADC must be
enabled by:
• R0x20:0[10] = 1 and R0x20:0[15] = 1
5.) if i’m using test mode 7 to get just a white background should my jpeg data always be the same ? (for testing)?
6.) does this work ? I seem to still get a clock on invalid data ? Wouldnt i still get a clock when it goes back into preview ? Can someone explain how we go from preview to capture and what is the purpose ? Page 2, reg 13/0x0D bit 2
Enable pixel clock during invalid data: When this bit is set, the pixel clock runs continuously
while FRAME_VALID is asserted but LINE_VALID is de-asserted. When cleared, it causes the
pixel clock to be active only when valid JPEG data are output. Disabling pixel clock during
LINE_VALID de-assertion is not support in spoof frame.
With all of these questions and the dma/i2c thrown into the mix it becomes a mess trying to figure anything out.
This is what i do, or at least i’m trying to do.
-
set all registry settings
-
enable dma triggered by pixclk (only on valid data)
-
send capture command = writeDriver(0x01, 0x03, 1, 0x02); //Calling Capture
-
wait for jpeg status to show data available = while(CAM_ReadReg(0x02) == 0) // on pg2
-
disable dma, clean up camera registers
-
extract valid jpeg image from dma memory buffer
-
send to computer, append header, show
Thanks for any help on any portion of these questions, code would be awesome !