The defendant's attorney shall notify the court of the representation immediately after accepting it. If the defendant does not employ an attorney, the court shall appoint an attorney to represent the defendant not later than two (2) days after the original detention or three (3) days before the date of the hearing, whichever is earlier. An attorney representing the defendant shall not serve as guardian ad litem. If the court determines that the defendant is not able to understand the nature of the proceedings and cannot communicate with counsel in the conduct of the case, the court may appoint another person to serve as the defendant's guardian ad litem.
T.C.A. § 33-6-419