Many thanks, friends, for the collective advice - all of it valuable.

You have solved the problem!

For this particular application, the writecode/readcode will get me out of trouble for prototyping; and in the revised circuit board I will use an external EEPROM.