linear CCD TCD1201d readout and timing issue

Hi,

    PORTD = B10010000;
    delayMicroseconds(rs_time);
    // switch P1/P2 state
    PORTD = B10110000;
    PORTD = B10100000;

I think it's a mistake to switch the clock phases in two operations by writing B10110000 and then B10100000, rather than just writing B10100000. You are introducing a 60ns or more likely 120ns skew between the clock phases, and I can't see anything in the datasheet that allows that. Try writing B10100000 directly, and similarly when switching the other way.

The Arduino high and low output resistances are not very different, so the clocks should cross over at about 2.5V with no extra effort. However, if getting the clock phases to cross above 1.5V is a problem, then try a hardware solution. Between each Arduino clock output and the corresponding sensor clock input connect a small signal Schottky diode, anode to Arduino, cathode to clock input. Connect a resistor of about 22 ohms in parallel with the diode. This will slow down the fall of the clock edge by about 10ns.