Using Studio to reprogram ATMega168 fuses

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

I've been using Studio 4, a Jtag ICE mkII and an STK500 (with a STK501 fitted) to work with a ATMega128 for a while now because this is what I was originally supplied with. That device is nice because it has full JTAG and it's therefore easy to do things like programming the fuses.

I've now got some DIP samples of the ATmega168 device I actually intend to use so removed the STK501+ATMega128, fitted the ATMega168 into socket SCKT3200A2 and used the flying wires on the JTAG ICE header to connect to the (green) 6 pin ISP block on the STK500.

This let me program the DWEN fuse to enable DebugWire and I've been happily using that fine to debug.

But I now want to change some other fuses in the device and simply cannot find the place in Studio 4 where I can do that.

I can bring up the JTAG ICE mkII options and click the "Disable Debugwire" button to switch back to ISP programming and I can also switch the other way to go back to DebugWire by loading a file to debug and it pops up to say "DebugWire not active - do you want to switch it on now". That works too. So I can switch between the two.

But I cannot see how to program any of the other fuses in the device (clock sources etc.) with the combination of Studio 4, JTAG ICE mkII, STK500 and the AtMega168 part.

Can anyone explain what I'm missing?

Do I need to configure things for "high voltage programming"? If so, how?

Cliff

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

1) Use the debugWire interface to disable the DWEN fuse.

2) Close the JTAG ICE mkII connection in AVR Studio and end any active debug sessions.

3) Connect a 6-pin ribbon cable from the ISP6PIN connector to the SPROG2 connector.

4) Attach a serial cable from your PC to the RS232CTRL connector on the STK500.

5) In AVR Studio, click the little toolbar button that looks like a DIP chip with the letters "Con" on it.

6) Choose STK500 as a platform and select the correct COM port. Click Connect.

7) From here, you are allowed to program the AVR serially. As well, you can change all fuses and lock bits.

If you follow the STK500 instruction manual, you should also be able to program the ATmega168 using HV parallel programming as well -- just make sure to disconnect the ISP6PIN connector before connecting the HV programming cables.

Have you tried all of this and failed?

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

Thanks for that - I thought I'd tried every comnbination but the thing I may not have realised was the need to replace the 6 flying wires from the JTAG on SPROG2 with the 6 cable connector to ISP6PIN. I think *that* is the bit of magic I was lacking.

I can now read the fuses OK, just out of interest do you know why the little check box for "Serial Program downloading (SPI) enabled; [SPIEN=0]" shows a little red question mark?

Presumably, if I want to switch back to DebugWire it's just a case of programming the DWEN bit again with this current setup then removing the 6 way cable from SPROG2 and replacing the flying wires from the JTAG lead?

Cliff

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

Hi,

The little red question mark means that fuse programming option is not available using the programming interface you are using when you get that question mark. In other words, if you are using ISP programming, it is saying "I am not going to let you disable ISP programming since you are using an ISP programmer, otherwise you are up shits creek if you disable me and do not have another means of changing me back" :-) .

I don't have a JTAG programmer but I would assume you would get the little red question mark next to the JTAG fuse if you are using a JTAG programmer...?? [edit] and you were using an AVR that supported JTAG programming

Regards,
Steve