Could you please describe in more details what you mean by "generate a clock switch from 40MHz to 13MHz over and over"
Do you mean output clock switchs from 40MHz to 13MHz after the power on? Or the clock output remains stable, but the value switches from power-on to power-on cycles?
Do you have scope picture illustrating the problem?