Split from: n00b questions

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

I need to upoad a HEX file to a ATtiny85 micro via a USBasp programmer. Haven't a clue how to do this. It was easy with PIC programming via MPLab IPE,but I cannot find an equivalent to this ifor avr micros. Please help me.

Last Edited: Sun. Nov 22, 2020 - 01:06 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The usual choice to drive a USBAsp is avrdude.

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

I downloaded avrdude from an extensive listof files with different dates etc, which seems to have an unfamiliar extension, is compressed and zipped. haven't succeeded in opening, or installing it. Found something hopeful called Burn-o-mat, into which i put the hex file i wanted to program, and of course this triggered an error saying the avrdude file couldn't be found.  No progress so far.

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

Trying to program an avr micro with USASP seems incredibly complicated and, I'm afraid, beyond my capability. I'm just giving up and returning to Microchip PICs ; much more intuitive and altogether easier programing with their PicKit programmerssmiley. Thanks guys, for trying to help.

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

Everything in embedded systems development is incredibly complicated,you're right.   But (almost) everything makes sense when you understand what is going on.  If you have made it to avrfreaks dot net, then all this stuff is not beyond your capacity.

 

The AVR compiler turns your code into a .hex file, which is a character file of the raw data that gets written into the AVR.  You use AVRdude.exe to load this .hex file into the AVR.  

 

The program AVRdude.exe has a companion file called "avrdude.conf" that should be in the same folder as the avrdude.exe file.

 

AVRdude is called from the command prompt with a string of parameters.  This is often set up as batch file. Example for a Tiny85:

     avrdude -p t85 -c usbasp -P usb -U flash:w:myCode.hex

 

The USBasp interface uses Low-Voltage Serial option to write data into the AVR flash.  It uses MOSI, MISO, SCK, reset, Vcc, and Gnd lines that are on the ISP connector and AVR chip.

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

Trying to program an avr micro with USASP seems incredibly complicated and, I'm afraid, beyond my capability. I'm just giving up and returning to Microchip PICs 

Did you try actual Atmel studio 7 with an actual Atmel AVR programmer?  That's what they are made for & you can program right from the IDE menu. 

 

Even the  USBasp is indeed used by gazillions of people...maybe you are giving up too quick...give it a day's rest and destressing a bit & have another go. 

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

Thanks for the encouragement. If the spaces you left in your example  were for the necessary path to the avrdude folder, I'm afraid I'm unfamiliar with the required DOS syntax. The two avrdude files .exe and .conf are saved to the Desktop of my pc. I'd really appreciate it if you could help here.

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

 

Create a subdirectory ("folder") at the root of your PC called something like "C:\dude" then copy the avrdude files from the desktop to there (this will make them much easier to find when you start using a command prompt). also locate the .hex file you want to program into the AVR and put a copy of that in the same folder So you end up with something like:

 

 

then start a Command Prompt (just type "command" into the start menu to get to that). When it starts you will be in the wrong directory. The command in Windows to change to the right directory is "CD" so type:

 

 

Now you are ready to type the avrdude command such as:

 

 

As you can see that does not work for me because I don't have a USBAsp attached to this PC. Hopefully you will see messages suggesting the process worked but if not and you get some other kind of error then look around here on Freaks as most of the things that can "go wrong" when you are trying to use avrdude to program have already been explored here.

 

Last Edited: Tue. Nov 24, 2020 - 09:40 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

stevel28 wrote:

...much more intuitive and altogether easier programing with their PicKit programmerssmiley. Thanks guys, for trying to help.

 

So why not use a Pickit to program your AVRs?

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

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


#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

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

Hi Brian, this has made me feel incredibly stupid. Had no idea that Microchip had included AVRs in the valid list of micros catered for by their PICkit$. I new they had acquired Atmel recently, but they seemed to be onlypromoting Atmel software relative to the Atmel range of micros. I haven't seen any reference on their website to their own PIC software catering for Atmel products. As it happens, I have a PICkit3 which doesn't include AVR micros, but knowing from experience how well their IPE GUI worked in conjunction with the PICkit3, and how intuitive it was to use, I have ordered a PICkit4 which I'm sure will serve me well, and obviate the headaches I've endured trying to cope with the AVR stuff. Thanks to you with your timely help, I now hope to be able to proceed with my development work seamlessly and with  newly inspired confidence. Thanks Brian.

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

Thankyou Clawson for going to all that detailed explanation in trying to get me off the ground with my programming problem. However you can see from Brian's post that he has found a simple solution to the problem of programming AVR micros. It was something that was under my nose really, and I didn't spot it. I did in the interim find some other "IPEs" purporting to program via USBasps such as Burn-O-Mat and Robokits, but none of these functioned for me, claiming  DLL or some other vital files were missing.  But just want to say thanks for your encouragement and help and patience. Really appreciated.

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

AVR support is slowly being added into the original PIC tools.

 

If you download the release notes for MPLABX you can find a matrix showing what tools are currently supporting which AVRs. Support is not 100% yet but it looks like the intention is to support a large number of them.

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

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

Device Support | MPLAB X IDE v5.40

though v5.45 is current

 

"Dare to be naïve." - Buckminster Fuller

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

Thanks Brian, I'll do that. Right now I'm looking forward to receiving my new PICkit4  tomorrow I hope, and moving on with my project.

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

Give it a try with this tool, it's GUI and very much similar to PIC flashing tools. and yes it works with USBasp 

 

https://extremeelectronics.co.in...

 

When you go to download page, it will ask you to share the link on your social media (you don't have to do this), just check the box which says " I have shared the link on my social network. " and click download file now !

 

The tool is safe and a link to the tool is provided on USBasp website (https://www.fischl.de/usbasp/)   under recommended supporting Software

At the tiniest fraction of scale, physics is more interesting!

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

Hi Aser , Thanks for your suggestion.  This was one of the apps i actually tried along with a couple of others. Unfortunately none of them worked for me, consistently throwing up errors of one sort or another. Quite possibly my fault, but in any case I now have Microchip's PICkit4, which although I haven't set up yet will, fingers crossed, work .

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


If you haven't found it yet then this will be useful...

 

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

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

Brian Fairchild wrote:

 

This was a great news until I found out that MPLAB X IPE supports every major programming tool except the one that I have got, ATMEL ICE. angry

Last Edited: Thu. Nov 26, 2020 - 02:52 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Release Notes for MPLAB® IPE
Integrated Programming Environment

MPLAB® X IDE v5.45

 

October 15, 2020

...

 

3       Other Support

These programming tools work with the MPLAB IPE. Refer to their respective readmes for additional information.

·         MPLAB ICD 4 In-Circuit Debugger/Production Programmer

·         MPLAB ICD 3 In-Circuit Debugger/Production Programmer

·         MPLAB PICkit™ 4 In-Circuit Debugger/Development Programmer

·         MPLAB PICkit 3 In-Circuit Debugger/Development Programmer

·         MPLAB Snap Information Sheet

·         MPLAB PM3 Production Programmer

·         MPLAB REAL ICE™ In-Circuit Emulator/Production Programmer

 

...

Device Support | MPLAB X IDE v5.40

 

"Dare to be naïve." - Buckminster Fuller

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

That's really tough luck Brian. Maybe you should go for the PICkit4, although I don't know if It will work, haven't had a chance to wire it up yet. If I have any luck, I'll be back here to report.  Thanks for pinout info, but it does appear in the  in the PICkit4 User Guide which i downloaded from Microchip. Appreciate the support. Might be worth your asking Microchip why they omitted your device? 

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

Does MPLAB X IPE support the AVR dragon?

At the tiniest fraction of scale, physics is more interesting!

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

No

 

 

"Dare to be naïve." - Buckminster Fuller