Hello everyone !
I'm working on a customize circuit which has atmega2560 microcontroller and a PCF8576 lcd driver which is interfaced with i2c protocol and a 40 segment monochromatic LCD.
I have uploaded a simple program which is working very well on arduino uno but works only once with atmega2560 customized board.
more over some points to remember that the customized board of atmega2560 has a 8mhz crystal and operationg voltages are 3.3v.
Once i programs the atmega2560 board the LCD shows the digits but when i cut off the power and again powers the system, the display goes forever, then if i again program the atmega2560 the lcd don't shows the digits (But controller is powered on and working well as it shows serial data on serial monitor) and i have to wait a long time e.g 10 to 15 mins to program it again to make it work (only if the power is cut off of the microcontroller ).
further more if i program the arduino uno with the same code and uses it's SDA and SCL pins and jumper them with atmega2560's SCL SDA pins it starts work and keep working if i also remove the SCL and SDA connections from Arduino uno and also i could program it as many as time i want from atmega2560 the code works until power is cut off again.
I have attached the code below for the reference,
In debugging i found that either there is some capacitor on the atmega2560 board which is not allowing the PCF8576 driver to initialize after power cut off or reset or either their is a issue of frequency because i'm using 8mhz crystal and arduino uno is working fine because it has 16 mhz crystal.