Need Help for CoMedia C3088 Color Camera Module
HMRrailway
Posts: 2
I captured a small camera module from the Propeller Expo in Chicago. And like any good hobbyist, I am now challenged to get it working. The complete module was actually the CMUcam1 BoeBot version from Seattle Robotics. This has an SX28 microcontroller on one board interfaced to a OV6620 CMOS camera mounted on a CoMedia C3088 board. The full system is supposed to let the SX28 do all of the tracking and handling of the digital video signal. For my purposes I have separated the two modules so that the CoMedia Camera module can interface directly with the propeller. This will allow one cog to bring in the video signal.
I did successfully interface the CoMedia module to the propeller to capture the 4 high data bits, the Pclk (pixel clock), Hsync, and Vsync signals. Using Viewport I was able to get an "occasional" working frame and could see my hand against a backlight.
So now to the problems.
The video frame was repeated about 9 times within the one large frame even though I was collecting the right resolution for the viewport. In addition it was not stable as depending on the lighting it would either sync up or not. Upon further investigation I realized the pixel clock is running at about 9Mhz and most likely I am missing many pixel points and am running across several frames (hence the repetative picture).
In addition the signal (sync pulse) is fairly noisy (as seen on a scope) and the noise level changes significantly depending on the brightness of the picture. So even if I were close to picking up the clock signals, I think this is the part that is influencing my sync based on picture lighting.
So moving on, I have added code to use the I2C interface so that I can try to set registers to define some of the signals and slow down the clock. For this code, I have achieved about 60-70% accuracy in reading registers. If I factor in the Ack/Nack for each byte and reject command sets where I get a Nack on any byte, I move up to about 95% accuracy in my result. The interesting thing is to read a register you need to SendByte with the Device address in write mode, SendByte with the Register Address, SendByte with the Device address in Readmode, and then finally read the register contents. So with that success rate I was feeling pretty good. So I turned around and added one more SendByte after Device and Register to try and write to a register. NO success. I just cannot get it to write into a register even though all of the other write sequences work.
One additional note: In the attached manuals, the BoeBot CMUcam list register 17 (Hex 11) as setting the Frame Rate (which should reduce the pclk signal) but the Omnivision datasheet (Camera chip) lists this register as read only but does list it as the Clock divider. I did try writing to other R/W registers and still cannot get it to write.
So, I think my target question is
how to improve the noise level on the signals (capacitor placement etc.)
How to get the I2C to write to a register
Can anyone confirm that register 17 (hex 11) is truly writeable (to set clock divider/frame rate).
I have attached the pdf documentation for the Camera chip, Comedia Board, and BoeBot CMUCam board (this is reference only as I am not using this board). I also attached my I2C spin program and my full Video spin program.
One last note: The CoMedia Board has a jumper that ties the DOVDD to 5v. By removing the jumper and then adding a lead you can tie the Digital Output Vdd to 3.3 to match the signal levels with the Propeller. According to the way I read the chip spec sheet this can be either tied to the 5v or 3.3v supply. So I have done this.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
HMRrailway
Where the home of my model railroad hobby combines with my electronic/programming hobby.
Post Edited (HMRrailway) : 6/5/2010 9:11:03 PM GMT
I did successfully interface the CoMedia module to the propeller to capture the 4 high data bits, the Pclk (pixel clock), Hsync, and Vsync signals. Using Viewport I was able to get an "occasional" working frame and could see my hand against a backlight.
So now to the problems.
The video frame was repeated about 9 times within the one large frame even though I was collecting the right resolution for the viewport. In addition it was not stable as depending on the lighting it would either sync up or not. Upon further investigation I realized the pixel clock is running at about 9Mhz and most likely I am missing many pixel points and am running across several frames (hence the repetative picture).
In addition the signal (sync pulse) is fairly noisy (as seen on a scope) and the noise level changes significantly depending on the brightness of the picture. So even if I were close to picking up the clock signals, I think this is the part that is influencing my sync based on picture lighting.
So moving on, I have added code to use the I2C interface so that I can try to set registers to define some of the signals and slow down the clock. For this code, I have achieved about 60-70% accuracy in reading registers. If I factor in the Ack/Nack for each byte and reject command sets where I get a Nack on any byte, I move up to about 95% accuracy in my result. The interesting thing is to read a register you need to SendByte with the Device address in write mode, SendByte with the Register Address, SendByte with the Device address in Readmode, and then finally read the register contents. So with that success rate I was feeling pretty good. So I turned around and added one more SendByte after Device and Register to try and write to a register. NO success. I just cannot get it to write into a register even though all of the other write sequences work.
One additional note: In the attached manuals, the BoeBot CMUcam list register 17 (Hex 11) as setting the Frame Rate (which should reduce the pclk signal) but the Omnivision datasheet (Camera chip) lists this register as read only but does list it as the Clock divider. I did try writing to other R/W registers and still cannot get it to write.
So, I think my target question is
how to improve the noise level on the signals (capacitor placement etc.)
How to get the I2C to write to a register
Can anyone confirm that register 17 (hex 11) is truly writeable (to set clock divider/frame rate).
I have attached the pdf documentation for the Camera chip, Comedia Board, and BoeBot CMUCam board (this is reference only as I am not using this board). I also attached my I2C spin program and my full Video spin program.
One last note: The CoMedia Board has a jumper that ties the DOVDD to 5v. By removing the jumper and then adding a lead you can tie the Digital Output Vdd to 3.3 to match the signal levels with the Propeller. According to the way I read the chip spec sheet this can be either tied to the 5v or 3.3v supply. So I have done this.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
HMRrailway
Where the home of my model railroad hobby combines with my electronic/programming hobby.
Post Edited (HMRrailway) : 6/5/2010 9:11:03 PM GMT
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Leon Heller
Amateur radio callsign: G1HSM
Post Edited (Leon) : 6/6/2010 12:51:42 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
The variables to read and write the i2c are as follows:
rdat = data read from register
wdat = data to write to register
reg = register address
cmd = read/write command 1 is read and 2 is write (note if you do a write it automatically performs a read to verify)
non edit vars
rerr = sum of ACK bits from Read sequence (0 = success)
werr = sum of ACK bits from Write sequence (0= success)
Now I can play with the different formats and start working on some tracking programs. We are going to add this to my sons robot.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
HMRrailway
Where the home of my model railroad hobby combines with my electronic/programming hobby.