This problem is a bit strange for me and I'm not sure if it's a hardware issue or a software issue. But I have now seen it on both of my test boards.I am using a Silabs C8051F500 development board with jtag connection for IDE / debuggger.Silabs board has extender board with OLED display.Mostly everything works fine.I have written the driver and a library of routines to write to any line of the display (parallel interface).

The problem.When I re power the system only lines 1 and 3 are displayed. 2 and 4 are not displayedBut when I connect with the debugger and then disconnect. On the disconnect all the lines including the second and fourth line get displayed. ( might have to connect disconnect 3 or 4 times before 4 lines get displayed)Once all 4 lines are displayed, they are always displayed.Is this a timing issue?A power up voltage issue?Something else?

I used a delay timer called spinlock to slow things down. I've tried different delay times as well but the delay does not seem to help or change behavior. More than not, the two lines occur on a cold power up cycle. After running a while if I quickly re power , the four lines appear most of the time. After waiting 5 seconds between powering up the 2 lines appear most of the time. I tied delaying 3 seconds after power up and before call initialization routine. It did not improve behavior. All comments, ideas and suggestions are most welcome.

I'm not sure of the cause of your problem, as I have just tested this with an Arduino using your initialization and have not seen the same results as you have described.I've powered it on/off several times, and have manually reset the processor as well and in all cases all 4 lines would work.I have copied my code below if that helps with any other areas of code that you have not shared in your last post:

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.*///---------------------------------------------------------

// The 8 bit data bus is connected to PORTA[7..0] of the Arduino Mega2560