TCM8240MD connector and example

Here’s what I found on the subject:

"MJPEG in AVIs having the MJPG fourcc, is restricted JPEG with a fixed – and omitted – Huffman table. The JPEG must be YCbCr colorspace, it must be 4:2:2, and it must use basic Huffman encoding, not arithmetic or progressive. "

This means it should be quite easy to get the cam to output right format as long as you can force the huffman table to standard and then omit it in the stream.

rgbphil:
a FIFO RAM might be of more use than a SRAM

You're absolutely right. Thanks for pointing me to this chip.

I edited my previous message about HCOUNT and VCOUNT calculations.

Here is what I added (although it still may not be correct):

buffercam:
It seems that the HCOUNT calculation is based on counting the clocks in a single row of image data at 1/2 the DSP clock frequency.

So for the Full Mega size, note that the data output is output at 1 x DSP frequency. This means you divide the number of clocks by two when calculating HCOUNT.

Smaller images are output at 1/4 the DSP clock rate, so you need to multiply the number of clocks by 2.

The result is that for every picture size, HCOUNT comes out to be approximately the default value of 713 (after you subtract the offset of 677). (I actually calculate 715.)

I also wish there were better docs. All we know are whats in the appnote together with the list of names and addresses in the datasheet.

what HCOUNT actually does appears to be a bit vague.

I have issues with my cams not delivering the entire frame and suspect this to be a small setting-error simply due to poor docs.

Best I can do is adjust so I get about half a image. Still, the image is then completely wrong colorwise. It’s like it’s YUV or something even though RGB is active.

Kreature,

Are you sure your camera is outputting at 15 fps (the maximum output rate specified in the datasheet)?

My camera tries to output at 30 fps when the frame rate is set to the max.

We have three settings for FRMSPD (specified in the Application Note):

Max frame rate

Half frame rate

Quarter frame rate

The datasheet only specified two frame rates: 15fps and 7.5fps.

Based on what I’ve measured, I think this is the relationship between the two:

Max frame rate = 30 fps, doesn’t work properly?

Half frame rate = 15 fps

Quarter frame rate = 7.5 fps

Perhaps they initially designed the camera to do 30 fps, but couldn’t get it to work in hardware, so they changed the datasheet to say 15 fps (instead of 30 fps)?

At any rate, try setting frame speed to “Half frame rate.”

-David

I have been using lowest framerate as I am focusing on still capture to start with. What settings are you guys using for the rest of the parameters? Like RGB/YUV and audo-contrast/exposure…

After a lot of attempts:

Address Data Comments

0x0B 0x00 White Line OFF

0x58 0x20 Exposure Time

0x05 0x00 Frame Rate Quarter

0x1A 0xFF

0x1B 0xB3

0x11 0x4A

0x14 0x33

0x04 0x0D RGB, 352x288, OUT ON

0x1F 0x0B

0x1E 0xC3

0x0E 0x1E

http://webs.ono.com/ma4826/pbbmp.png

Best regards,

ma4826

Thank you and congratulations.

Where did you find info on this secret register?

0x0B 0x00 White Line OFF

EDIT: I’m starting to get the feeling you captured this image with the TCM8230MD. Is that the case? EDIT: Nevermind.

Agreed, that is brilliant!

I will be testing this soon.

I’ve been writing structs for this cam and will incorporate all the details I find.

Anyone know how to define structs endian?

Thank you and congratulations.

Where did you find info on this secret register?

0x0B 0x00 White Line OFF

EDIT: I’m starting to get the feeling you captured this image with the TCM8230MD. Is that the case?

Testing the registers one for one until 0x19.

With the TCM8240MD.

With 0x0B default value:

http://webs.ono.com/ma4826/pbbmp_0x0B_default.png

OMG! That is the problem I have been having!

Basically, the pink stuff on the left side is over-exposed and with wrong colors. If you take into account me not setting the exposure that leaves the right side black on my shot and the left hidiously pink!

I think I’ll have to play around a bit to get this right but wohooo!

Finally the missing piece!

Thanks for clarifying.

How did you calculate SPCOUNT?

The AppNote says SPCOUNT = 2 x (H_COUNT + 191) for that PICSIZ. That’s different than what you used.

Also, what is Register 0x0E?

 0x02 0x00  //Set Camera Active (I assume you did this?)

 0x0B 0x00  // White Line OFF
 0x58 0x20  // Exposure Time
 0x05 0x00  // Frame Rate Quarter
 0x1A 0xFF  // HCOUNT = 0x3FF = 1023
 0x1B 0xB3  // VCOUNT = 0x21B = 539 // Assuming Register 0x1C is left at the default (0xA1)
 0x11 0x4A  // Changed b/c of PICSIZE
 0x14 0x33  // Changed b/c of PICSIZE
 0x04 0x0D  // RGB  352x288  OUT ON
 0x1F 0x0B  // SPCOUNT = 0xBC3 = 3011 // Doesn't match formula?
 0x1E 0xC3  // SPCOUNT[7:0]
 0x0E 0x1E  // According to the AppNote it should be 0xAC for this PICSIZ?

With the values of appnote I got the same results as Kreature.

I got the correct values with these automatic tests.

for (reg1f = 0; reg1f < 16; reg1f ++)
{
for (reg1e = 0; reg1e <= (255-15); reg1e = reg1e + 15)
{
for (reg0e = 0; reg0e <= (255-15); reg0e = reg0e + 15)
{

...
...
...

}
}
}

By changing these values the image moves within the “picture” and changes the color.

For example:

with 0x0E = 0x3C

http://webs.ono.com/ma4826/pbbmp_0x0E_3C.png

Best regards,

ma4826

Very helpful, thanks.

Haha. To do that rigorous testing would kill a year for me.

I have been reading my images out with a ATmega88!

It takes time and then I have to view them manually.

Writing new structs and stuff for the AVR32 now (AP7000) but I am not sure I like it as it needs external memory.

For 160x120:

0x1E 0xF9

0x0E 0x0F

0x04 0x0B RGB, 160x120, OUT ON

http://webs.ono.com/ma4826/pbbmp_160x120.png

Other register have the same value as 352x288.

Hello!

I’ve been following this thread… although I haven’t been able to get to play with my camera yet… I’m (relatively) new to electronics and think given all the experimentation and hard work I’ve seen you guys doing that I may have bitten off a bit more than I can chew with this project that I’d like to do. I’m an artist in grad school and have been working on a project I call ‘Stop Motion Day’ with a super 8 camera for the last several months. For the project I made a harness to strap the super 8 to my body and set up the camera so that it records one frame every 16 seconds (the time lapse required to exactly record a waking day of 16 hours on a single roll of film). I’ve been struggling with trying to create a wearable digital version of this… ideally small enough to wear almost every day (where the super 8 is quite cumbersome and really a performance). I have the camera, a miniSD card and a lilypad… and would love to connect them and set them up to do a similar thing digitally. I’m appealing to this forum to see if anyone would be interested in helping me build this apparatus much more quickly than I can hope to do it alone. I’d be open to collaboration on the art piece or I can pay for a finished product. Any takers? Any suggestions?

Your help would be much appreciated! :smiley:

A lillypad really isn’t appropriate for this camera, you’d need both something considerably more powerful and a fair bit of programming know-how. I’d advise getting a normal small and cheap digital camera and connecting the lillypad to its remote shutter so the lillypad tells it to take a photo every 16 seconds and it does all the photographing and storing for you - much much easier with much better results.

Thank you for the advice Random. I’ve considered this and run into two problems… one, many of the smallest cameras do not have expandable memory, so I wouldn’t know how to store all the images (roughly 3600 @ 16 seconds). I was looking at this one- http://www.target.com/Aiptek-Mini-PenCa … era&page=1.

And, then there’s the battery life, many of the cameras I looked at, since they wouldn’t effectively ‘sleep’ between shots, would go through their batteries in much less than 16 hours.

Any suggestions for how to get around these problems?