Quote Originally Posted by HenrikOlsson View Post
Hi,
I guess a schematic of your setup would help, at least for me. But I guess that when you "remove" the MAX232 (provided it's located between the PIC and the camera (you DO have the RS232 version of the camera and not the TTL version, right?) the USART input on the PIC is floating, tricking the HSERIN2 statement into believing it's actually received something so the execution falls thru to the HSEROUT statement

Another thing that sticks out is you have COM declared as an array of 12 bytes and the response from the camera response to a SYNC is, as far as I can see, 6+6 bytes but you're only grabbing the first one with your HSERIN2 statement. Then it all starts over and there may be a residual byte in the USART buffer.

/Henrik.
Ok, lets start solving the puzzle.

1) The camera is RS232 type
2) USART was floating. I tied it high and no reply back now - this problem is solved (cheers for that)

secondly can you suggest on how do I get these 12 bytes if HEX8 is the highest I can use