I have a project where I am reading from a LinkSprite Serial TTL Camera and saving the image to an SD card. I got this working on the UNO with an Ethernet shield. I want to move it to the MEGA 2560 to give me more room to program.

The problem is this: Every time I connect the camera to the MEGA I seem unable to receive any serial data from it. This small bit of sample code below will just hang forever (in the loop after "Waiting for camera init end") on the MEGA, but will work fine on my UNO.

I have tried several things including using SoftwareSerial on pins 50 and 51, and also using Mega's Serial2 on pins 16 and 17. It just seems to be unable to receive from the camera on the MEGA. Any explanations as to what the problem might be? Every time I switch back to the UNO it is fine...

Infrared Camera Test Code for MEGA. This is meant to be a functional test of your camera and SD card only... To be used to verify yourcircuit and board before you use oap_motioncamera_mega (which is the full Ethernet Shield, Motion Detector, and camera)As such, you don't really need any of the motion detector connections outlined below

Notes: Not all pins on the Mega and Mega 2560 support change interrupts, so only the following can be used for RX: 10, 11, 12, 13, 50, 51, 52, 53, 62, 63, 64, 65, 66, 67, 68, 69

The UNO and the Mega have different bootloaders with different timings (I think to remember that Mega waits longer till it activates the saved sketch). You don't send anything to the camera, you just wait for a string to be submitted over the serial. What if the string is submitted to the Mega while it's still waiting for a new sketch to arrive? In this case all the serial data gets lost and is never seen by the Mega.

1) Use hardware Serial (Ended up using Serial2 on 16/17)2) Ensure the camera serial code is AFTER the setting up the SD card step. For some reason it never works if the code is before that3) A bit of playing around with the responses and it is working now.

I think Pylon was right - the camera's initial "power on response" was coming before the mega was awake.

I did not end up having to control the camera with a digital pin. Lucky for me because the camera wants 100mA.