Suppressing digital pin switching noise

Capacitors and ferrites and chokes seem to be the preferred methods.

Caps can smooth a spike but the calculations for size and type are beyond me but seem to be in the range .01 to .1 mF as low voltages.

Cable type and shielding can also play a very big part in keeping noise out.
Again selection will vary depending on application and voltages.

There are some very good sites out there for these types of information.