I am using atmega128 with avr mkii programmer i have connected 4 shift registers in daisy chain and an ESP8266. ESP8266 takes data from internet and displays on the segments driven by shift registers. Every thing seems to work perfect when the programmer is plugged in but as soon as i remove the programmer (not from the USB end but from the ISP header ) The program starts displaying garbage values. any suggestions to what exactly might be the problem. I know it might not be enough information to start with but i am not sure what else should i share. Thanks in Advance
edit: if i remove the programmer and turn off the power supply and then turn it on again it still shows garbage value but as soon as i connect the programmer on ISP header (without turning off power supply) the program starts working perfectly
volatile data[4][5]; //seven segment display is of 4 rows and 5 coulumns main() { DDRC=0b00111100; PORTC &= 0b11011111; for(int counter=0;counter<5;counter++) { for(int iterator=0;iterator<4;iterator++) { data[iterator][counter] =(return_binary(iterator+counter+1+number)); //initializing the segment data before anything else _delay_us(2); } } timer_initialization(); //starts an interrupt with 1ms which updates the status of shift registers Initialize_usart(); //initializes usart intialize_ESP8266(); // initializes ESP8266 Wifi_upload_data(field); //The name convention is wrong here but it fetches data from a server using ESP8266 while(1) { //here i keep updating the new values of data which runs perfectly fine when programmer is connected } }