The problem with programming for me

The computer does EXACTLY what I tell it to do (at least with PIC microcontrollers).  The problem is that what I tell it to do is often flawed logically, in other words 

the computer does what I tell it to do, not what I want it to do.

This happened with the LCD Metronome period timer:

a period of 1.1767 Sec



I just couldn't get it to work and then it finally dawned on me what the problem was.  Most LCD alphanumeric displays use a Hitachi chip known as the HD44780 (or a clone).  To save pins the data and commands are written to the 44780 chip in 4 bit blocks (4 bit nybbles versus 8 bit bytes, get it ?).  Although I had been writing the characters in two nybbles, with the control data I had only written 1 nybble so the display was jumbled.  An easy fix once I realized what was happening.  

Not much of a blog post but sometimes I get frustrated.

There are times when after clanging my head against the wall a sudden inspiration comes and the problem gets fixed.  Those times are nice but I suspect I should have taken more programming classes and/or use more rigorous programming tools that prevent a lot of the unforced errors.  Also I have a tendency to jump right in and start programming where it might be better to step back and consider the whole design at the beginning.  

Best Regards,
Chuck, WB9KZY
http://wb9kzy.com/ham.htm