ATMega128V programming

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

Hi there,

It is my first time using the ATMega128V device and I would like to make a new design using it.

For now, I have used a lot of other devices using STK500 for parallel programming in order to set and reset the fuse bits like RESET DISABLE, DEBUG WIRE ENABLE and ISP ENABLE.

Reading the AVRStudio help I found that for programming this device I have to buy the STK501. As I see this device use other pins for ISP than other devices like ATMega88,16,32 or tiny devices.

Which is the better way for working with this device.

I also see that the Mega128 does not support the break command.

I have one STK500 and one MK2.

Could you help me to clear in my mind what I need and what to do?

Thank you,

Michael.

Michael.

User of:
IAR Embedded Workbench C/C++ Compiler
Altium Designer

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

The only addition you need is the 501. Once you mount a 128 in one of those and clip it into the 500's expansion connectors everything else is pretty painless. It's actually much easier to connect the JTAGICEmk2 to it than to the 500 normally. And for ISP programming you just run the normal 6 wire cable from ISP6PIN on the 500 to the 6 pin header on the 501 - no need to worry about the 128's different pin usage - that's all "hidden" from you.

Cliff

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

Cliff,

having the device soldered on my design board, may I connect the 6 pins from the STK500 in order to program it?
I mean ok, I need the 501 for parallel programming because all the signals needed is adapted from the 500 to the 501 tQFP socket, so I will order it.
But I am right connecting the 6 ISP pins from the 500 will program my device well. Is that true?

Also how about the ATMega128 break command support???
Is this a problem? may I have to use another part before getting deeper in my project?

Thanks for your time.

Michael

Michael.

User of:
IAR Embedded Workbench C/C++ Compiler
Altium Designer

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

In that sense the 128 on a target is no real different to any other AVR on a target. You just have to arrange for your PCB design to bring the right signals to the 6 pin ISP header on your board. (remembering that, unusually the 128 doesn't use the standard SPI lines for ISP like most other AVRs)

As for the break thing that's just a limitation on the number of hardware breakpoints that can be used in the JTAGICEmkII. If you are only in the habit of having one or two active breakpoints (like me) then it's not an issue at all. I think there are 4 but one's reserved for single-stepping so you can have 3 active. As it says in the JTAGICEmkII manual:

Quote:
Using the JTAGICE mkII with the ATmega128
The ATmega128 has no support for software breakpoints with JTAGICE mkII. However hardware breakpoints are supported.

Cliff

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

Ok Cliff,

Very thanks for your help.

Yes, I also use one or two active break points per time.

Thanks.

Michael

Michael.

User of:
IAR Embedded Workbench C/C++ Compiler
Altium Designer

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

I am now designing the test board for my project. I am using the ATMega128 device. I am very confused on this part (it' s my first time using it).

I would like to be able to program the device:
1. Via the STK500 ISP header or using the JTAGIceMK2 ISP Programmer/Debugger
3. The boot loader using a UART.

Also to debug my applycation using the JTAGIceMK2.

I have drawn the lines connecting the device with the MK2 debuger (PF4, PF5, PF6, PF7, RST, Vcc and GND).
Is there any possibitity to program the device via these signals?

Which UART pins I have to use in order to have a boot loader?

Michael.

Michael.

User of:
IAR Embedded Workbench C/C++ Compiler
Altium Designer

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

Get the JTAG 10 pin header laid out. You dont need pins sticking up on your board... you can stick a 10 pin header down in the holes to program it. You can erase and set fuses and do the INITIAL LOADING OF THE BOOTLOADER with the JTAG. After the BL is loaded and working, you can BL thru the serial port for example, or something more complicated and exotic should you decide to go that way.

Imagecraft compiler user

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

Since you will probably have the source code for your bootloader, you could choose either USART.

If you want to use USART0 and use ISP, place a resistor between the MAX232 and RXD0 of your Mega128. RXD0 is shared with DI pin for ISP.

The Mega128 should come with JTAG already enabled, so you only really need a JTAG header.

David.

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

Looking at the datasheet's Serial Programming unit (2467K–AVR–04/04, page 305), I see that the device need 5 signals, Vcc and GND, but the STK500 ISP header has 6 pins. What can I do?

Michael.

User of:
IAR Embedded Workbench C/C++ Compiler
Altium Designer

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

Look at any olimex avr schematic and copy the 10 pin avr header. Its in the stk500 docs...

Imagecraft compiler user

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

Quote:
the STK500 ISP header has 6 pins. What can I do?

Have a look at the diagram below, both for JTAG and ISP pins. Be very carefull, the M128 does NOT use Mosi and Miso for ISP but pe0 and pe1 which are the same pins for USART0.
http://www.members.optusnet.com.au/~ampertronics/images/CONT3%20diag.gif

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

Thank you all for your advices,

Michael

Michael.

User of:
IAR Embedded Workbench C/C++ Compiler
Altium Designer