Over a million developers have joined DZone.

Adding the CAM8000-D Camera Module to the RIoT Board

· Java Zone

Bitbucket is for the code that takes us to Mars, decodes the human genome, or drives your next car. What will your code do? Get started with Bitbucket today, it's free.

One reason for me to buy the RIoT board was that it has a camera connector. So I had ordered the CAM8000-D module from Farnell (part number 2362812). The Farnell product page was not clear if it comes with the 30pin FPC cable, but luckily, it shipped with it:

Unpacked CAM8000-U Camera and Board

Unpacked CAM8000-U Camera and Board

CAM8000-U

It is a CMOS 2-Megapixel (1600×1200) camera mounted on an adapter board which has the 30pin FPC connector for the cable. Embest has a Quickstart Guide for the CAM8000-D Module on their dropbox site, but unfortunately it does not have much information in it.

So I connected the camera to the board, and with the new Android firmware SVN2591 (see “Flashing a new Android Image to the RIoT Board“) I have a Camera application icon:

Apps with Camera

Apps with Camera

But when I wanted to use it, there was no image (just black). So I tried to switch to the other camera (switching front/back camera):

Switching Front Back Camera

Switching Front Back Camera

But this did not help: it even looked like it was blocking the Android :-(.

After rebooting Android, it was even worse: if I want to access the camera, there is an error telling me “Can’t connect to the camera”. All what I can do is clicking OK and then the camera window closes :-(.

Can't connect to the camera

Can’t connect to the camera

So what now? There must be something wrong with the camera at the physical layer maybe? And indeed, that 30pin FPC cable has conductive connectors only on one side of the cable:

FPC Cable

FPC Cable

With a multimeter I checked the traces from board to board. And then I realized: the camera board has been shipped with the wrong side of the cable connected to the board :-(

CAM8000-D Camera Board with cable connected the wrong way

CAM8000-D Camera Board with cable connected the wrong way

Correct would be with the with the conductive leads down to the board:

CAM8000-D Camera Board with correct cable orientation

CAM8000-D Camera Board with correct cable orientation

So I fixed that, and have the boards connected with the correct side up (the one with the blue ribbon):

CAM8000-D Camera Board correctly connected to the RIoT Board

CAM8000-D Camera Board correctly connected to the RIoT Board

The boot log (see “Terminal Connection to the RIoT Board“) shows that the camera is detected:

Linux video capture interface: v2.00
----ov2656_probe
----v4l2_int_device_register success

----Setting mclk to 24 MHz
----pidh= 0x26, pidl= 0x56

But using it from the application reports:

----Setting mclk to 24 MHz
----pidh= 0x26, pidl= 0x56
----Setting mclk to 24 MHz
----pidh= 0x26, pidl= 0x56
ERROR: v4l2 capture: slave not found!

I got an Embest contact, and it was suggested to reflash the firmware again. And indeed after that the camera is working!!!!

First Picture taken

The camera is working!

:-)

What was wrong?

So after some more testing, it was clear what is happening: When I had the camera connected with the wrong cable orientation, I switched the front/back camera. As soon as this happens to a non-existing camera, it reports an error and quits. Unfortunately, it stores that wrong camera setting somewhere in the system, and I only can revert that with re-flashing the Android on the board. The good things is that I have done that now so many times that I can do this blindfolded ;-).

Summary

The CAM8000-D camera is a nice 2 mega-pixel camera for the RIoT board. The firmware shipped on the board does not support it out of the box, so a new firmware needs to be flashed first (SVN2591 or higher). But before using it, the cable orientation has to be carefully checked. And once connected, do not switch to another (front/back) camera if you do not have a second camera attached. If that happens, then the Android firmware SVN2591 gets screwed up, and you cannot switch back: only reflashing the firmware seems to help.

So now I have ordered the USB camera CAM8100-U (Farnell part number 2136552) to have both a front and back camera :-).

Happy Picturing :-)

Bitbucket is the Git solution for professional teams who code with a purpose, not just as a hobby. Get started today, it's free.

Topics:

Published at DZone with permission of Erich Styger, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}