Forget the LCD for now, use the same code but try a Serial communication test to your PC or use HPWM and measure the frequency.. what happen???