ATMega JTAG bit-bang reprogram

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

We are planning using a ATMega device to monitor/control environmentals on our Linux-based system. We must be able to reprogram the mega in the field without opening the top. We already do this with a CPLD on the board by bit banging the JTAG (via the superio gpio pins) using the Altera JAM/STAPL software. Does anybody know how this can be done for the ATMega?

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

Put a bootloader into your chip?

Use the normal 6 pin ISP and bring the header outside the box?

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

Look for the section "JTAG programming instructions" in the data sheet for your AVR and see if that gives you what you need. You should be able to hang it off the same JTAG chain if you count your bit delays correctly.

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

I need to be more detailed – sorry.

js - this is a network test device. It has an x86 host running linux and the micro would be on the same board. The system could literally be in another country. We can't require someone to physically be at the system. The idea is that the updated micro image would be sent over the network to the x86 host and then a command is executed on the x86 to reprogram the micro.

dbc - I've already verified it will work just fine on the JTAG chain. Therefore, it can be easily programmed
at manufacturing. I mentioned the CPLD that is on the board. We have two ways of programming it via JTAG. First is via the JTAG chain (using Corelis tools). Second, it can be programmed by bit banging the CPLD JTAG lines. We mux the lines so we can select which method. This is exactly what we need to do with the micro.

I discovered an app last night that may do what I want. I haven’t had time this morning to research more. Has anyone used this app before? Thanks for the help!

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

It helps if I tell you the app - avrdude.

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

The BLIPS bootloader also does network updates.

Imagecraft compiler user

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

Quote:
The system could literally be in another country. We can't require someone to physically be at the system.
If you have a bootloader installed, then all you need is a serial comm between the micro and whatever (RS323 or even TTL, 2 pins)

But that's just one way I can think of.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

avrdude doesn't talk the JTAG language.

If, however, you had some bitbang pins connected to the 6-pin ISP port (MOSI, MISO, SCK, /RESET, VCC, GND), avrdude could accommodate it. (But IIRC the bitbang port would have to appear to avrdude as though it was a Centronics parallel port or a serial port.)

If you must use the JTAG port, it is possible to create a SVF programming file (containing the complete Flash, EEPROM, fuse and lockbit settings) using the utility AVRSVF (available on Atmel's website).
http://www.atmel.com/dyn/resourc...

Then, you can convert it into a JAM file using Altera's SVF2JAM utility.
https://www.altera.com/support/s...

Now, it should be possible to use your existing JAM/STAPL software to program your AVR through its JTAG pins as you use to program your CPLD through its JTAG pins.
What's more, I do believe it is possible to specify the JTAG chain information as you create the SVF file, and thereby allow the AVR to be programmed through its JTAG port without even having to isolate it from the JTTG chain.

- Luke

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

> avrdude doesn't talk the JTAG language.

I always contemplated adding this feature...

Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.

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

Thanks for all the info guys! I will update everyone on the result.

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

dl8dtl wrote:
> avrdude doesn't talk the JTAG language.

I always contemplated adding this feature...

I really wish it had this feature as well.

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

You didn't :(

bgolinger wrote:
Thanks for all the info guys! I will update everyone on the result.

axos88