In all cases instituted under the provisions of this chapter, any and all amendments necessary to a trial of the case upon its merits shall be allowed. Witnesses may testify to any facts or circumstances within their knowledge which may show or tend to show that the accused has been guilty of any of the offenses or delinquencies charged against him or is incompetent, as the case may be; and, in like manner, the accused must have a similar right to introduce like evidence to show that he has not been guilty of the offenses or delinquencies charged against him or that he is not incompetent, as the case may be.
Ala. Code § 36-11-20 (1975)