Hi Guys,
I am trying to Interface Sony Block Camera with Arduino Mega. But somehow not able to send VISCA commands to Camera module. Any help would be appriciated!!
Here is the details.
- Camera: SONY FCB-EH4300 (Uses VISCA Protocol)
- Arduino: Mega
- Logic Level Converter: http://www.sparkfun.com/products/8745
Connections:
Mega Serial1 RX - RXI of Level Converter at 5V side
Mega Serial1 TX - TXO of Level Converter at 5V Side
TXI of Level Converter at 3.3V side - SONY Camera's RX
RXO of Level Converter at 3.3V side - SONY Camera's TX
This camera also have standard RS232 interface for connecting it to PC. I have simultaneously connected camera to PC as well. My problem is when i send command to Camera using Mega camera does not respond to it. However, when i send command using PC camera responds and I can see the response on the Serial Monitor of IDE.
Here is the code..
byte cam_pow_inq[] ={0x81, 0x01, 0x04, 0x07, 0x03, 0xFF, 0x0D};
void setup()
{
Serial.begin(9600);
Serial1.begin(9600);
Serial.println("\r\n======Start======");
//Serial1.write(cam_pow_inq, sizeof(cam_pow_inq));
//for(int i = 0; i < 7; i++)
//{
// Serial1.print(cam_pow_inq[i]);
// Serial.print(cam_pow_inq[i], HEX);
// Serial.print(" ");
//}
//Serial.println();
Serial1.print(0x81, BYTE);
Serial1.print(0x01, BYTE);
Serial1.print(0x04, BYTE);
Serial1.print(0x07, BYTE);
Serial1.print(0x02, BYTE);
Serial1.print(0xFF, BYTE);
Serial1.print(0x0D, BYTE);
}
void loop()
{
if(Serial1.available()){
char c = Serial1.read();
Serial.print(c, HEX);
Serial.print(" ");
}
}
When i send command using PC I get following response
======Start======
FFFFFF90 41 FFFFFFFF FFFFFF90 51 FFFFFFFF FFFFFF90 41 FFFFFFFF FFFFFF90 51 FFFFFFFF
this is response of zoom wide and zoom stop command which looks right according to VISCA specification. So, my connections looks ok (i guess!) but not able to send that data to camera.
What am I missing? I spend day and night on this but could not figure out. :0
Please help!
Parin