Cannot start programming an AVR! Help please?

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

I am at my wits end, asking for help.

Programming an AVR has been my dream ever since I found out about them. Somehow though after following tutorials exactly I end up with errors. I have tried two methods:

 

1)USBASP with AVRDUDE:

My USBASP https://i.imgur.com/YLgbiT0.jpg

My connections https://i.imgur.com/5eJIBNJ.png

My results https://i.imgur.com/2BDfzEf.png

As you can see I cannot even get a verbose output. I did try the "slow jumper" The result is the same whether the programmer is connected or not. I was able to program an Atmega8 chip on an identical programmer in the past for firmware purposes. No luck after that.

 

2)Arduino UNO as ISP with Arduino IDE:

My UNO https://i.imgur.com/MC9y59W.jpg

My connections https://i.imgur.com/YKEShJL.png

My results https://i.imgur.com/ZGlDGBE.png https://i.imgur.com/qZFXaNq.png https://i.imgur.com/TngrQ7H.png

The options I used are included in the images above. As you can see I also tried an external clock but I kept getting one of the 3 results above every time.

 

Is there a mistake I cannot see? Please enlighten me!

Also how would you program the Attiny2313? Should I buy an expensive programmer?

TO THE FINDER... THE ISLE OF KOHOLINT, IS BUT AN ILLUSION... HUMAN, MONSTER, SEA, SKY... A SCENE ON THE LID OF A SLEEPER'S EYE... AWAKE THE DREAMER, AND KOHOLINT WILL VANISH MUCH LIKE A BUBBLE ON A NEEDLE... CAST-AWAY, YOU SHOULD KNOW THE TRUTH!

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

Most AVR programmers do not supply power to the target, although most USBasp have a jumper to do just that.

Also every AVR must have bypass caps (100nf) from all vcc/avcc pins to gnd, keep leads as short as possible.

It is much easier to use ready made break out boards such as an Arduino nano or pro-micro and cheaper too, then using bare AVR chips.

 

Jim

 

 

 

 

 

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

Thank you for your input.

I already tried the 100nF capacitor but no luck.

I am sure that programming a small Arduino board would be much easier but they are not as expendable/cheap as AVRs

and they are much bigger which makes them worst to use in my project.

Wait, how is buying an Arduino board cheaper than buying an AVR?

TO THE FINDER... THE ISLE OF KOHOLINT, IS BUT AN ILLUSION... HUMAN, MONSTER, SEA, SKY... A SCENE ON THE LID OF A SLEEPER'S EYE... AWAKE THE DREAMER, AND KOHOLINT WILL VANISH MUCH LIKE A BUBBLE ON A NEEDLE... CAST-AWAY, YOU SHOULD KNOW THE TRUTH!

Last Edited: Thu. Nov 1, 2018 - 08:38 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

tellSlater wrote:
Wait, how is buying an Arduino board cheaper than buying an AVR?

I don't know, but they are!    Look at the schematic of a nano board, and you will see what is needed for your bare chip as these are fairly minimal configurations.

Good luck with your project.

 

Jim

 

 

 

 

 

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

Until you have a known good system it can be difficult to identify the exact problem.

 

If you were to order an Arduino Nano V3, with a Mega328P, from Banggood Electronics, (for example), for USD $2.59

you could hook up your Uno ISP programmer and see if the system works.

 

That would confirm the PC software and USB interface to the Uno, the software running on the Uno, and the connections (programming cable) to the target micro, (The Nano).

 

That would be a great starting point.

If it works then it points to YOUR Nano setup and connections as the problem, and the place to focus one's attention for debugging the system.

 

JC

 

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

I don't believe that your PC has the USBasp driver registered, so the PC doesn't know that the USBasp exists.   The avrdude program has the printer parallel port LPT1: listed at the port that the data is being sent to, and it should display USBasp instead. 

 

  Windows has made it extremely difficult to install drivers that don't have official Microsoft driver-certification (i.e. a payoff to MS to get your company's product to work with Windows).  You have to turn off a deeply-embedded configuration setting, completely re-boot everything, and then install the LibSys driver. 

 

   When functional, the libsys driver will appear in Windows Device Manager (often) at the top of the list as an Atmel device.  When you see the driver in the Device Manager, then the USBasp should work OK.

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

Just been throught much the same sort of thing. Although may not be your problem. Check the lock bits fuse.

When mine were incorrectly set it would not program the memory so validate failed.

I found I like the Avrdudess gui front end for Avrdude as it allows you a more visual front end to your chip.

 

Hope this helps

Bob

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

You certainly need a 10k pullup on your reset line, especially when the programmer is not connected...not sure what your programmer itself provides (pull up, hi/lo driver, or open collector pulldown).

Be safe ---install a 10k pullup.

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

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

another thought.

first verify you have a communication channel to the programmer. I use a mega2560 board and AVR ISP

which defines a serial comm port. You can determine which one in Device manager.

One of the reasons I like Avrdudess is it front ends alot of Avrdude choices for you.

If you have connectivity to the programmer then use Avrdude and your programmer to verify you are talking

to the chip. The arduino IDE masks alot.

open a command window and type:

             avrdude -c avrisp -p m32u2 -P COM6 -b 115200

 

where 

            p is the part name which is Atmega32u2  or m32u2 in my case. Your ATTiny is t2313

            c is the programmer type which is “avrisp”

            P is how you communicate with programmer I use Com port 6

            b is the speed of the comm port.

 

you should get

         

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.05s

avrdude: Device signature = 0x1e958a

avrdude: safemode: Fuses OK (E:F4, H:D9, L:DE)

avrdude done.  Thank you.

 

If you don't nothing else will work.

if you enter terminal mode eg. avrdude -c avrisp -p m32u2 -P COM6 -b 115200 -t

you can query the lock bits by typing  D lock

and quit to exit.

Bob

Last Edited: Fri. Nov 2, 2018 - 02:20 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

EVERYTHING SOLVED!

First of all I would like to thank everyone for their inputs.

So, today I just woke up and tried things out one more time and everything worked as intended. The thing is, I have no idea why. I have been trying things this way for months. I did nothing different.

I was able to program the ATTiny2313 and ATTiny13 using the USBASP and AVRdude. I was able to get a verbose output from the Arduino's ATMega328p via USBASP using AVRdude.

Also, I was able to program the ATTiny13 using "Arduino as ISP" and this core for Arduino IDE --> https://github.com/leomil72/tiny .The MicroCore(https://github.com/MCUdude/MicroCore) I used before

with Arduino IDE still didn't work while trying to program the ATTiny2313 via "Arduino as ISP". All connection as shown in the original post.

 

Conclusions:

1)???????????????

2)The 0.1uF capacitor from VCC to GRD made no difference in programming for me.

3)USBasp works with probably any AVR. (I had doubts)

4)AVRs come programmed with a clock divided by 8(for tiny2313) or some number that makes them "slower". When in that state I was only able to communicate with them while using the command -B to drop the programmer's speed as well.

5)Some doubts about this MicroCore(https://github.com/MCUdude/MicroCore)

6)At some instances AVRdude could not locate the USBasp. Re-plugging the device solved that problem.

7)All connections on the original post are correct.(Still you may wanna include the 0.1uF capacitor since it is recommended by many sources. I think it helps stabilize the input voltage)

 

I will remember about the pull-up resistor on reset in the future.

 

Again thank you everyone and have a beautiful day!

TO THE FINDER... THE ISLE OF KOHOLINT, IS BUT AN ILLUSION... HUMAN, MONSTER, SEA, SKY... A SCENE ON THE LID OF A SLEEPER'S EYE... AWAKE THE DREAMER, AND KOHOLINT WILL VANISH MUCH LIKE A BUBBLE ON A NEEDLE... CAST-AWAY, YOU SHOULD KNOW THE TRUTH!