JTAG protocoll

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

Hello!
I am currently missing something in the AVR datasheets.
It explains how to program the devices via the JTAG. But I can't seem to find any information on how to acutally time the signals if I want to bit bang the JTAG protocoll in order to create an own programmer with a second AVR.
Is this hardware layer explained somewhere? I would like to avoid reverse engineering it and rather have something official.
Second question is about dW. Has Atmel finally released something?
Thanks a lot!
Regards

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

The timing is the least of your worries - Atmel don't publish the information you need to put down the jtag.

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

Thanks for the fast reply!
But what is all the "Programming via the JTAG Interface" chapter in the datasheet about? I just want to programm, not debug.
I thought that the JTAG interface was public because there are third party programmers that support that.

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

AFIK, there is sufficient information to program the AVR.

The JTAG and debugWIRE debugging commands are proprietary.

It seems pointless to just program an AVR without debugging support. Even more pointless when ready-made hardware is cheaper than you could make yourself. e.g. Dragon.

If you only use 'old' AVRs like m16/32/64/128 then a Chinese JTAGICE-1 clone is really cheap! And you can debug as well as program. (AS4, C-SPY, Rowley)

David.

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

Is there a tutorial available somewhere that describes the programming?

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

What does Google have to say about that?

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

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

I've been searching all morning but only found obsolete sites or userguides for the JTAG-ICE... but no description on how to programm a device oneself. :(

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

Every data sheet describes the protocol. e.g. ATmega164P/324P/644P

Quote:
26.10 Programming via the JTAG Interface

So you can write your own software if that is what you want. I think that I wrote a program once.

David.

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

Thanks for the replys! I've seen the information in the datasheet. But my initial question was how is the timig and bit-pattern of the JTAG interface? I need the info on how to sequence the actual command on the four JTAG lines.

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

That could well be in the general JTAG specifications. JTAG as such is a "meta-protocol" if you like. It stipulates how JTAG chains are set up, and the general aspects of signalling. Any vendor using JTAG can then make a more specific protocol with their special commands etc.

Perhaps start here: http://en.wikipedia.org/wiki/Joi... . There will be much for you to read.

Or just buy a programmer? The question still stands: Why build your own? Do you hope to save a substantial amount of money? Or do you find the challenge as such irresistible? Or what?

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

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

My motivation are two aspects. As one I would like to maintain the hardware SPI free for other purposes (and free of other devices hanging on the lines). The second is I have an old project that I need to program myself using the JTAG port. It is not possible there to integrate a boot loader and hardly possible to switch it to SPI programming. And I can not use a bought programmer...

And also: yes, I want to achieve the JTAG programming just for the sake that it is so difficult ;-) perhaps I will fail but I will try.

How is it generally done programming via SPI when the hardware port is used also in the project itself?

Thanks for all the replays! I will see how I do and if it is possible.

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

Quote:

And I can not use a bought programmer...

Why?

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

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

Well it has to do with en/de-cryption of the .HEX file. And also no direct access to the device.

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

I'm guessing that you have obviously looked at the avrdude source code already as a template? Naturally it has a working implementation of programming via JTAG I imagine you will have learnt a lot by studying it no?

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

If you are paranoid about security, you hardly want JTAG available.

Of course people share ISP with external hardware on the SPI pins. If necessary, they invest in resistors !

In general, you design for compatible electrics. e.g. external devices that can be put into 3-state. (like SPI devices)

David.

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

That is a very great tip! Thank you! I did not jet come upon that idea.

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

If you describe your pin-use and hardware, you would probably get some very practical advice.

Using lockbits and/or encrypted files can be pretty secure. Just re-arranging switches, LEDs etc can often simplify your electrics (and software).

David.

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

Well the issue with the SPI would be a signal collision if the hardware SPI is used in the design itself to communicate with some other device. Then three SPI devices would be connected to the bus at the same time.

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

OP wrote:
I thought that the JTAG interface was public because there are third party programmers that support that.

Are we talking about mcuzone??
OP wrote:
Is there a tutorial available somewhere that describes the programming?

of AVRs via JTAG? Only HVPP and ISP protocols were published.
You could visit www.lura.sk or www.mcuzone.com because they have already cracked the protocol. I have also seen an initial AVR support for m128 in OpenOCD source tree.

IMHO - not worth the effort.

No RSTDISBL, no fun!

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

Nickelgrass wrote:
Well the issue with the SPI would be a signal collision if the hardware SPI is used in the design itself to communicate with some other device. Then three SPI devices would be connected to the bus at the same time.

Rubbish !

You can connect as many SPI devices to the same bus as you have separate /CS pins.

All external SPI devices must be powered and have real external pull-up resistors.

When the AVR is being ISPed by SPI, all AVR pins are three-state. The /RESET pin is the "SPI /CS" of the AVR.

As I suggested earlier, why not write an accurate summary of your hardware and requirements. Write it carefully in your native language. Then ask Google to translate into English. Edit if required.

People can be very helpful if you are cooperative. If we have to draw blood out of a stone, one drop at a time, we probably lose interest.

David.

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

Quote:

All external SPI devices must be powered and have real external pull-up resistors.


I'd rephrase with "pull-up" replaced with "weak resistors, pull-up or pull-down as is appropriate to keep the device deselected..."

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

Ok, now I understand. Once the device is reset it becomes a slave so there is only one master at each one time. And as long as all the /CS lines are kept high everything is fine.
:D

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

From this post:

david.prentice wrote:
Oh, the JTAG programming commands are described in the data sheet.

You are right! I didn't notice that JTAG progrmming commands were described in the datasheet. I knew there were JTAG boundary scan commands but somehow I have missed programming stuff.

No RSTDISBL, no fun!