digitalWite problem

What's attached to those pins? If there are really relays attached, they may be drawing too much current.