removing AVR MKii programmer results in display of garbage values

Go To Last Post
8 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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
   }
  

}

 

Last Edited: Sat. Apr 27, 2019 - 04:50 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Often, that sort of behavior indicates a missing ground somewhere. However, with a missing ground, removing either the USB or ISP usually has the same effect.

 

Puzzle!

 

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

no there are definitely different results to whether i remove the USB or ISP, when ever i remove ISP it shows garbage over all the 4 x 5 segments where as when i remove USB it shows only 1 column, with last value , indicating (or so i assume) that there is no program running

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

i found something else while messing up with the board.. when i restart the board without the programmer connected ... it shows garbage values but when i give a flick to reset pin on ISP header with ground pin it works perfect until i turn it off again.... I get the similar results when i press the reset button after turning it on without programmer. Now I feel i am close to the problem but still not sure how to solve it So, how can i solve this .. Thanks

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Post your schematic. you have a reset line problem.

 

David

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This is how i have my reset connections ... correct me if i am wrong but isn't it the AVR microcontroller which is supposed to generate the ground the reset pin in the begining before executing code? so in this case my is it my controller's fault because the button  in this image seems to work perfectly

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Post your schematic.

 

Need to see the entire schematic.

 

The schematic Reset\ circuitry looks fine.

 

You will have to check carefully the actual PCB for any bad connects, especially on the Ground network, (as mentioned above).

Check your programming header and the grounds for the micro and the shift registers, etc.

 

Are all of the micro's Vcc and AVcc tied to V+?

Are all of the micro's Grounds and AGround tied to Ground?

Do you have by-pass caps on all V+/Ground pairs of pins on the micro, and on the shift registers?

 

The little WiFi chip can draw a lot of current, as can your display.

Can you power supply handle the load?

 

One of the differences between resetting the micro after the project is powered up, and a cold start, is that the WiFi chip may have reduced its current draw from its initial power up requirements, and all caps on the PCB will be charged up and not drawing a lot of current as they do right at power up.  So you likely have a much better / cleaner power supply for the board after power up, when you then reset the micro.

 

A photo of the PCB would be helpful, also.

 

JC  

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have 12V/2.5 Amp power supply so i dont think its related to wifi , because even if i remove Wifi Chip the problem is still there, I spent two hours on PCB board for any broken or bad connection but i found nothing, I can share complete schematic but i dont have access to the PCB layout currently and picture taken from mobile wont help  i guess. I ' ll share the picture of Schematic in few hours. how ever can this be in any way related to the microcontroller ??? i mean is it possible that the MCU is not able to generate the RESET signal