mmm, as it worked with a 4MHZ, i'll bet on a hardware problem now. something like a lack of supply filtering. Placing 0.1uF capacitor close to each sensor and close to each IC + couple of 10uF tantalum could fix it.

Did you monitor the supply line???


No problem with the LCD???

But i've never tested OWIN/OUT @40MHZ so... i can just bet on few things.