Help with connecting the ATMEL AVR Mega128 ATMEGA128 microcontroller to my laptop.

eblc1388

Joined Nov 28, 2008
1,542
Your requirement of getting it locally in AU excludes 99% of possible choices.

The one you have quoted above uses an LPT interface, that means old type parallel printer port. I doubted your laptop have a parallel printer port. Mine does, it is an old IBM T23 using P3 CPU. You would need to get one with USB connector. All these programmer comes with the 10-core ribbon connecting cable.

There are two other complications. Two types of USB programmer exist and one can work directly inside AVR Studio as it emulate STK500 so one can select it while inside AVR Studio. They usually come in a plastic tortoise shell, just like the original one sold by ATMEL.



The other type shown below which is "USBASP" requires other 3rd party software to work, but there is no big deal. The software is free to use but you have to do the code downloading into the M128 outside AVR Studio.



Nearly all the suitable programmers are made in China.

Now you know the choices you can go into eBay.au and search for "USB ISP" and you will get a lot of selection.
 

Attachments

Thread Starter

eagle32

Joined Feb 18, 2011
30
You would need to contact the seller who sold you the proto board for answer of the following question:

I cannot connect to the board via JTAG. Is the JTAG configuration fuse inside the M128 enabled when the board is delivered?

Although the JTAG unit can program an AVR, the requirement is that the JTAG configuration fuse in the M128 be enabled. Atmel ships the chip with JTAG fuse enabled but it can become disabled when the board came to you. You should confirm this with the seller.

This bring us to the question of reading the fuse and programming the M128. The Jtag can do all that, provided the Jtag fuse has been enabled and it can connect to the chip. If the JTAG fuse is disabled, then you cannot connect to the AVR to do anything.

AVR Studio might intrepret this situation as "no target voltage error" or it maybe not. I don't know.

You would need just another tool, like every other AVR hobbyist, the AVRISP to program the AVR, almost any AVR. It is much simplier that a Jtag but it cannot do debugging. Besides downloading the program code to the AVR, AVRISP can also read and set all fuses inside the AVR chip, including the Jtag fuse. See if you can buy one from the seller. It should come with USB connection, just like the JTAG unit.
Hi, by the way do you know how can the board's Jtag fuse be enabled? My lecturer have the one that you shown me, is the ISP one that i am using in the class. So just assumed that the board's Jtag fuse is disabled and if i get the STK500 to enable it. Then the Jtag will works right?
I'll ask my lecturer too but im not so sure if he can enable the fuse.

I've asked the seller about the board's Jtag fuse configuration and im waiting for reply.

By the mean time i really want to get this board connected so i can start on my projects, i've an uC assignment due on next week and i haven't got any projects running yet which i need this board to run so i can start practice on it.
 

eblc1388

Joined Nov 28, 2008
1,542
I'll ask my lecturer too but im not so sure if he can enable the fuse.
Anyone with an ISP can.

In the software of the ISP, there is a tab for fuse bits setting. Just program the Jtagen fuse, then program the configuration into AVR and JTAG is enabled.

The following is an example.

 

Attachments

Thread Starter

eagle32

Joined Feb 18, 2011
30
Oh i see, thats so simple to do. But im gota see my lecturer next week to get it done, atm i cant do anything, just gota wait for the big zero for my assignment :/ .
I've just got a reply from the seller who sell the jtag to me and he sends me the avrdebug manual, so i just gota reinstall the softwares and try again, but the manual is abit hard to understand which way to go first, anyways i'll try it out see if it helps. Will let you know
 

Attachments

Thread Starter

eagle32

Joined Feb 18, 2011
30
Yeah no good Hi, i've uninstalled WinAVR , AVR studio and FL2303 driver, restart window and reinstalled everythings but the thing didnt connect when i tried to connect to the board. The file they've sent to me when i told them it didnt work and it gave me error message, but since i uninstalled WINAVR 201000... and tried to used the XP file and install it, it does work now.

So now the Jtag is recognized when i plug in, but still couldnt connect it to the AVR studio.
I think probly the fuse might be disabled, btw do you know how can i reset the bluddy thing so the Jtag fuse can be enabled again without the ISP? :D
 

eblc1388

Joined Nov 28, 2008
1,542
I think probly the fuse might be disabled, btw do you know how can i reset the bluddy thing so the Jtag fuse can be enabled again without the ISP? :D
Unfortunately no.

There are other means but it would involve soldering 20 wires to the pins of M128. :D
 

Thread Starter

eagle32

Joined Feb 18, 2011
30
Oh i wish i have all the components here and do the soldering :D. It is 4am over atm and im still chasing for the programer to get here quickly. Hopefully i can get some parts locally, or get the programer from hk on express post. I hope they can deliver it to my house by monday. Otherwise on tuesday is my day to get zero marks.
I've also found this on ebay: http://cgi.ebay.com.au/AVR-ISP-STK5...146?pt=LH_DefaultDomain_0&hash=item1e61fc5aca

It looks very compact, just plug it in and play without needing extra usb cable . Can you pls double check if it suitable for my pcb?
thanks
 

Thread Starter

eagle32

Joined Feb 18, 2011
30
I wish i can make one ISP to USB programer for myself right now. Btw do you or does anyone know if it simple to make my own programing cable to work with the AVR studio?
 
Last edited:

Thread Starter

eagle32

Joined Feb 18, 2011
30
I've contacted the seller, he actually doesnt know much about technical bit so he've asked the place where he got it from and he confirmed that the Jtag fuse was enabled. I dont know what else to do now.
 

eblc1388

Joined Nov 28, 2008
1,542
I dont know what else to do now.
You can meet with your lecturer and let him know of the present situation. Bring along the laptop, JTAG and the board.

Show him the error message in AVRStudio and perhaps he can help you sort out the reason why the hardware won't work. He can also use the AVRISP to confirm that the JTAG fuse has been enabled on the proto board.

If he can't help a student with this, at least he can speak to someone or ask somebody he know of capable of helping you.

The most important of all is to let him know you did spent plenty of effort trying to make thing work and request that the assignment be handed in a few days later.

Refer him to this thread if necessary and any reasonable person would understand your predicament you are in and allow the request.
 

Thread Starter

eagle32

Joined Feb 18, 2011
30
Yeah that's what i'll do when i go to see him. Atm im abit stuck with writing C codes, thats why i need that board to work to check my works. I've also asked some other sellers who sale the same board and the programer too. They said that the board works with the Jtag programer and the chip is not programed before shipped but when powered up, the 7Segment LED turns on from 1-7 . Then why my board has the 7Segment LEDs turns on from 0-9 when the board is powered up.

There must be something different. Atm i just gota get some codes going before the board can be use.
 

Thread Starter

eagle32

Joined Feb 18, 2011
30
Hi,
Im just wondering if i have damaged the board by electrostatic, because i've removed those jumper clips on #JP1 on the board and powered them on when i first got it. Could you pls check for me on the schematic diagram that i didnt hurt anything important that could effect the Jtag port? :D
 

Thread Starter

eagle32

Joined Feb 18, 2011
30
Hi,
Im just wondering if i have damaged the board by electrostatic, because i've removed those jumper clips on #JP1 on the board and powered them on when i first got it. Could you pls check for me on the schematic diagram that i didnt hurt anything important that could effect the Jtag port? :D
 

Attachments

eblc1388

Joined Nov 28, 2008
1,542
JP1 jumpers are meant to be disconnected if user does not want to use the features of realtime clock, usart or I2C EEPROM. It has nothing todo with the JTAG port.

It is extremely unlikely that you have damaged the board by electrostatic.

Are you running Win7 or Vista on the laptop? Many of the JTAG clones were designed in the era of WinXP and might not work correctly under newer OS unless the designer has specifically tested it under newer OS and confirmed it works.
 

Thread Starter

eagle32

Joined Feb 18, 2011
30
Im using Windows Xp SP3. By the way could you explain to me about the UART port? I've the RS232 cable to connect the board the PC. So what can i make use of it this UART port?
 

Thread Starter

eagle32

Joined Feb 18, 2011
30
hi EBLC, Finaly i've got a good news, after spending 3 hours with my teacher and i had to skip a class to join one of his evening class to solve the problem.

My teacher he found one of the problem was that the ribbon from the Jtag was too long, its length was like about a foot long so we had to cut it shorter to 2inches. The Jtag cable is then connected to the avr board in the class and it works fine. Afterward he've tried the ISP cable to my AVR board to find out the fuse configuration. The Jtag fuse configuration it displays as enabled, he also enabled the OCDEN fuse the same as the other board. So that was fine. Then we've looked into both of the board's schematic diagram and guess what, we've found that on my AVR board the pins #6 and #7 was not connected to ground/vcc as the other board and the four of 10k resistors doesnt necessary needed to be there, but it can be remove too .

So he recommended me to go home and solder a jumper lead to those pins not use . When i got home and try to solder thoses pins. After 20 mins of soldering, i then tried to connected to the board and HoolAA it works like a charm...the AVR board can now communicate with the AVR via the Jtag programer.

Im very happy with the works i've done and learned alots from these experience. Thank you so much for your helps ELBC, :)

* btw i just posting a pic here to show you how i've done, now i gota go to start working on my projects, its due to handed in already :)
 

Attachments

eblc1388

Joined Nov 28, 2008
1,542
Congratulation on the outcome. I think the long connecting cable is probably the main culprit.

The JTAG unit seller is just following the ATMEL's advice and provided the minimum set of connections, as can be seen from the JTAG ICE data sheet by ATMEL shown below.



Your teacher is correct on the issue of placing a jumper to AVR RESET pin on Pin6 because without this jumper, you will lose the ability to program the AVR chip, albeit the debugging will still work.

The four resistor pullups is *required*. Do not remove them.

The OCDEN fuse is controlled by AVRStudio during debug sessions, but there is no harm in enabling it.
 

Attachments

Top