Interfacing a cheap phone camera module to a PIC32 - Page 1
Forum section: electronics / general

author: miguelvp
author_rank: Super Contributor
timestamp: November 16, 2014, 05:51:09 am
content: Nice as always Mike,That reminds me I have one of those wvshare camera modules like the one you showed towards the end, It came with sample code so I should dig it out.link but very slow site and awkward way to shop:http://www.wvshare.com/product/OV9655-Camera-Board.htmcheaper source and this guys actually do normal online orders:http://www.wayengineer.com/index.php?main_page=product_info&cPath=466_75_95&products_id=2313

author: ElectricGuy
author_rank: Regular Contributor
timestamp: November 16, 2014, 10:00:40 pm
content: Great.Thank you!

author: legacy
author_rank: Super Contributor
timestamp: November 16, 2014, 10:18:55 pm
content: could someone realize a product like an USB camera with a simple protocol ?

author: miguelvp
author_rank: Super Contributor
timestamp: November 16, 2014, 10:33:24 pm
content: Quote from: legacy on November 16, 2014, 10:18:55 pmMaybe, btw both links I placed have example code for STM32F2XX and STM32F4XX with DMA transfer to an LCD screen.Both projects seem to be in Keil uVision.

author: lukier
author_rank: Unknown
timestamp: November 16, 2014, 11:51:55 pm
content: Very nice video indeed.Other, probably slightly more expensive, MCUs have less hacky ways to connect old fashioned parallel camera sensors, like STM32F4 or LPC43xx series.I doubt there are many real world applications that would needs this odd combination. Maybe I'm biased because my research usually involves global shutters sensors streaming data to the GPU and even then it is tricky to get things running at the framerate (and forget deterministic latency).How much video processing can really be done on a micro? Modern Cortex-M4F are great and quite powerful for a microcontroller, but really, even with external memory I fail to see anything remotely useful, except maybe doing some very basic image processing operations.BTW Mike, where did you managed to get 70 OV9655 sensors for $70? Seems like a good deal.As a side note, the industry is moving to CSI MIPI and it would be great to hack this somehow. There are cheap iPhone 4 5MP sensors on eBay, I bought a couple, disassembled one to verify the sensor and the pinout, connectors to the flat flex are quite expensive and difficult to solder but the worst thing is getting this into the FPGA, as, contrary to DSI and iPod Nano displays, the bandwith is much higher (especially for FullHD mode), dictated by the sensor, using 4 lanes and I don't have equipment good enough to measure such signals

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: November 17, 2014, 12:07:13 am
content: Quote from: lukier on November 16, 2014, 11:51:55 pmYes - more expensive, bigger/less convenient packages, and more importantly, I know them a lot less well than the PIC32 - I had to do the PCB before I had time to prototype it (to get it in the panel waste of the round PCB).Quotewhich is why nobody makes something like this...QuoteWhereas I'm usually driving medium-density LED arrays with fast UART streamsQuoteNot much, but fortunately my output resolution is usually low enough that processing time isn't an issue.Quotehttp://www.ebay.co.uk/itm/70-pcs-1-Reel-OV9650-1-3-Mega-Pixels-Camera-module-/291199599071?pt=UK_BOI_Electrical_Components_Supplies_ET&hash=item43ccd941dfQuoteI'm not interested in hi-res, so the older sensors are a better solution.I've not looked at the MIPI camera stuff yet - fast LVDS input is trickier than output, especially when you need to get into clock phase delay adjustment etc.

author: Wilksey
author_rank: Super Contributor
timestamp: November 17, 2014, 12:24:11 am
content: Neat project Mike - as always,Can I ask, where you got the flat flex connectors from for the camera?Cheers

author: lukier
author_rank: Unknown
timestamp: November 17, 2014, 12:27:57 am
content: Quote from: mikeselectricstuff on November 17, 2014, 12:07:13 amDon't get me wrong, for your purposes it is a great hack and does the job well. I was just wondering why, for example, ST bothers to put a camera interface in a microcontroller.BTW There are some sensors that work great in hard real time environment, unfortunately, this is still very much prototype silicon and research stage and thus very expensive. It's called an event camera where every pixel is independent, has a separate shutter and a comparator and reports a binary event when intensity changes up or down. Resolution is quite bad (128 x 128), but it can generate an event every 1 us, so in theory this is extremely high speed camera, but instead of intensity it sends the derivative of ithttp://www.inilabs.com/products/dynamic-vision-sensorsPeople used this sensors in closed loop control with robots, all processed by an old ARM7, as the total bandwith is manageable.

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: November 17, 2014, 10:07:12 am
content: Quote from: Wilksey on November 17, 2014, 12:24:11 amAll the main distributors stock them - Farnell,Digikey,mouser etc.

author: Wilksey
author_rank: Super Contributor
timestamp: November 17, 2014, 12:12:34 pm
content: Thanks Mike,I don't suppose you could put the Farnell P/N could you?Cheers

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: November 17, 2014, 12:22:50 pm
content: Quote from: Wilksey on November 17, 2014, 12:12:34 pmJust look for FFC connectors with 0.5mm spacing and 24 pins

author: Wilksey
author_rank: Super Contributor
timestamp: November 17, 2014, 03:56:20 pm
content: Thanks Mike, found some!Cheers

author: kehribar
author_rank: Contributor
timestamp: December 03, 2014, 09:19:48 pm
content: Quote from: mikeselectricstuff on November 16, 2014, 01:11:21 amHi Mike!I've created a similar design with Atxmega32E5 + OV7670 based on your design ideas.https://github.com/kehribar/xmega_ov7670I can transfer 20FPS 80x60 grayscale image data over 3Mbaud UART. I'm not capturing the whole image since the RAM is limited, I'm sending them line by line.Thanks for the inspiration.Best,ihsan.

author: legacy
author_rank: Super Contributor
timestamp: December 07, 2014, 10:00:15 am
content: Quote from: kehribar on December 03, 2014, 09:19:48 pmhi,i am toying with a retina-CCD, toowhich board have you used for the ATXmega part (in the photo) ?

author: kehribar
author_rank: Contributor
timestamp: December 08, 2014, 05:04:03 pm
content: Quote from: legacy on December 07, 2014, 10:00:15 amHi,It is custom board designed by me:http://kehribar.me/hardware/breakout_xmegaE5/I also wrote a bootloader for it:https://github.com/kehribar/tealoaderAlso,What is a retina-CCD? I googled it but couldn't find a specific thing. Is it a general name for retina shaped camera sensors?ihsan.

author: legacy
author_rank: Super Contributor
timestamp: December 08, 2014, 09:40:54 pm
content: an example of "retina" is M64282FP made byMitsubishiin '90.It's an image sensor, also known as "artificial retina LSI", comes with a built-in image processing and analog image output tuning functions, and can detect and process the image simultaneously as human retinas can.so, in short, it is known as "retina"it has an analog output and ad digital I/O control, it's {128x128x8}bit

author: lukier
author_rank: Unknown
timestamp: December 08, 2014, 10:02:43 pm
content: Quote from: legacy on December 08, 2014, 09:40:54 pmCorrect me if I'm wrong, but from the datasheet it seems that the entire array is exposed and read-out at once like in every other (global shutter) camera. It doesn't have each pixel independently responding to intensity change in a parallel fashion like cones and rods in human retinas (spiking neurons).Tunable analog stages (gain, offset) are common in CMOS sensors anyway so the only extra thing it seems to have is the built-in edge detection.

author: legacy
author_rank: Super Contributor
timestamp: December 08, 2014, 10:32:36 pm
content: correct, and this is the reason why i wrote "retina-ccd"the difference is the built-in edge detection (which works in parallel)it's a toy you can buy for $5-$10 USD, the real resolution is 128x123x8i have arranged an X11 application in C with a bit of exposure algorithm to make everything automaticnow i am playing with teensy v2, with has a built-in USB with a bandwidth of 900Kbyte/secjust for fun, but i'd like to toy with the built-in edge detectionalso to implement a real Canny edge detection with hysteresis, which is a good an interesting algorithm