74hc595 uln2803
Hi,
The AT89S52's ports have a weak pull-up that holds the outputs at 5V when the pin is written with "1". (Port 0 don't even have these pull-ups) This can affect the rise/fall times of the signals due to the cable capacitance and beside that, it makes the transmission susceptible to EM noise. You can try buffering your connection, using 74HC244 or 245 or CD4050. A second solution would be using a CMOS shift register, CD4094 because it allows larger noise than TTLs, without corrupting the logic level. If all this doesn't work, you can replace the TTL/CMOS levels with RS232 levels, using MAX232.
Best Regards