the court may, with the consent of such person, place him on probation for a term of not more than one year without entering a judgment of conviction. At any time before the expiration of the term of probation, if the person has not violated a condition of his probation, the court may, without entering a judgment of conviction, dismiss the proceedings against the person and discharge him from probation. At the expiration of the term of probation, if the person has not violated a condition of his probation, the court shall, without entering a judgment of conviction, dismiss the proceedings against the person and discharge him from probation. If the person violates a condition of his probation, the court shall proceed in accordance with the provisions of section
3565.