CMOS camera-- HELP!!!

I can send the “Capture Frame VGA” command to the Electronic brick camera using a Gumstix, but I haven’t been able to get a response. (I proved this using an oscilloscope to probe TXD and RXD)

More info on the camera:
garden.seeedstudio.com/index.php … MOS_Camera

Here is my code:

int main()
{
int i;
int b=0;

system(“stty -F /dev/ttyS2 ispeed 115200 cs8 -cstopb -brkint -icrnl -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke -parenb”);

// open serial port connected to camera
openPort();

// initialize camera and request version info
printf(“Initialize camera for hex commands…\n”);

  byteTx(0x55);
  byteTx(0x41);
  byteTx(0x52);
  byteTx(0x54);
  byteTx(0xCA);
  byteTx(0x00);
  byteTx(0x00);
  byteTx(0x00);
  byteTx(0x00);
  byteTx(0x00);
  byteTx(0x00);

while(1)
{
  b = byteRx(buf, 1, 3);// != 3)
  printBuf(buf);
  printf("bytes read = %d\n", b);

  byteTx(0x55);
  byteTx(0x41);
  byteTx(0x52);
  byteTx(0x54);
  byteTx(0xCA);
  byteTx(0x00);
  byteTx(0x00);
  byteTx(0x00);
  byteTx(0x00);
  byteTx(0x00);
  byteTx(0x00);
  b = 0;
}

// print network information
printBuf(buf);

// close serial port connected to GSM module
closePort();
}

void byteTx(char value)
{
char* buffer;
buffer = &value;
write(fd, buffer, 1);
printf(“value sent: %x \n”, *buffer);
}

/**

  • byteRx()
  • Reads a byte from the camera over the serial interface.
  • @arg buffer a character pointer to the buffer which will
  •  store the received data.
    
  • @arg nbytes an int expressing the number of bytes to read.
  • @arg iter an int expressing the number of times to receive
  •  nbytes.
    
  • @return int - how many bytes were read
    /
    int byteRx(char
    buffer, int nbytes, int iter)
    {

int i;
int bytesRead = 0;

printf(“about to read…\n”);

for(i = 0; i < iter; i++)
{
if((bytesRead = read(fd, buffer, nbytes)) == ERROR)
{
printf(“error reading\n”);
return bytesRead;
}
buffer = buffer + nbytes;
printf(“read\n”);
}

return bytesRead;

}

/**

  • openPort()
  • Opens ttyS2 port to write to camera.
  • @return -1 if port failed to open and 0 if port successfuly opens
    */
    int openPort()
    {
    fd = open("/dev/ttyS2", O_RDWR | O_NONBLOCK);

if (!fd)
{
printf(“File failed to open \n”);
return 0;
}

printf(“File successfully opened with descriptor, fd = %d.\n”, fd);
return fd;
}

/**

  • closePort()
  • Closes serial port to the camera.
  • @return 1 if successful, -1 if failed.
    */
    int closePort()
    {
    if(!close(fd))
    {
    printf(“file successfully closed \n”);
    return 1;
    }

else
return -1;
}

You can use the client software to check the brick is ok or not.

I’ve tried using the software, but it freezes everytime I hit capture. Do I need a special driver or anything for the camera?

How do you connect the camera to your PC through Serial port?

I couldnt get the camera going on the pc either just freezes and only has ports up to 9 had to modify port setting is that ok. i think its a windows problem more then the camera problem… any ideas?