I need help in running micro-controller continuously.

I have an ATmega32A controller, I am debugging using JTAG. I have the final program and I have dumped into controller using JTAG. now I have disabled JTAG using the MCUCSR register. I am using AS6. I have run the program without debugging so it is executing correctly. But the problem is when the board losses power and comes again then it is not running. I want to make my board run even after power failures.

When the power comes again then I need to connect JTAG and open the solution in AS6 and I have to press start without debugging button otherwise it is not running or giving results. How can avoid this?

My board should give continuous results always, even after power outages.


I have the problem like this.

I have designed firmware for ATmega32A and some other peripherals. This is my first project. I am using UART communication to display the results in PuTTy. I have designed firmware like, i have some commands, those commands functionality has written in a switch case. so when I send command from PC the it will give result of that command functionality.

I have removed the JTAG connection to the board. Now power on the board. I have tried to send commands from PC(PuTTy) but not possible or not getting any results. that is my problem.

I want to get result without connect anything to board like JTAG. I want to do this power on the board and connect to PC then send commands and get the results.

How it is working now means, I need to connect JATG and power on the board then open this project in AS6 and then start without debugging then i am able to get the results. Even i can remove the JTAG after pressing start without debugging button in AS6, i am able to get results. but when power off and power on then i need to connect JTAG.

  • \$\begingroup\$ Does your program starts from Your Reset vector?? Or what you have written at Reset Vector? What happens when you remove JTAG and Power then Power up without connecting JTAG? \$\endgroup\$ – Swanand Dec 20 '12 at 9:26
  • \$\begingroup\$ @Swanand I haven't written any thing to Rest vector. Frankly I don't know that. I am new micro controller programming. Can you tel me how do that ? when I remove JTAG and power then power up once again without JTAG tried to run start without debugging then it giving error like "The voltage seems to be low operating range for this device. Make sure the target is powered on." \$\endgroup\$ – verendra Dec 20 '12 at 10:41
  • \$\begingroup\$ What gives you that error?? I would recommend you to download a simple LED blinking code and run it without JTAG. \$\endgroup\$ – Swanand Dec 20 '12 at 12:11
  • \$\begingroup\$ @Swanand i am getting that error in AS6. \$\endgroup\$ – verendra Dec 20 '12 at 12:34
  • \$\begingroup\$ @verendra - If you have the JTAG disconnected from the target hardware why are you in AS6? The AVR Studio will have no function with respect to your target when JTAG is disconnected. \$\endgroup\$ – Michael Karas Dec 20 '12 at 13:47

There are possibly many reasons why your target does not start up on its own when you try to "boot" it up after programming the MCU via the JTAG programmer. Here is a list of a few things that come to my mind that could be at fault here.

1) Your target hardware is not equipped with the proper power on reset circuit to manage the clean release of RESET in the MCU after the power has achieved stable voltage levels.

2) Your program code that you made is not designed as a completed standalone program entity for the MCU environment. A completed program would need to support the reset vector to control the power up start of the MCU and guide it over to the place that your program code resides in the flash memory.

3) You may have ommitted some essential low level MCU initialization code in your program startup path.

Further help for you is going to be very difficult to provide without a whole lot more information from you regarding what you have built and the programming environment you are using. Some details that will have to be provided include:

a) Show schematic of the MCU board or if it is some off the shelf thing tell what board it is.

b) Describe the programming language that you are using and the vendor of the tools being used.

c) Tell us what steps you have taken to learn how to get a low level standalone program to run on your MCU. Have you looked, for example, at the low level application notes from the MCU vendor for the simplest example you can find and followed that? (A common example is to start with a single LED connected to the MCU and write a program to blink it).

| improve this answer | |
  • \$\begingroup\$ Thanks for your reply. I am using CodeVisionAVR compiler. ATmega32A controller. I have no separate Reset circuit. even i don't have any such type of reset vector to control the power up start of the MCU. Can you have a look at my code what i have written for Atmega32. \$\endgroup\$ – verendra Dec 20 '12 at 14:29
  • 1
    \$\begingroup\$ Can you help me how to implement reset vector to control the power up start of the MCU. I am writing in C language. \$\endgroup\$ – verendra Dec 20 '12 at 14:40
  • 1
    \$\begingroup\$ @veredra - You will learn a lot more if you work this out from your own investigation. Suggestions: 1) Read your Compiler and Linker manuals from cover to cover. 2) Look at how sample programs that come with your compiler are constructed. 3) Scan through Atmel App Notes looking for example C code projects to see how those are put together. \$\endgroup\$ – Michael Karas Dec 21 '12 at 3:31
  • \$\begingroup\$ This has saved me if we had a fabrication issue, the programmer would supply some circuit voltage that the rest of the circuit had from USB and bypass a broken ground or some such. \$\endgroup\$ – Kortuk Jul 24 '13 at 20:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.