I will test the software on my development board and see if I get a sine wave of 50Hz or not. Maybe Proteus is not simulating the program at the right clock speed.

Thanks