TCM8240MD connector and example

Let me repeat myself here as it does not look like people have grasped the major issues with this sensor…

  • No readout buffer

This means you can NOT halt the flow of data or the image would have been corrupted, thus there is no such function.

In RGB mode, the camera simply sends the data according to the master clock at some fractional rate determined by zoom setting and possibly some undocumented register.

In JPEG mode, the camera sends data at high rate, but intermittant. It does so “on-the-fly” as image data is dumped from the sensors, encoded and sent without being stored in advance.

  • Poorly documented registers

All operations is done via I2C by writing or reading to any specified register in the camera. Theese control everything in camera including data output on/off but there is no way to pause the transmission if your controller can’t keep up with the data flow.

I have not yet been able to get my cameras into fully auto mode on brightness, contrast, balance etc so images look awfull.

  • Data-rate

At minimum clock input of 6 MHz, the internal PLL seems to generate around 8 MHz. To use Jpeg the internal PLL MUST be active. This means data will be sent out at 8 mbyte/second on the 8 bit paralell bus. There will be convenient or inconvenient pauses in the data flow (depending on your view) intermittantly as the camera encodes the data on the fly.

To handle the datastream you’d need to be able to receive the data, store it and increment the address inside your MCU before the next byte comes. You have to do this while keeping an eye on the VBLK and HBLK signals so as to know when there therre is an actual image and when there is data. Also, to read valid data, it has to be done synched to the DCLK signals clock flanks.

This really isn’t a simple sensor to handle, and anyone thinking so will have a rough time. Either dedicated hardware, a very smart approach or a fast MCU is needed to get the job done.

Hope this is clear for everyone.

hey KreAture and Twingy – you guys are great. thanks for sharing your findings with this forum.

I’m looking to use the TCM8230MD camera with a microcontroller and understand the difficulty with setting this up; there is just way too much data for an 8-bit 40MHz microcontroller to keep up! I have an idea to maybe get around this a bit for my use, so I am curious to hear if anyone has done something like it…

I’m using the camera as a positioning sensor, not trying to capture a full image. I really only care about a small number of pixels on each frame (i.e., less than 50), so the actual data throughput is not too bad as long as I can pick it out. Which brings me to my question: how slow can EXTCLK be clocked (slower than 11.9MHz as described in the pdf?)? Can I speed through 100 pixels, slow down for a couple, then speed back up again? If so, I could have the microcontroller run through the data I don’t care about and then just grab the pixels that are important to me.

thanks!

The extclk drives a reference for the internal clock that is generated from a pll in jpeg mode on the TCM8240MD. On the 30, I don’t think there is any pll so it could work.

The downside is that the cameras exposure system is reliant upon clock rates. Also, readout system is such that diff clock on diff pixels will result in different exposures.

thanks, I’ll give it a shot. My parts should arrive in a couple days.

In the worst case, I think I could just drive EXTCLK at 12MHz and use the lowest resolution (subQCIF at 128x96) and try to keep up with the microcontroller (hoping that DCLK is divided down a bit, although I can’t find much in the pdf about how DCLK is derived from EXTCLK in the various modes).

I want to keep my system super small, so I don’t really have room (or the patience) for a nice FIFO buffer and an ARM9 (that would be sweeeet). Ideally, it’s just a camera, a little Atmega AVR, and a few discretes to glue it all together.

What do you have to do to get the camera to begin outputting data?

I have a TCM8240MD hooked up to an SX microcontroller. I2C communication is working fine, I can read and write to the camera successfully. DCLK is outputting the same clock signal as I am inputting, but the data pins appear to be outputting nothing.

Is there some I2C command I need to send to get it outputting images? I was under the impression that it would begin sending images on its own after the clock signal started up.

Yes.

There is a register bit that enables/disables output.

KreAture:
Yes.

There is a register bit that enables/disables output.

Great… which register does this? The datash**t isn’t very helpful on defining its registers.

Just joined this forum to let people know that the pads on the bottom of the module are connected the outside pads and that there is a connector for it made by Alps, looks like you can only get it in 2000+ quantities from them so its down to you, people at Sparkfun…

It would be great if Sparkfun/Olimex would make a breakout for it using said connector. If your camera goes (insert relevent noise here) just put in a new one…

Relevent link:

[Connector for CMOS Camera Module SCKA Series](http://www3.alps.com/WebObjects/catalog.woa/E/HTML/Connector/CMOSCamera/SCKA/SCKA_list.html)

I don’t think the Alps connector would work for this camera since the dimensions don’t match:

The camera is 10x10mm and the socket is 6mmx6mm.

The 8230 is 6mm x 6mm though…

I’ve also got an 8230, currently on a PCB that just brings all the pins to a 0.1" header. I’m planning on trying to get some kind of image out of it to an STM32 running at 72MHz - all I need to do is some basic computer vision so 128x96 images will be sufficient but it’s got plenty of other things to be getting on with at the same time.

Has anyone tried changing the framerate from 30fps to 15fps and seeing what that does?

Sorry guys, saw a 3 instead of a 4 in the topic, would work great for the TCM8230MD though as you said. Kinda thought it was a bit too good to be useful…

Here is the breakout board I made for the TCM8240MD to a .1" header.

I’m using it to connect the camera to a Spartan-3E starter kit (FPGA development board).

I haven’t tested it yet.

[ Breakout Board for TCM8240MD (Pictures)

-David](http://picasaweb.google.com/buffercam/BreakoutBoardForTCM8240MD?authkey=lO43O-SeaKM#5244898760968587890)

I’m starting to question my design…

What do the pads on the underside of the module connect to?

I assume it would be bad if I connected a lot of them to 2.8V.

As you can see in my [schematic, I routed the supply voltage under the camera along the right and bottom sides, without giving much clearance.

I used KreAture’s Eagle component for the camera and kept the traces outside the keepout area, but didn’t give myself much room for error for positioning the component during soldering.

Is there a way to check if I’m connecting to any of those pads underneath?

-David](http://picasaweb.google.com/buffercam/BreakoutBoardForTCM8240MD?authkey=lO43O-SeaKM#5245152084387715634)

The pads on the underside connect to some of the pads on the sides.

I did a overview of them a while back:

under   side    function
        1       gnd
19      2       DCLK
        3       gnd
13      4       EXTCLK
        5       gnd

5       6       2.8v
4       7       DOUT0
3       8       DOUT1
2       9       DOUT2
1       10      DOUT3

24      11      DOUT4
23      12      DOUT5
22      13      DOUT6
21      14      DOUT7
20      15      gnd

16      16      VBLK
15      17      HBLK
        18      gnd
8       19      SCL
10      20      SDA

Don’t take the numbering 100% serious but I think I got it right.

Since there is fewer pinns on the underside than on the sides, something was missing and it turned out to be ground connections.

KreAture,

I tried a quick connectivity test earlier today on an unmounted camera, but I didn’t find any connections.

I pressed one wire from the DMM across five of the pads on the underside of the camera and raked the other wire across all of the edge pads, but didn’t find any connections. (I repeated this for the remaining three sets of pads, no luck.)

How did you determine the connections?

-David

I used an fine-tipped dvm, and very maticulously checked each pad on the underside against all pads along the perimiter.

Then I mapped the functions to the pinns on the perimiter and saw that only ground pinns were being omitted on the bottom pads.

I’m still having issues getting my cams to output correct image data.

The appnote sais to change a few values based on PICSIZ but I am not getting the results I was expecting.

BTW:

I’ve found a way to export the raw data from the cam in RGB mode as a BMP now, so it can be displayed on any image editor/viewer.

Anyone else having similar issues with garbled images?

Here’s a sample of CB mode 4 in 640x480:

http://kreature.org/ee/avr/cmos_cam/640x480_cb4.bmp

It looks like it is supposed to I think.

The BMP file uses a BMP file header setting the format to Bitfield mode in RGB565 format so that the raw camera data can then be appended on the fly. No reprocessing.

Here’s the image with same settings, CB mode turned off:

http://kreature.org/ee/avr/cmos_cam/640x480.bmp

Very annoying. I am sure there is just some settings to select the right output area of the sensor and maby some color/brightness stuff but following the appnote and datasheet doesn’t appear to be enough.

Sorry I haven’t posted in a while I’ve been busy with my projects at work. Just to quickly summarize, I’ve been building little double sided PCB’s using our LPKF S62 PCB mill for my little robots at work. They are fairly easy to solder/build, only 2 regulators and the camera, plus some through holes. I use a 20 pin JST connector to interface the camera board to my AT91SAM7 32-bit microprocessor. Using my custom assembly routine I can capture image data at 10.4 fps without the use of the DCLK interrupt signal. Keep in mind this is for the TCM8230MD, but I recently picked up some TCM8240MD cameras and I plan to use those on the next robot for the higher resolution. I am working on documenting everything for a technical note at work and I will try to post a link to the document once it is okayed for public release.

I am currently working with the AT91SAM9260 ARM9 now. The ARM9 has an ISI or hardware integrated I2C + 8-bit CMOS interface peripheral. So it’s like having dedicated DMA hardware for these cameras. I’m ultimately going to be using the AT91SAM9G20 for my next project, but it’s pin for pin compatible with the AT91SAM9260.

My recommendation to those wanting to interface this camera to a microprocessor is to get an ARM7 or ARM9 32-bit microprocessor. This should provide the path of least resistance. It may be another month or two before I post again, but feel free to use the forums instant message feature and I’ll try to reply in a timely manner.

I have been using an ATmega64 but it does not have the horsepower to do anything usefull except test my control-libraries and retrieve RGB data to verify.

I am just wondering what bits you are setting to get the cam to behave since mine does not. (ref my crappy images when not in color-bar test mode.)

Oh, and I am almost done moving the libraries to avr32 :slight_smile:

That will give me lots of grunt and about the same HW when it comes to dma.