The parties may, in any contract in writing whereby any debt is secured to be paid, agree that, if the interest on such debt is not punctually paid, it shall become a part of the principal and thereafter bear the same rate of interest as the principal debt.
§ 31-1-109, MCA