# Running without JTAG.

Status
Not open for further replies.

#### veerubiji

##### Full Member level 2
Hi,
I am new to micro controller programming. I am working on Atmega32A micro controller. I am using JTAG for debugging. I am using UASRT communication to display information in PC.

Every time i need to debug when loss the power to the board. How to run without JTAG even when power off/on.
I don't want to debug every time when power off/on. Please help me what I have to do.

I am using JTAG Debugger to debug my code. Whenever I run the code with Debugger connected, Code works correctly but If I disconnect it, It fails to even Start!

#### alexan_e

I'm not sure is disabling jtag may fix the problem but you can try

The datasheet say you can disable it with one of the following

• Disable OCDEN Fuse.
• Disable JTAGEN Fuse.
• Write one to the JTD bit in MCUCSR.

#### veerubiji

##### Full Member level 2
I'm not sure is disabling jtag may fix the problem but you can try

The datasheet say you can disable it with one of the following
Yes, even i have found that from datasheet. I haven't seen such type of registers in my entire code. How to disable that? I am new programmer so help me please.

#### alexan_e

Code:
MCUCSR |= (1<<7);  // set JTD bit to 1 to disable the JTAG inteface

#### veerubiji

##### Full Member level 2
Code:
MCUCSR |= (1<<7);  // set JTD bit to 1 to disable the JTAG inteface

I have set that register before my while(1) starts. Still the same problem I need to connect JTAG when i power off/on. I have to start debugging , it is showing error
"Atmel Studio was unable to start your debug session.
Please verify device selection, interface settings, target power and connections to the target device."
[ERROR] , ModuleName: TCF (TCF command: Processes:getContext failed.)
[ERROR] JTAGID not valid. Debugger command enterProgMode failed., ModuleName: TCF (TCF command: Processes:launch failed.)
but the controller is running when i start debug in AS6. It is showing the error message and controller is running. i am getting result.

I want to run the controller directly when i power on the board.

- - - Updated - - -

Hi,

I have assigned MCUCSR |=(1<<7);

After that JTAG was disabled. Even when i remove that configuration also still JTAG is not functioning. Once if i disable using MCUCSR then how to enable once again.

#### alexan_e

I'm not sure I got what you asked correctly.
I thought you didn't want to use the debugger and had problems so I have suggested to disable the JTAG.
It seems that this is not what you want, it seems that you are having problems starting the debug session so my suggestion was irrelevant.

#### veerubiji

##### Full Member level 2
I'm not sure I got what you asked correctly.
I thought you didn't want to use the debugger and had problems so I have suggested to disable the JTAG.
It seems that this is not what you want, it seems that you are having problems starting the debug session so my suggestion was irrelevant.

What i want to do is,

I want to run the controller directly when power on without debugging. I have disabled debugging. When i connect debugger only i am getting results when i disconnect and power off/ on then i am not getting results. I want to run the controller when i power on, i don't want to start debugging AS6.

#### alexan_e

Ok . if you don't want debugging then you can disable the JTAG but it shouldn't be a problem if it was on unless you were trying to use the jtag pins as I/O

#### veerubiji

##### Full Member level 2
Ok . if you don't want debugging then you can disable the JTAG but it shouldn't be a problem if it was on unless you were trying to use the jtag pins as I/O

Yes, I have disabled the JTAG. so if i want to run controller i am using run-without debugging and i am getting results. But when power off and on then once again i have to start with run-without debugging. Is there any way that micro controller should run automatically when power on. I don't want to press any thing. I will dump code once into the controller then it has to run automatically when power is on.

It means my board is connected to PC using USART. So when i power on and i have to get results in Hyperterminal or putty.

#### bigdogguru

I'm not sure I understand your question as well.

However, have you tried simply detaching the JTAG programmer/debugger from the board and then powering on the board?

BigDog

#### veerubiji

##### Full Member level 2
I'm not sure I understand your question as well.

However, have you tried simply detaching the JTAG programmer/debugger from the board and then powering on the board?

BigDog
Yes,
I have done that, detaching the JTAG and power on the board and cheking results in the PC. But I am not getting any results.
I am getting error like
" The voltage seems to be low operating range for this device. Make sure the target is powered on."

#### veerubiji

##### Full Member level 2
Hi,

I need help in running micro-controller continuously.

It means I have ATmega32A controller, i am debugging using JATG. I have the final program and i have dumped into controller using JTAG. now i have disabled JATG using "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 should run even power loss and power on.
when the power losses comes again then I need to connect JATG 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 continious results always even power off/on.

#### alexan_e

I've never heard or an mcu before which doesn't run the code when it is powered on but rather expects to get some command from a softwre using Jtag.

Disconnect everything from the board ands just connect the power supply, how can this not work?

#### veerubiji

##### Full Member level 2
Hi,
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.

#### bigdogguru

I'm in full agreement with Alex, I never encounter a similar situation.

I've never had to disable the JTAG of an AVR to have the design power up correctly.

Something else is the source of this issue.

One possibility is the AVR is not being released from Reset, which would be a hardware issue.

What development board are you using?

Although I doubt it's source of the issue, what is the current fuse configuration?

BigDog

#### veerubiji

##### Full Member level 2
I am posting my entire code and the schematic of micro controller only. I haven't designed the board, it is designed by someone. I don't have the Schematic files. i have only printed schematic papers so i am scanning that paper and updated here. It is not clear but you have to zoom it to see more clear.

I am usinf CodeVisionAVR compiler and atmega32a controller.

#### Attachments

• bvr.zip
372.3 KB · Views: 6
• S-C284-12122017590.pdf
399.4 KB · Views: 9

#### alexan_e

Your schematic shows a digital ground and an analog ground, these are connected together right?

#### bigdogguru

We need at least two additional pieces of information before attempting to advise you further.

1. What is the fuse configuration of the device?

2. What type of power supply are you using to power the development board? A cheap wallwart, well regulated linear supply, etc?

BigDog

#### veerubiji

##### Full Member level 2
We need at least two additional pieces of information before attempting to advise you further.

1. What is the fuse configuration of the device?

2. What type of power supply are you using to power the development board? A cheap wallwart, well regulated linear supply, etc?

BigDog
They have designed well regulated linear power supply, because they are using the same type of power circuit to different controllers those are working good.

Fuse configuration, I have read about how to fuse configuration for AVR controllers. I know all HIGH and LOW fuse bit descriptions.

I am new to micro controller programming, This project is started by some other one, I have taken this project after sometime. So i have implemented some external functions and external ADC and other things. Can you please help me how to find fuse configuration. Because i didn't found that in entire project files.

for sure I know that, 16MHz external clock, JATG enable, SPIEN enable. I am not able to found any information about boot loader. The programming type is application not boot loader.

I am using CodeVisionAVR C compiler. Can you help how to find these as well. I found fuse bit settings in CodeVisionAVR. can you have a look at attached image.

#### Attachments

• fuse.png
51.6 KB · Views: 13
Last edited:

#### alexan_e

Use the read -> fuses function of the codevision screen you attached so that we can see the programmed fuses.
We are interested in the BOD fuses

Status
Not open for further replies.