AtMega328 basics

Just a warning...that "diode protection" is really meant only for ESD -- short-duration events. It is not going to protect the chip from long-lasting steady overvoltages. If you apply 7V (or higher) to any I/O pin and hold it there, the chip will fry.

--
The Rugged Motor Driver: two H-bridges, more power than an L298, fully protected