linear CCD TCD1201d readout and timing issue

Hello Everyone,

I am working with this project for a little time. I used this link as the source of for the code and the wiring: TCD1201D with arduino UNO - part 1

It is working pretty nice with Arduino Uno. I cover the CCD with a black electric tape to avoid the pixels to being saturated and insensitive for light. Then I have constant signal for every pixels around the value of 90-100. If I point a laser on the tape, the signal drops even lower and as I scan across the CCD it shows the "bump" caused by the light spot. I have also written a small software for it in Visual Studio to catch the data and visualize the values of each pixels.

But!

As you know the Uno can only deal with the half of the pixels because of lack of the ram. Has anyone tried to run it with a Mega and change a part of the code like this?

for (int i=0; i<1024;i++){
    sdacCounter++;
    read1Low();
    sdacCounter++;
    read1High();
  }

I would like to try to scan an image through a lens by moving the CCD across the image plane of the lens.