My senior design group and I are trying to interface the c628 enhanced jpeg module found at[urlhttp://www.electronics123.com/s.nl/it.A/id.2421/.f with an arduino mega 2560. The camera communicates with the arduino through the serial ports ( Rx and Tx). The camera sends and recieves code in hex.
We have hooked the camera to our computer using the RS 232 cable and UART connector and with the program provided on a cd, we have taken pictures. By hooking a logic analyzer to the RX and Tx pins we have found the string of hex code that is used to initialize the camera.
Moving to the arduino we have written this code to send the same string of hex.
int rx= 19;
int tx= 18;
int inByte =0;
int i=0;
void setup(){
Serial.begin(57600);
Serial1.begin(57600);
Serial1.write(0xAA);
Serial1.write(i); //sends as 0x00
Serial1.write(0xB0);
Serial1.write(0x04);
Serial1.write(0xAA);
}
// if (Serial.available()){
// delay(2500);
// int inByte = Serial.read();
// Serial1.print(inByte, HEX);
// if (Serial1.available() > 0) {
// delay(2500);
// int inByte = Serial1.read();
// Serial.println(inByte, HEX);
//}
//}
void loop(){
//delay(2500);
//Serial1.write(0xAA);
//Serial1.write(i); //sends as 0x00
//Serial1.write(0xB0);
//Serial1.write(0x04);
//Serial1.write(0xAA);
//delay(2500);
}
This code sends the same string of hex to the camera. Looking at the logic analyzer the camera instantly sends back 0xFF which in the user manual says it means terminating transmission.
We are not sure what direction to go from here so any advice would be a great help.