SparkFun Forums 

Where electronics enthusiasts find answers.

Have a good idea for a new product for SFE or Olimex? Let us know!
By victor_passe
#145798
I have a problem that some of you have had, I get no ack for reading other adresses than 0x1f.
I get an ack for the slave addr, and if i send the wrong slave addr i get a nack.
But the second ack only comes if i read addr 0x1f. but the third ack never comes.
I can write to addr 0x1f, but no other addr.

What can the problem be?
EXTCLK is 10MHz
I2C clk is 5kHz.
2.8V and 1.5V is fine, I am interfacing with a pic32 at 2.8V
any ideas?
By hacromatic
#146102
Hi everyone,
I've gotten images from the 8230 successfully so I thought I'd document the approach I took. My goal was to try and use as few components as possible, and do things in software where I could. I used an XMega (ATXMEGA16D4) as the main chip, and a 4MBit SRAM (AS6C4008) for the framebuffer. 19 of the 34 GPIOs on the xmega are dedicated to the address lines. The camera, xmega, and sram are all connected to an 8 bit parallel bus.

Because I wanted to do things in software where possible, the main issue initially was avoiding bus contention, since the camera has the unusual property (at least to me) of being low impedance (LoZ) on start-up. This meant that the first thing to do after pin setup was to set up I2C to tell the camera to go HiZ. After setup, the xmega waits for a shoot event. More on that in a sec...

The xmega acts as the TWI bus master when talking to the camera, but to be useful to other devices, it needs to act as the slave. I also wanted to be able to hook up multiple cameras to one TWI bus, but all the camera chips use the same id, so this was a way around that also. So the xmega is configured as a TWI slave during idle (which is most of the time). It's only a master when talking to the camera.

So now back to the shoot event. A shoot event occurs when either the shoot switch is pressed, or a TWI message is received from the host microcontroller (an Arduino, Raspberry Pi, BeagleBone whatever). Once it gets the message, it switches to an I2C master and starts communicating with the camera. I'll try and use I2C when talking about the communication between camera and xmega, and TWI when talking about communication between xmega and host (also, the I2C uses Peter Fleury's software implementation, and TWI uses AVR hardware).

When a shoot event occurs, the xmega does some set up, and then puts itself to sleep waiting for an interrupt. The typical way to handle the 3 signals coming from the camera (VD, HD, DCLK) on fast hardware is to handle each DCLK as a separate interrupt. However, low speed micros like the AVRs can't do this obviously. I even had trouble doing the thing Justin Shumaker described, which is to handle HD only, and time it properly.

Instead, I ended up basically getting one interrupt for the whole image, triggered by VD, and very carefully timing the the entire assembly routine so that the inner loop is basically just incrementing an address. It turns out you can do this in 8 clock cycles per DCLK, which is great because that allows the camera to be driven at 16Mhz, which is well above the minimum in the data sheet. So the fire hose of data being spewed out of the 8230 is timed exactly with the software address increment so that the sram fills up until the camera is finished.

It's actually possible to do all of this with regular AVRs, assuming they have enough data pins. I had this going with an 8535 early on, but since that AVR was running at 16Mhz the motion blur from the pictures was pretty bad (and I was driving the camera below the minimum clock speed anyway). It worked fine though for static images.

One thing I did notice that drove me nuts was that at 160x120 and 320x240 there's this weird blue line bug at the bottom, but I've seen that in other people's images also that use completely different approaches, so I figured it was likely that was just some weird camera bug. It's just a single scan line, and doesn't happen at 640x480. Does anyone else have any info on that? You can actually set a register to clear it up (0x22 0x28 I think) but then it adversely affects the image in other ways.

If you want to look at the design files or the source code or the PC viewing software, all of that is available for free at hacromatic.com. Disclaimer: it's a commercial product, but if you just want the data files for everything they're at the bottom of the page.

If anyone knows more about that blue line bug I'd love to hear from you!
By Alex7
#146763
Hi all. Can anybody advise this camera for a DiY project? I am looking for a video capture system for my small DIY video surveillance system. It seems like TCM8240MD suits the best. But after reading this huge thread I'm not so sure any more.. Working with this camera looks tricky. And it requires a high speed interface for data capture and a lot of memory for frame buffer which is quite expensive. USART cameras are at least 3 times more expencive and don't solve memory problem as well. Surfing web I run into other solution http://chip-solutions.org/en/portfolio/dozor Have anybody tried it? This device seems to be the best choice for me, but there is no price nor information about how can i buy it :( Does anybody know something about this Dozor device?
By doddy1985
#146953
@victor..

nice, ya was gonna mention to check out the ext_clock. I had a problem with my duty cycle before, so clock wasn't werking.
By WickedMinds
#147751
Who wants a socket for the TCM8230 camera? We just got some in stock for a product we are working on that uses this camera and had to order more than we needed. It’s far easier to solder and is oven/frying pan safe.

ImageImageImage
By WickedMinds
#149368
Just finished assembling the first vision wing for Papilio using TCM8230. Doesn't that socket look great! Was sooooo nice being able to frying pan the thing instead of hand soldering the camera.

Image
Image
By rahmi
#152360
Hello everyone
I try on the TCM8240 and i got an image but it is very pink. I work at 120x160 resolution and my registers are:
Code: Select all
	iic_write2(0x3D,0x02,0x00);
		iic_write2(0x3D,0x02,0x40);
		iic_write2(0x3D,0x02,0x00);
		iic_write2(0x3D,0x0B,0x00);
		iic_write2(0x3D,0x6D,0xA1);
		datar = iic_read(0x3D,0x6D);
		iic_write2(0x3D,0xA9,0x80);
		iic_write2(0x3D,0x58,0xD0);
		iic_write2(0x3D,0x05,0x00);
		iic_write2(0x3D,0x1A,0xFF);
		iic_write2(0x3D,0x1B,0xB3);
		iic_write2(0x3D,0x11,0x4A);
		iic_write2(0x3D,0x14,0x33);
		iic_write2(0x3D,0x1F,0x0B);
		iic_write2(0x3D,0x1E,0xF9);
		iic_write2(0x3D,0x0E,0x0F);
		iic_write2(0x3D,0x2D,0x1E);
		iic_write2(0x3D,0x04,0x0B);	
what is the problem this is not my image but similar with that
Image
with testing images are pinky too.
By Maxwellfire
#155408
Alex7 wrote:Hi all. Can anybody advise this camera for a DiY project? I am looking for a video capture system for my small DIY video surveillance system. It seems like TCM8240MD suits the best. But after reading this huge thread I'm not so sure any more.. Working with this camera looks tricky. And it requires a high speed interface for data capture and a lot of memory for frame buffer which is quite expensive. USART cameras are at least 3 times more expencive and don't solve memory problem as well. Surfing web I run into other solution http://chip-solutions.org/en/portfolio/dozor Have anybody tried it? This device seems to be the best choice for me, but there is no price nor information about how can i buy it :( Does anybody know something about this Dozor device?
Here is some more information about that camera.
By andrsefmg
#155948
victor_passe wrote:I have a problem that some of you have had, I get no ack for reading other adresses than 0x1f.
I get an ack for the slave addr, and if i send the wrong slave addr i get a nack.
But the second ack only comes if i read addr 0x1f. but the third ack never comes.
I can write to addr 0x1f, but no other addr.

What can the problem be?
EXTCLK is 10MHz
I2C clk is 5kHz.
2.8V and 1.5V is fine, I am interfacing with a pic32 at 2.8V
any ideas?

I am using a pic32 like you, how you implements the interface? i am waiting for the camera arrive, tried to login in "svenska elektronikforumet" page, but i can`t
By prean
#158009
hey guys

does anyone have a sample code or example for the TCM8240MD that they can share? trying to connect this camera to an avr (AtMega1284p)
  • 1
  • 27
  • 28
  • 29
  • 30
  • 31
long long title how many chars? lets see 123 ok more? yes 60

We have created lots of YouTube videos just so you can achieve [...]

Another post test yes yes yes or no, maybe ni? :-/

The best flat phpBB theme around. Period. Fine craftmanship and [...]

Do you need a super MOD? Well here it is. chew on this

All you need is right here. Content tag, SEO, listing, Pizza and spaghetti [...]

Lasagna on me this time ok? I got plenty of cash

this should be fantastic. but what about links,images, bbcodes etc etc? [...]