
Originally Posted by
HenrikOlsson
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.
Bookmarks