Initial counter and freq divider code