Wa program about timer in PIC 18

Can anyone help me to answer these questions about PIC18 Microcontroller??

  1. Determine the appropriate prescaler and postscaler of Timer2 you should use to generate a square wave with 50Hz frequency and with 50% duty cycle if PR2 is set to d’124’ and TMR2 is initialized to d’0’.

  2. (20 marks) Write a program that uses Timer2 with PR2 set to d’124’ to generate a square wave with 50Hz frequency and with 50% duty cycle on pin 5 of Port B.

Thanks!

I can see that this is a homework assignment. Besides posting here, what have you done to try and solve your problem?

-Bill