It seems like it should work, but I will ask these questions:

On reset is ampm on?
When you push portb.7 the first time does it turn off?

If so, it appears you will need to press the portb.7...