Robot Camera  With  2.8" TFT

Image Processing could also be done reading the GRAM of the Displaydriver. Or am I wrong?

const prog_char change_reg[CHANGE_REG_NUM][2]=
{
{0x3a, 0x0c},
{0x3d, 0xc0},
{0x12, 0x00},
{0x15, 0x40},
{0x17, 0x13},
{0x18, 0x01},
{0x32, 0xbf},
{0x19, 0x02},
{0x1a, 0x7a},//0x7a,
{0x03, 0x0a},//0x0a,
{0x0c, 0x00},
{0x3e, 0x00},//
{0x70, 0x3a},
{0x71, 0x35},
{0x72, 0x11},
{0x73, 0xf0},//
{0xa2, 0x02},
//{0x11, 0x81},
{0x7a, 0x20},
{0x7b, 0x03},
{0x7c, 0x0a},
{0x7d, 0x1a},
{0x7e, 0x3f},
{0x7f, 0x4e},
{0x80, 0x5b},
{0x81, 0x68},
{0x82, 0x75},
{0x83, 0x7f},
{0x84, 0x89},
{0x85, 0x9a},
{0x86, 0xa6},
{0x87, 0xbd},
{0x88, 0xd3},
{0x89, 0xe8},
{0x13, 0xe0},
{0x00, 0x00},//AGC
{0x10, 0x00},
{0x0d, 0x40},
{0x14, 0x28},//0x38, limit the max gain
{0xa5, 0x02},
{0xab, 0x02},
{0x24, 0x68},
{0x25, 0x58},
{0x26, 0xc2},
{0x9f, 0x78},
{0xa0, 0x68},
{0xa1, 0x03},//0x0b,
{0xa6, 0xd8},//0xd8,
{0xa7, 0xd8},//0xd8,
{0xa8, 0xf0},
{0xa9, 0x90},
{0xaa, 0x14},
{0x13, 0xe5},
{0x0e, 0x61},
{0x0f, 0x4b},
{0x16, 0x02},
{0x1e, 0x07},//0x07,
{0x21, 0x02},
{0x22, 0x91},
{0x29, 0x07},
{0x33, 0x0b},
{0x35, 0x0b},
{0x37, 0x1d},
{0x38, 0x71},
{0x39, 0x2a},
{0x3c, 0x78},
{0x4d, 0x40},
{0x4e, 0x20},
{0x69, 0x00},
{0x6b, 0x0a},//PLL
{0x74, 0x10},
{0x8d, 0x4f},
{0x8e, 0x00},
{0x8f, 0x00},
{0x90, 0x00},
{0x91, 0x00},
{0x92, 0x00},//0x19,//0x66
{0x96, 0x00},
{0x9a, 0x80},
{0xb0, 0x84},
{0xb1, 0x0c},
{0xb2, 0x0e},
{0xb3, 0x82},
{0xb8, 0x0a},
{0x43, 0x0a},
{0x44, 0xf2},
{0x45, 0x39},
{0x46, 0x62},
{0x47, 0x3d},
{0x48, 0x55},
{0x59, 0x83},
{0x5a, 0x0d},
{0x5b, 0xcd},
{0x5c, 0x8c},
{0x5d, 0x77},
{0x5e, 0x16},
//Lense
{0x62, 0x00},
{0x63, 0x00},
{0x64, 0x04},
{0x65, 0x20},
{0x66, 0x05},
{0x94, 0x04},
{0x95, 0x08},

{0x6c, 0x0a},
{0x6d, 0x65},
{0x6e, 0x11},
{0x6f, 0x9e},//0x9e for advance AWB
{0x6a, 0x40},
{0x01, 0x56},
{0x02, 0x44},
{0x13, 0xe7},
{0x4f, 0x88},
{0x50, 0x8B},
{0x51, 0x04},
{0x52, 0x11},
{0x53, 0x8c},
{0x54, 0x9d},
{0x55, 0x00},
{0x56, 0x40},
{0x57, 0x80},
{0x58, 0x9a},
{0x41, 0x08},
{0x3f, 0x00},
{0x75, 0x04},
{0x76, 0x60},
{0x4c, 0x00},
{0x77, 0x01},
{0x3d, 0xc2}, //0xc0,
{0x4b, 0x09},
{0xc9, 0x30},
{0x41, 0x38},
{0x56, 0x40},//0x40
{0x34, 0x11},
{0x3b, 0x12},//0x00,//0x02,
{0xa4, 0x88},//0x88,
{0x96, 0x00},
{0x97, 0x30},
{0x98, 0x20},
{0x99, 0x30},
{0x9a, 0x84},
{0x9b, 0x29},
{0x9c, 0x03},
{0x9d, 0x99},
{0x9e, 0x7f},
{0x78, 0x04},
{0x79, 0x01},
{0xc8, 0xf0},
{0x79, 0x0f},
{0xc8, 0x00},
{0x79, 0x10},
{0xc8, 0x7e},
{0x79, 0x0a},
{0xc8, 0x80},
{0x79, 0x0b},
{0xc8, 0x01},
{0x79, 0x0c},
{0xc8, 0x0f},
{0x79, 0x0d},
{0xc8, 0x20},
{0x79, 0x09},
{0xc8, 0x80},
{0x79, 0x02},
{0xc8, 0xc0},
{0x79, 0x03},
{0xc8, 0x40},
{0x79, 0x05},
{0xc8, 0x30},
{0x79, 0x26},

{0x09, 0x03},
{0x3b, 0x42},//0x82,//0xc0,//0xc2, //night mode

};

First of all, i'd like to share with you a copy of my register settings. The settings are all well commented according to the camera's datasheet. Thats the way it should be. The really important settings are to find at the top of the list ( 1 - 6 ).

const prog_char change_reg[_registerset][2]=
{
      //
      // The really important stuff.
      //
      {0x12, 0x00},//1 / COM7  : YUV mode, 0b [7] Register Reset [6] Reserved [5] CIF [4] QVGA [3] QCIF [2] RGB [1] Color Bar [0] Raw RGB - 000;YUV - 100;RGB 
      {0x8c, 0x00},//2 / RGB444: 0b [7-2] Reserved, [1] RGB444 [0] XR GB(0) , RG BX(1)
      {0x04, 0x00},//3 / COM1  : CCIR656 Format Disable
      {0x40, 0xc0},//4 / COM15 : 0b [7-6] Output Range [5-4] RGB 565,555 [3-0] Reserved
      {0x14, 0x18},//5 / COM9  : 4x gain ceiling
      {0x11, 0x3f},//6 / CLKRC : Internal Clock, [000000] to [111111] , 16000000 / ( [111111]+ 1 ) =  250000
      // 
      // Hardware Window Settings
      //
      {0x32, 0xb6},//7 / HREF  : 
      {0x17, 0x13},//8 / HSTART: HREF Column start high 8-bit
      {0x18, 0x01},//9 / HSTOP : HREF Column end high 8-bit
      {0x19, 0x02},//10/ VSTRT : VSYNC Start high 8-bit
      {0x1a, 0x7a},//11/ VSTOP : VSYNC End high 8-bit,
      {0x03, 0x0a},//12/ VREF  : Vertical Frame Control, 
      {0x0c, 0x00},//13/ COM3  : 
      {0x3e, 0x00},//14/ COM14 : Pixel Clock Devider
      //
      // Mystery Scaling Numbers 
      //
      {0x70, 0x3a},//15/ SCALING XSC : Horizontal Scale Factor
      {0x71, 0x35},//16/ SCALING YSC : Vertical Scale Factor
      {0x72, 0x11},//17/ SCALING DCW : DCW Control
      {0x73, 0xf0},//18/ SCALING PCLK: Scaling Pixel Clock Devider
      {0xa2, 0x02},//19/ SCALING PCLK: Scaling Pixel Delay
      {0x15, 0x00},//20/ COM10       : VSYNC , HREF , PCLK Settings
      //
      // Gamma Curve Values 
      //
      {0x7a, 0x20},//21/ SLOP : Gamma Curve Highest Segment Slope
      {0x7b, 0x10},//22/ GAM1 : Gamme Curve 1st Segment
      {0x7c, 0x1e},//23/ GAM2 : Gamme Curve 2st Segment
      {0x7d, 0x35},//24/ GAM3 : Gamme Curve 3st Segment
      {0x7e, 0x5a},//25/ GAM4 : Gamme Curve 4st Segment
      {0x7f, 0x69},//26/ GAM5 : Gamme Curve 5st Segment
      {0x80, 0x76},//27/ GAM6 : Gamme Curve 6st Segment
      {0x81, 0x80},//28/ GAM7 : Gamme Curve 7st Segment
      {0x82, 0x88},//29/ GAM8 : Gamme Curve 8st Segment
      {0x83, 0x8f},//30/ GAM9 : Gamme Curve 9st Segment
      {0x84, 0x96},//31/ GAM10: Gamme Curve 10st Segment
      {0x85, 0xa3},//32/ GAM11: Gamme Curve 11st Segment
      {0x86, 0xaf},//33/ GAM12: Gamme Curve 12st Segment
      {0x87, 0xc4},//34/ GAM13: Gamme Curve 13st Segment
      {0x88, 0xd7},//35/ GAM14: Gamme Curve 14st Segment
      {0x89, 0xe8},//36/ GAM15: Gamme Curve 15st Segment
      //
      // Automatic Gain Control and AEC Parameters
      //
      {0x13, 0x00},//37/ COM8 : Fast AGC/AEC Algorithm
      {0x00, 0x00},//38/ GAIN
      {0x10, 0x00},//39/ AECH
      {0x0d, 0x00},//40/ COM4 :  
      {0x14, 0x18},//41/ COM9 : Automatic Gain Ceiling : 8x
      {0xa5, 0x05},//42/ BD50MAX: 50 Hz Banding Step Limit
      {0xab, 0x07},//43/ BD60MAX: 60 Hz Banding Step Limit 
      {0x24, 0x95},//44/ AGC - Stable Operating Region Upper Limit
      {0x25, 0x33},//45/ AGC - Stable Operating Region Lower Limit
      {0x26, 0xe3},//46/ AGC - Fast Mode Operating Region
      {0x9f, 0x78},//47/ HAECC1 : Histogram based AEC Control 1
      {0xa0, 0x68},//48/ HAECC2 : Histogram based AEC Control 2
      {0xa1, 0x03},//49/ Reserved
      {0xa6, 0xd8},//50/ HAECC3 : Histogram based AEC Control 3
      {0xa7, 0xd8},//51/ HAECC4 : Histogram based AEC Control 4
      {0xa8, 0xf0},//52/ HAECC5 : Histogram based AEC Control 5
      {0xa9, 0x90},//53/ HAECC6 : Histogram based AEC Control 6
      {0xaa, 0x94},//54/ HAECC7 : AEC Algorithm Selection
      {0x13, 0xe5},//55/ COM8   : Fast AGC Algorithm, Unlimited Step Size , Banding Filter ON, AGC and AEC enable.
      //
      // Reserved Values without function specification
      //
      {0x0e, 0x61},//56/ COM5 : Reserved
      {0x0f, 0x4b},//57/ COM6 : Reserved
      {0x16, 0x02},//58/ Reserved
      {0x1e, 0x07},//59/ MVFP : Mirror/Vflip disabled ( 0x37 enabled ) 
      {0x21, 0x02},//60/ Reserved
      {0x22, 0x91},//61/ Reserved
      {0x29, 0x07},//62/ Reserved
      {0x33, 0x0b},//63/ Reserved
      {0x35, 0x0b},//64/ Reserved
      {0x37, 0x1d},//65/ Reserved
      {0x38, 0x71},//66/ Reserved
      {0x39, 0x2a},//67/ Reserved
      {0x3c, 0x78},//68/ COM12 : Reserved
      {0x4d, 0x40},//69/ Reserved
      {0x4e, 0x20},//70/ Reserved
      {0x69, 0x00},//71/ GFIX : Fix Gain for RGB Values
      {0x6b, 0x4a},//72/ DBLV : PPL Control
      {0x74, 0x10},//73/ Reserved
      {0x8d, 0x4f},//74/ Reserved
      {0x8e, 0x00},//75/ Reserved
      {0x8f, 0x00},//76/ Reserved
      {0x90, 0x00},//77/ Reserved
      {0x91, 0x00},//78/ Reserved
      {0x92, 0x00},//79/ Reserved
      {0x96, 0x00},//80/ Reserved
      {0x9a, 0x00},//81/ Reserved
      {0xb0, 0x84},//82/ Reserved
      {0xb1, 0x0c},//83/ Reserved
      {0xb2, 0x0e},//84/ Reserved
      {0xb3, 0x82},//85/ Reserved
      {0xb8, 0x0a},//86/ Reserved
      //
      // Reserved Values without function specification
      //
      {0x43, 0x0a},//87/ Reserved
      {0x44, 0xf0},//88/ Reserved
      {0x45, 0x34},//89/ Reserved
      {0x46, 0x58},//90/ Reserved
      {0x47, 0x28},//91/ Reserved
      {0x48, 0x3a},//92/ Reserved
      {0x59, 0x88},//93/ Reserved
      {0x5a, 0x88},//94/ Reserved
      {0x5b, 0x44},//95/ Reserved
      {0x5c, 0x67},//96/ Reserved
      {0x5d, 0x49},//97/ Reserved
      {0x5e, 0x0e},//98/ Reserved
      {0x64, 0x04},//99/ Reserved
      {0x65, 0x20},//100/ Reserved
      {0x66, 0x05},//101/ Reserved
      {0x94, 0x04},//102/ Reserved
      {0x95, 0x08},//103/ Reserved
      {0x6c, 0x0a},//104/ Reserved
      {0x6d, 0x55},//105/ Reserved
      {0x6e, 0x11},//106/ Reserved
      {0x6f, 0x9f},//107/ Reserved
      {0x6a, 0x40},//108/ Reserved
      {0x01, 0x40},//109/ REG BLUE : Reserved
      {0x02, 0x40},//110/ REG RED  : Reserved
      {0x13, 0xe7},//111/ COM8     : FAST AEC, AEC unlimited STEP, Band Filter, AGC , ARC , AWB enable.
      //
      // Matrix Coefficients 
      //
      {0x4f, 0x80},//112/ MTX 1 : Matrix Coefficient 1
      {0x50, 0x80},//113/ MTX 2 : Matrix Coefficient 2
      {0x51, 0x00},//114/ MTX 3 : Matrix Coefficient 3
      {0x52, 0x22},//115/ MTX 4 : Matrix Coefficient 4
      {0x53, 0x5e},//116/ MTX 5 : Matrix Coefficient 5
      {0x54, 0x80},//117/ MTX 6 : Matrix Coefficient 6
      {0x58, 0x9e},//118/ MTXS  : Matrix Coefficient Sign for Coefficient 5 to 0
      {0x41, 0x08},//119/ COM16 : AWB Gain enable
      {0x3f, 0x00},//120/ EDGE  : Edge Enhancement Adjustment
      {0x75, 0x05},//121/ Reserved
      {0x76, 0xe1},//122/ Reserved
      {0x4c, 0x00},//123/ Reserved
      {0x77, 0x01},//124/ Reserved
      {0x3d, 0xc0},//125/ COM13 
      {0x4b, 0x09},//126/ Reserved
      {0xc9, 0x60},//127/ Reserved
      {0x41, 0x38},//128/ COM16
      {0x56, 0x40},//129/ Reserved
      {0x34, 0x11},//130/ Reserved
      {0x3b, 0x12},//131/ COM11 : Exposure and Hz Auto detect enabled.
      {0xa4, 0x88},//132/ Reserved
      {0x96, 0x00},//133/ Reserved
      {0x97, 0x30},//134/ Reserved
      {0x98, 0x20},//135/ Reserved
      {0x99, 0x30},//136/ Reserved
      {0x9a, 0x84},//137/ Reserved
      {0x9b, 0x29},//138/ Reserved
      {0x9c, 0x03},//139/ Reserved
      {0x9d, 0x4c},//140/ Reserved
      {0x9e, 0x3f},//141/ Reserved
      {0x78, 0x04},//142/ Reserved
      //
      // Mutliplexing Registers
      //
      {0x79, 0x01},//143/ Reserved
      {0xc8, 0xf0},//144/ Reserved
      {0x79, 0x0f},//145/ Reserved
      {0xc8, 0x00},//146/ Reserved
      {0x79, 0x10},//147/ Reserved
      {0xc8, 0x7e},//148/ Reserved
      {0x79, 0x0a},//149/ Reserved
      {0xc8, 0x80},//150/ Reserved
      {0x79, 0x0b},//151/ Reserved
      {0xc8, 0x01},//152/ Reserved
      {0x79, 0x0c},//153/ Reserved
      {0xc8, 0x0f},//154/ Reserved
      {0x79, 0x0d},//155/ Reserved
      {0xc8, 0x20},//156/ Reserved
      {0x79, 0x09},//157/ Reserved
      {0xc8, 0x80},//158/ Reserved
      {0x79, 0x02},//159/ Reserved
      {0xc8, 0xc0},//160/ Reserved
      {0x79, 0x03},//161/ Reserved
      {0xc8, 0x40},//162/ Reserved
      {0x79, 0x05},//163/ Reserved
      {0xc8, 0x30},//164/ Reserved
      {0x79, 0x26},//165/ Reserved
      //
      // Additional Settings
      //
      {0x09, 0x00},//166/ COM2  : Output Drive Capability
      {0x55, 0x00},//167/ Brightness Control
      //
      // End Of Constant
      //
      {0xff, 0xff},//174/ End Marker
};

For more infos on that, see

http://tomoyo.sourceforge.jp/cgi-bin/lxr/source/drivers/media/video/ov7670.c

@realtime:

I use avrdude and a lpt-programmer for programming purpose. Actually it works quite well. Sometimes the checksums were not quite correct. But that's not an issue. Never had to complain about problems, you are faced to.

Concerning the incidence when you plugged the cam into the wrong header, i don't think this should be a problem. At least it should have no effect when you try to flash the microcontroller.

What do you mean by GRAM ? Thats new to me.

Unfortunately there is no FIFO Buffer for the frames, like there is one on the CmuCam3. Means, that you have to process the data lines at the same time, the data is sent. The Memory of the Atmega is too small to implement a FIFO Buffer, for example an interrupt driven. This makes image processing, if i am not mistaken, difficult. Can some confirm that ?

@all:

How many people are working on it at all ?

Another remark to the comments Alexander Kevin made at the very beginning of this thread :

Thanks for care.
You can use it with Arduino by USB interface through Mini USB or Sonsor shield shield.
You can also connect it to your computer directly by USB cable.

That's a total lie. The USB Port just supplies the 5 V Voltage. Nothing else. The data lines D+ and D- aren't even wired ! So ... no interface. And forget about your arduino. That was just talking for selling purpose.

It can do some image analyzing like blob tracking or color tracking when you use with Arduino[ch12289]Arduino sensor brick[ch12289]Robot special sensor . Smiley

Well.. i spent weeks on this issue. My conclusion : The Atmega is just not capable of doing it. Perhaps Mr.Kevin can tell us, what to do. You'll actually need a totally different concept for doing this. Some people might wonder, how the TFT works on displaying images, if the Atmega is not capable of processing it. Well the OV7670 already delivers data, which is compatible to the TFT. So the Atmega does nothing there. The microcontroller is just some kind of traffic guard, who tells every component (i.e. 3-State-Switch, some Gatters ) what to do. Biggest issue is the fact, that the clock lines ( HREF, PCLK , VREF ) are not wired to the microcontroller. Quite funny, because there where some pins left. I had to jumper wire it myself.

@rrak The OV7670 "pushes" its picture data straight to the ILI9325 that controls the LCD Display. I thought the data mus be somewhere in the GRAM registers so that you can read them back from the atmega32.

What do you think?????

Was reading through this thread. Did this project just die? Was anyone successful with this camera module?

Thanks

Not sure if anyone ever bought one. In the end I decided I was not too impressed by it so decided not to buy one.

Mowcius

I bought one, and I think the board is ok to buy. I have the atmel32 version. I had some troubles with the cam first, but this was due to some timing problems. Now it is working fine. I also got the Touchdisplay working. All in all the price is quite good: Touchdisplay, Display, Cam, mmc all on one board.
Currently I am still wondering, if one can use the Graphical Ram (GRAM) of the ILI chip to do some Computer vision. But waiting here for some opinions....

Want to do a writeup somewhere?
I'd be interested in hearing more about it from someone who's not affiliated with the company and has good english language skills :wink:

Mowcius

This is cool. ttt

Any more good info on this camera? I just purchased one and don't have the slightest idea what to do with it! :-/

The camera is still being sold on ebay http://cgi.ebay.com/AVR-Atmega32-OV7670-262K-TFT-LCD-Module-Board-/200540198562?pt=LH_DefaultDomain_0&hash=item2eb12096a2

The seller makes no wild claims about doing anything with an arduino with it and even admits the touchscreen doesn't have a controller so the one thing an arduino could realistically do can't be done. The onbaord Atmega is apparently accessible as a Atmega development tool, with an ICSP port but thats about it.

If you read the posts by rrak who from his posts does have a clue and has bought one of these and worked for weeks to get it to do something with an arduino failed and gave the same conclusion I came to from the outset. An Atmega doesn't stand a chance of doing anything with the camera output, even if some of the more useful outputs were wired which they don't appear to be.

I can't honestly think of anything useful it could be used for in its present form. A camera, graphics chip and an LCD wired together on a board with an Atmega microcontroller that appears to do very little.

Quickly realizing that.
But I guess at a minimum, an Arduino could be used with a PIR to at least turn the thing into a motion activated recorded. Then let the camera/board control everything else. With the only option of storing on the SD card.

How do you get the touch screen controls to show up on these units?

The Ebay vendor says they don't have them any more, probably because they haven't put a touch screen controller on the newer ones.

Having the arduino take a picture and store it on the SD card is probably its limit, you could probably dispense with the arduino and use the boards own Atmega if you could figure out how to program it. Time lapse photography could be an option as well as an external PIR/sensor come to think of it.

Hi pluggy,
I found that another Ebay seller still sell the new version 2.8 TFT camera kit. They have touch screen controller and a SD/TF card socket on the board, maybe we can store image into the SD card.
http://cgi.ebay.com/NEW-REV-2-8-TFT-LCD-Board-Camera-Module-Source-Code-/280558226914?pt=BI_Electrical_Equipment_Tools&hash=item415292cde2 ;D

hmmmm feeling a little ripped off on that deal since the touch screen was a major feature! AND the description shows it!

Hi,

i am new here and i have one question.
So i want to replace the cmos camera with analog camera(FBAS camera) and try to transfert the video data (with 50m's cable). To digitalize the video signal for your board, i think the video processor TVP5150 can do it.

What do you think?

Best regards