To properly diagnose you'll need the charging system checked. As far as visually checking the connections, you'll need to do more than that - remove the connections, clean and tighten. Connections can "look" fine, but there could be enough resistance to cause problems. Off hand though I would suspect a failing alternator. Don't know that I would trust the codes at this point. If the battery has discharged due to a faulty alternator the low voltage can cause all kinds of weird off-the-wall codes.