<< return to Pixycam.com

How does CMUcam5 camera interface work?

Hi there,

Excited to receive my CMUcam5, I still have a CMUcam 1 kicking around my parts box somewhere which I had fun playing with… looking forward to a much updated version!

I’m working on a similar sort of project which interfaces an LPC4300 to an imaging sensor, and I’m wondering if I could get some clues on how you have implemented the interface? My sensor is similar to most, you program it over I2C, and then clock in data (12 bits wide in my case) on the edge of PIXCLK.

NXP suggest in their application note using SGPIO to buffer the pixel data. Unfortunately on the dev board I’ve been using the necessary pins aren’t available, and so I’ve been looking at other options (this is also of value because it makes things more portable and not dependent on NXP-specific peripherals). Unfortunately anything relying on an interrupt to clock in a single pixel seems too slow, since it takes at least 12 cycles to begin the ISR. It might be possible to clock in the data using the DMA without an interrupt, but I’m not sure yet. Another option is to just poll PIXCLK and read the GPIO port into RAM, increment, and repeat until a frame is done. Normally this would be an ugly sort of approach, but with the LPC4300 you can just set the M0 processor off on this drudgery while the main processor does other things.

Hi David,
We’re using GPIO instead of SGPIO (for now). We found that the SGPIO interface is good if you just wanted to grab a frame, but if you wanted to do some preprocessing (downscaling, averaging, filtering) GPIO and the M0 is better, more flexible. The M0 and M4 both run at 204Mhz, and the pixel clock is exactly 1/5 of that, which makes grabbing pixels fairly straightforward. There is code on Github you can take a look at:
https://github.com/charmedlabs/pixy — look for main_m0.c

Thanks, that make sense. At the moment I’m sticking with the DMA since I’m using an unsynchronized external clock for the camera, but the GPIO approach definitely sounds like a good option.

You guys should check these posts out. I have given in detail how to use Pixy Camera.

“Getting Started with Pixy Camera”:http://www.theengineeringprojects.com/2015/11/getting-started-pixy-camera.html
“Install Pixy Camera Software PixyMon”:http://www.theengineeringprojects.com/2015/11/install-pixy-camera-software-pixymon.html
“Upload Latest firmware in Pixy Camera”:http://www.theengineeringprojects.com/2015/11/upload-latest-firmware-pixy-camera.html
“How to Train Pixy Camera with Computer”:http://www.theengineeringprojects.com/2015/11/train-pixy-camera.html

Hello Zain,
Thank you for the link! It looks like a very detailed description of how to get started with Pixy.

Edward