analogWrite inside an interrupt

Please post all your code. The error is probably in the bits of code you missed posting.