Power-up Initialization of HD44780 LCD Module
I changed my initialization code so that it sent the upper 4-bit nibble of the function set command twice. Following which I resent the upper 4-bit nibble followed by the lower 4-bit nibble. This does not match the datasheet which seems to indicate that you can send the upper 4-bit nibble then send the function set command upper 4-bit followed by lower 4-bit.

// Works sometimes pseudo-code
port=0x20;
e=1; e=0;
port=0x20;
e=1; e=0;
port=0xC0;
e=1; e=0;

// Works all the time pseudo-code
port=0x20;
e=1; e=0;
e=1; e=0;
port=0x20;
e=1; e=0;
port=0xC0;
e=1; e=0;