ATMEGA32 & JTAG - Help

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

i was looking about JTAG programming for ATMEGA32.

 

From datasheet:

To be able to use the JTAG interface, the JTAGEN Fuse must be programmed. The device is
default shipped with the fuse programmed.

This mean that JTAG its already enabled by ATMEL. I checked it.

 

but that who i don't understand is:

In addition, the JTD bit in MCUCSR must be cleared.
Alternatively, if the JTD bit is set, the External Reset can be forced low. 

if JTAGEN its programmed and JTD is set, then, there's will External Reset in my AVR. right?

 

and...

Then, the JTD bit will be
cleared after two chip clocks, and the JTAG pins are available for programming.

JTD returns to zero after two chip clocks. which means that JTD it will always cleared when JTAGEN is programmed.

 

and...

This provides a
means of using the JTAG pins as normal port pins in running mode while still allowing In-System
Programming via the JTAG interface.

finally JTAG pins are used as normal port and JTAG interface its available for programming... simultaneously?

 

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

Unfortunately,   your English does not make much sense.

 

Simply connect your JTAG debugger to TMS, TCK, TDI, TDO, VCC, GND.    and away you go.

 

If you are running a program that disables JTAG in software (JTD),   you need to connect to RESET too.

 

David.

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

if i set JTD, its needed to connect RESET in JTAG for controling by software?

and what does this operation?

 

sorry for my english...

 

thanks for the reply!

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

I think the only problem with programming using jtag is if you use those pins when running. If so, you must disable jtag using MCUCSR=0x80; //TWICE!!

 

Imagecraft compiler user

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

I haven't change anything about jtag. JTAGEN it's programmed. And I have use those pins before without problem.
I didn't change MCUCSR status.

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

I do not believe you.

 

PC2, PC3, PC4, PC5 pins are the JTAG pins.

 

You can NOT use these pins in your program unless you use JTD.

 

It is quite simple:

If you want to use JTAG debugging,   you can NOT use PC2, PC3, PC4, PC5 pins.

If you want to use PC2, PC3, PC4, PC5 pins in your program,   you must use JTD.     (or remove JTAGEN fuse)

 

In practice,   you debug your program with JTAG.    Even if it means losing 4 GPIO pins.    e.g. only use the pins for non-critical things like LEDs or buttons.

 

Once the debugging is finished,   you re-compile with JTD, JTD and enable those non-critical things.

 

David.

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

I was used without jtag.