Adventures in AVR ISP Programming
Вставка
- Опубліковано 16 лют 2017
- Dave battles the Atmel/Microchip AVR ISP Mk2 programmer with AVRdude in order to program an ATMEGA328 and get his uRAD radiation monitor working again. Can he do it?
www.uradmonitor.com
Forum: www.eevblog.com/forum/blog/adv...
EEVblog Main Web Site: www.eevblog.com
The 2nd EEVblog Channel: / eevblog2
Support the EEVblog through Patreon!
/ eevblog
EEVblog Amazon Store (Dave gets a cut):
astore.amazon.com/eevblogstore-20
T-Shirts: teespring.com/stores/eevblog
💗 Likecoin - Coins for Likes: likecoin.pro/@eevblog/dil9/hcq3 - Наука та технологія
8:18 Dave, you need to say the magic words; "focus, you *fuck*!"
urdnal Ave FTW
urdnal many like-minded folks here :-)
It just never ends...
"Focus, you fornicating fanboy!" :-D
Got three C920s here, they're very good, except focus. Most of the time I just open the camera settings and override the focus.
Joys of using Windows
So true! , it's nice to have drivers already included in kernel, I had forgotten the pain :p
How is this a Windows problem exactly? Don't get me wrong. I love linux but i use both daily and both have greate driver support. It's the vendor that should be blamed when crap like this happens. When they take the time to support things properly, it works just as great both on Windows and Linux
Nippius, take a look at the WDDM driver SDK and then tell me that Windows/Microsoft isn't to blame for shitty drivers.
It seems like you've never looked at one yourself since it is beautifully architected and very well documented in MSDN.
You're joking right?
Omg. In Linux it's just a two commands to install compiler and avrdude.
Drivers for most popular programmers (also cheapest Chinese) already included in kernel.
Just start working, without any pain!
That and a makefile is all you really need for painless AVR development. :)
15 hours googling commands to set up the damn OS to get started though.
mm no, you just insert the CD or whatever media and click "next" a few times, then let it boot to desktop...
But why? If you need only programming features - you can just install only avrdude.
How to install depends on your distro. In my case: sudo apt-get install avrdude. One minute and ready to go, simple.
Connect programmer and flash your chips, no additional drivers is needed in most cases.
That's what all the Linux fanboys always say. In the end I always seem to end up on Google for hours trying to fix the most mundane shit through some awkward command line song and dance.
I'm sure when you're immersed in it, after you've spent a couple of years running into all the small annoyances and know how to work around/fix them, then I'm sure it's a great experience. The thing is that people seem to conveniently forget all those little problems they had at the start and only remember the good things.
Hardest part of programming always seems to be installing and configuring the damn IDEs!
That's what containers are for ;)
Could not stop laughing through the video. I've personally lived through all those issues! Bloody hell!
same here.. which is why now mostly I'm a linux user.. except for mucking about with this kind of stuff.. probably have some self torture issues going on :D
yeah. I guess we all did. Now I'm on Mac OS and some things are easier.
"I just installed another random driver from the interwebz!"
This is exactly why we have this signed driver stuff and this is one way of how products in China may end up containing compromised firmware.
I appreciate that you posted this. nice to see we you were persistent and worked it out. Ill be doing something similar later today.
The Digitally Signed driver protection is a good thing and we should appreciate it. So many viruses used to attach themselves to drivers back in the day.
Yeah but I'm guessing that Dave didn't know how to disable it, he appears to struggle a bit with computers, which seems odd to me as I figured that an EE would understand computers better than I do, yet whenever Dave or Julian puts videos out and they have to install drivers and things like that, they tend to react to problems in almost a similar manner to what I'd expect a less tech savvy user such as my parents would. You know the "DOH, stupid technology... Why don't you just work!" kind of thing.
Because stuff should just work.
Not disageeing, it certainly should work, however bugs and other little issues are pretty much a fact of life/inevitably just as much as hardware failure is, for example maybe you want to put together and test a circuit but suddenly your bench PSU starts acting up, by not putting out anything or the display is screwed up, oh well now you gotta fix that instead. Basically what I'm getting at is that troubleshooting and handling issues just comes with the territory when dealing with tech, no matter whether it's software or hardware related, at least until we can make everything perfect or as close to it as possible and that's one of the main reasons I got into electronics, because I could troubleshoot and repair PCs but pretty much nothing else up until now.
Google: "digitally signed drivers malware", plenty of root keys have been stolen/found/left in places stupid and more and more malware nowadays is signed and secure. And there are ways around a lot of it.
It's a good idea in theory but now just creates a false scene of security.
I was an IT manager at an engineering company many moons ago. They were talented and knew how to use their software apps. But when they started dicking around with the OS or hardware, they'd screw things up in a hurry.
Ever heard the one about the workman who blames his tools..? RTFM
Except for those occasions when the manual is utter pants, and you are left with figuring things out for yourself.
The manuals are absolute garbage.
AVR 7 is probably the best embedded IDE in existence (for AVR, AVR32, and SAM of course).
I'm a fan of Visual Studio in general, and when they went to VS2015 it was a great day. All the nice auto complete and such.
The quick & dirty solution is to download and install Arduino IDE and that'll install all drivers and avrdude for you + all Win10 signed drivers as well! AVR Studio is way overkill if you are just going to flash a hex-file imho.
Jens Andree AVR studio really won't help if you just want to run AVRDude - unless I missed something, you run it as an external tool so no better than running a command line.
I had issues getting my Windows 10 to recognise my USBASP correctly but worked after I installed a device driver filter from libusb.
in AVR Studio you can just upload any HEX file directly
Yes, but installing Arduino IDE to get signed drivers and avrdude is way quicker and a lot smaller! If you only need to flash a hex-file that is...
If you are going to do some development that's a different thing all together but for just flashing and nothing else I still would recommend Arduino IDE - purely because of the bundled signed Win10 drivers.
All methods are great as long as they work ;)
Jens Andree There is an old version of AVR Studio available. It is 4.something if I remember correctly. It is very quick to install and it even works much better than the new bloated versions. The only disadvantage is that it does not support the most recent chips.
Yes, AVR Studio v 4.16 . I still use it if I have to program some of the old 8bit Atmel shit.
Dave,
Been there done that! It get worse as you get older, I been keeping a text log file for each project or item like this. In the log I do a simplified " how to do it", problems encountered and solutions. Saved my but many times.
Craig
Never ever had a problem programming AVR chips but then again I'm using linux.
Windows still seems the same it was when I was using it back in the 90's. It hides things from the user, you don't really know what's going on and you just have to fiddle around and install little random files and programs you don't know what they really do and hope for the best. For engineering work it's a joke. Maybe it works better for games I dunno.
True, but windows users would say the same thing about linux.
That was a fun one! Glad you got it working. Looking at the map of Sydney made me think how neat it might be to see your take on a video outside the lab. I'm thinking around town and some of your favorite spots (want to know where to go when I come for a visit). It seems like such a beautiful city and I'm definitely planning to visit at some point in the future.
And that's a good argument on why you shouldn't update your software only when you need to use it. Atmel was probably installing Visual Studio, which is a 15 GB installation (or 43 GB for the full installation)
One of the most entertaining videos I've watched today.
Sorry for optopic question, would you do a video on Vds dv/dt and mosfets and why it is a problem ?
awesome video! I've made a wireless avr programmer for an university project haha good times
I recommend the USBtinyISP programmer. It's ~$20 in the states. Comes with both the 6-pin and 10-pin cables. I've had no issues with drivers or getting it to work with avrdude.
The Atmel Studio does it finished installing afterall?
I own a tiny apartment on York St in Ottawa, about .5km from the Parliament Buildings. I also am on the edge of a little attraction here, called the byward market.
It took me 40 minutes to install Atmel Studio. It tells you on the web site that it'll take a while - but you're right - it's the slowest install I have ever done. When you start it up to use it, it's none too snappy either.
Your programmer (6-pin header) is the mark-II. The mark-I apparently had both. I just read that today after searching for AVR programmer reviews, because I'm about to walk down this road as well.
For future reference, you can right click on a .inf file and click install (with the device unplugged)
The Arduino IDE bundles (and wraps) avrdude, and just calls out to it when it wants to do uploads. If you have Arduino installed on the computer, you probably already had avrdude hiding somewhere. If you go into Arduino settings and turn on verbose messages during upload, you can see the command line that it uses to invoke avrdude including all the arguments. It can be a handy way to quickly get a working example of a command line invocation of avrdude with all the options set correctly.
Good tip, thanks.
thankyou @superHouseTv. I was struggling for the path of avrdude so that i can paste it in atmel studio 7 in external tools.
I hate Arduino, use an Atmel Studio its better
getting atmel studio up and running with all the drivers is a pain, but once it's up and running it's a fairly capable tool!
Watching Dave us a PC is always entertaining
personally, i use my arduino uno to prorgam AVR chips. and I use an IDE called Code::Blocks with avr-gcc. Does it all pretty much and is far more lightweight and less troublesome ;)
Ah, good ole 10 pin ISP interface messing up the day there a bit. I do love the AVR architecture, though I find myself using the SOT23-6 Tiny10 more and more in projects. Never tried programming via Windows, was interesting to see the dramas (using avrdude in linux)
Originally I think it was to prevent damage if reversed.... or it could have just been that 2x3 headers weren't overly common at the time.
I think the extra ground lines on the 10 pin header were to reduce cross talk between the clk, mosi and miso lines on longer ribbon cable runs.
I actually hope to use a Tiny10 soon. Sadly it looks like Microchip will be discontinuing the SOT23-6 package, the very package I want to use. Part status is "last time to buy," but I don't need a whole reel (from DigiKey)! Newark/element14 still have some for a couple cents more. I hope to produce 30 units though, so assembly with the UDFN package would have to be outsourced, but then I could have the whole circuit assembled. Do you write programs in assembly for the ATtiny10? I know C for the chip wasn't well supported in Atmel Studio. Allegedly it should work, but I'm wondering if they've fixed the issue in version 7. Heh, hope I can even install the thing after seeing this. My program wouldn't be much, so it's not like I need to cram. I could probably write it in assembly without too much issue, but I hope to do a little more with it later depending on my experience with it.
Oh really, that's annoying that they're planning on shutting down the line :( I have a lot of projects that use them. Will they be replacing it with something like a DFN/QFN/BGA instead?
As for the programming, yes, I wrote my stuff in ASM directly, it's just a lot simpler for the T4/5/9/10 series, though for the T13 up I write it in C, other than the odd line or two of inline ASM. My build environment is just linux + gvim + avr gcc + avrdude. Has served me well for a decade now.
Something I forgot to mention: The MyAVR software "MyAVR Prog Tool" seems to rely on AVRDude internally and offers a really nice and simple GUI to burn and read all theAVR memories (Flash, EEPROM, Fuses), and also supports devices other than MyAVR products. (I'm not affiliated with them, I'm just a happy user for about 8 years now)
Windows 2000 nostalgia video. This sort of process was the norm back in the day :)
There should be a big warning somewhere of "Don't use WinAVR". Its last update was over 7 years ago now and as much as people like to stick their heads in the sand, software has a habit of rotting.
It was the same for me Dave when I was trying to flash with AVR dude, mostly driver issues. It seems that there's a lot of variation between driver sources. I had to get a third party driver as the ones from the official source didn't work.
We have this program at my work. Some of the pagers we have to work with need this program to update the firmware.
can you program an ATMEGA/ATtiny with arduino directly from the USBasp? After burning the arduino bootloader
UECIDE is an interesting alternative to the Arduino IDE, meant for more general embedded programming use. It might have plugins to make AVR programming simpler.
AVR *dude*
AVR *dude*
AVR *dude*
3:28, LOL. Avrdude+USBAsp *thumbs up* ^^
There is no need to make an adapter for 10pin ISP.
If you open up the AVRISP mk2 (just 4 clips on the bottom) you'll find that there are pads for a 10pin header, you merely have to solder it and connect a ribbon cable. You can also leave both 10pin and 6pin ribbon cables attached, the front slot is large enough.
I love how Dave just IGNORES the error messages, even though the answer to the problem was IN THERE! He ALWAYS does this too, it drives me nuts.... just randomly closes error windows without reading them and then gets angry when something doesn't work. WTF Dave?! You're supposed to be one of us.
He is one of us. Windows and the way it works with drivers, you feel like your rolling the dice.
Avrdude inside AVR CrossPack works fine for OS X. No driver hassle for me in 10.11.6 ;-).
This is why I'm still using Windows XP in 2023 and everything works just fine.
😁
Me too.
I have Linux Mint 17.3 (Rosa) 64bit it usually comes with gcc and gdb installed and it is relativity easy to install the gcc-avr and gdb-avr and install Code::Blocks IDE will create executables by selecting GCC-AVR and building the project that you were going to build.
got to love this incredible bad aproach.. you did the same thing with the pickit lool, and microchip even has the correct way to do it in large letters.. ok, next time st arm eheheh
With the webcam focus, you are probably better off fishing around the settings and using manual focus. I'm guessing it has it somewhere.
Dave, didn't you get an USBasp programmer with the 10pin connector cable from Tron-Club in your mailbag a month ago? (EEVblog #964)
Could've used that ;)
You even looked at the setup guide they have briefly.
MS-windows and engineering tools written for it are predominantly shit.
lmiddleman which os do you use funny man
lmiddleman Engineers use windows because most tools and software is is written for windows. This is a problem with avr and it's software/driver, not windows.
Microsoft actually did a half decent job with Windows 7 but then realized that if they improve it any further, nobody would buy their new products.
Nevets Exactly. That's why I asked him what platform he uses. Seems funny man doesn't work in embedded systems or have a comeback 😂
Just checked my unit 12000056, still working. However my location has moved!! Mine was at my location, but now its 200km out, Bummer
Take an Arduino some patch cables and u are good!
I never used an Programmer for my Hobby Projekts because the Arduino is hooked up for testing things anyway.
Some years ago, returning to µcontroller stuff, I had to choose between 8051, AVR and microchip. Familiar with 8051 assembler, I found the products old and lacking features. I went to microchip and when I watch the pain with Atmel products, I think I made the right choice. Pickit3 doesn't need painfull microcode update. Correction. microcode updates on pickit3 are handled by mplabx.
There is an awful lot of Murphy in that video...gladly with a happy end :)
I spent 4 hours trying to program a ATtiny85 this morning. Tried using arduino as ISP, didn't work, set up an 1mhz external clock cause some fuse was fused, on and on. My best bet, they're counterfeit.
Hello. It seems to me that for ATtiny85 program you should use Arduio IDE 1.0.5. Find something about it, you should get it! Counterfeits are a real frustration. Lamentable ..... Success for you.
Just when I thought Dave is going to present some programming tips ...
You can use AVR Burn-O-Mat as gui prog.
Lol Dave, that was a classic. An EE trying to battle Windows!
If the driver signing process was easier it would have worked plug and play, but blame Microsoft for that!
it would be nice if you could make a video on how to store IC's and protect them from ESD
I haven't got any issue with Atmel Studio 7. And perfectly integrated with the low cost DEBUGGER Atmel-ICE. Before that, to debug you had to spend a LOT or use the mk2 programmers only for programming. So, it is a big improvement from Atmel in the latest years, so IMHO, I would't complain when talking about Microchip and Atmel. (BTW, I had the same experience when using avrdude and those unofficial drivers!)
Just try to flash TI or Freescale/NXP MCUs...
oh the AVRs, if you can program one, you can program any of them, for avrdude I rather use avrdudess, a simple GUI makes things a lot easier
Brutaltronics +1 for this. AVRDUDESS is the bomb.
Isn't there a way to use an Arduino as an interface to program the ATMega328? I suspect this is the chip in the Arduino Mega.
Hehe, UA-cam is putting Tektronix ads on your channel during the Keysight giveaway.
Strangely my avrisp mk2 worked perfectly on the first try.
How odd I just did a clean install of Atmel Studio last week with no issues. Atmel Studio with AVR Dragon makes firmware flashing super easy (Windows 10 even).
Oh no... It's Dave... ..And software. This can't end well...
Must go and grab a fresh cup of tea before I sit down to watch the show.
I'm expecting a few "I bet the bloody penguins are throwing stuff at their screens right now..." ..Even though we are on Windows.
Don't let me down, Dave. :)
Dave the vast majority of these devices just a need a generic usb driver (that's what libusb is) and by far the easiest way to set that up on windows is a free tool called zadig. It has several usb drivers, including libusb, so if one doesn't seem to work well with a particular device you easily try a different one.
is it SBM counter?
Would'nt Arduino IDE have been an optional choice for this?
Oh man this really reminds me of trying to do anything with Linux
It has since moved your location to the Castle Hills Country Club.
4:03 i also have to *MIX* mouse issues some time ;)
I'm not surprised. I've had nothing but problems with Atmel tools. I've tried getting an AVR Dragon working on three different computers and had three different driver problems. Weird Jungo stuff, expired driver signing from Atmel, etc. People on this thread are quick to blame Windows, but it seems like every other MCU manufacturer has figured their shit out; I've never had problems with tools from NXP/Freescale, TI, Silicon Labs, and Microchip.
2:27 "sign my life away... yeah...whatever... " rofl. :P
when i installed Atmel Studio 7 it created a restore point and after installing it ( all files on my Desktop disappeared !!! )
You could have just gone and had your lunch or something while Atmel Studio installed and when you got back it would have taken 3 seconds and you'd have Atmel Studio ready for next time you needed it.
Zadig would have saved you the pain of installing the drivers plus it is digitally signed. Also another way of getting avrdude would be downloading the Arduino IDE.
Isn't avrdude installed with the Arduino IDE?
Yes, it is.
2:25 careful of that eula dave, if you've seen the 'centipede' episode of south park you know what i mean!
i had never problems with Atmel stuff, just plug and play
i think he just need fluffing chill and he making this harder than it should be
Hi Dave,
I share your frustration. I use Atmel uCs for most of my work so I have Studio 7 working with the ISP II but it's still a pain in the butt! You would think people who design these things would care about making them actually usable for end uses! I love the AVR chips though, great for low power apps.
Years ago I started with the 3-resistor parallel port programmer under linux + avrdude, life was simple back then. I did at one point buy a clone AVRisp looking exactly like what Dave has here, and it's in the almost-bin. Never worked right. These days I just use a simple USBtiny programmer (uses an attiny2313) which now can also handle my TPI requirements to flash the Tiny10 series too thanks to an avrdude software patch.
Paul,
I have one of those AVRisp look-alike clones in my junk bin too! Absolutely useless!
What I did now was to design a bunch of boards with zip sockets that the 6 PIN AVRisp II plugs directly into. They cost me ten bucks for ten boards from my board house. A bunch of 40 pin zips from eBay and for under thirty bucks I have about 5 or 6 boards that plug into the AVRisp II each labeled with a specific AVR chip. Low hassle, does 90% of my AVR programming.
I'm presuming that's mostly for PDIP stuff? Usually I put the ISP header on each project which saves a lot of hassle of course (for the SO8 Tiny13/*5 series I use a clip). The SOT23-6 stuff however I flash before I put on, and I keep one premounted on a breakout board just for the purpose of developing the firmware.
mosfet500 A while back I came across a product made by AVR which is called the AVR dragon. I brought one and put a 40 pin zif socket on it and also a bunch of female headers so I can easily hook it up depending on the type of chip being flashed. It can perform a symbolic debug on all devices with OCD with SPI, JTAG, PDI (selected devices), high voltage serial programming, parallel programming, and aWire modes, and supports debugging using SPI, JTAG, PDI interfaces. The high voltage programmer has saved me many times when I messed up the fuses.
Chips like the Tiny 88 give you more output pins with the SMD versions. I have a box of adapters to convert them to PDIPs so they fit the same jigs I built for the rest of my chips. I like headers for some apps but the trouble is that circuit designs can be limited. You have to watch what's attached to each pin, if you load a control pin you can interference with the programmer. For example, I kept having problems with mosfets off IO pins because the series resistor was too low. I fixed it with higher value resistors but sometimes I get a proto board back from my board house and I can't program the chip so unless I'm really pushed for space I use adapters and program with the isp II.
I have pins off my adapters now to run leads to my test setups, this way I can see if the programmer runs into trouble. (it also makes for quick programming without moving the chips after I program them)
Let the windows vs. linux flame wars begin. Get ready, set, go.
Arduino Bootloader and the MySmartUSB (and other USBASP based devices) are about as painless as it gets when it comes to AVR programming. I wonder why you didn't just install Atmels official driver?
If you plan on using atmel studio ever again download the 700MB offline installer
The red light will go green when you power the target device use usbtiny as programer : - ))
Most of the problem here BTW is Windows 8/10. They started demanding all drivers be signed - for an "open source" developer this is difficult and expensive. Exactly why I am sticking with Windows 7 on my PC.
This is another hurdle that using the Arduino toolset overcomes - they have sorted all of this out, and it is based on exactly the same stuff... so you can use them to program bare AVR chips just as well as the Arduino
Microsoft Visual studio took 4 hours to get installed in my computer. And it wasn't even working. So no surprises for Atmel Studio. I think visual studio is just too heavy and big, if you are not going to use at least half of it's features
Programming on windows is like that. You always end up in trouble with drivers. If you use AVR studio, you'll probably get caught by some problem in getting the programmer firmware updated. Studio is also absolutely huge to get for a small task like that.
With linux you usually just get a small program, need no drivers and it does the trick. Not that nice for programming or simulating though, I used to like AVR studio for developing but I programmed those with linux due to driver issues.
Those old AVR mk2 ISPs are super flaky, especially on Windows. The TinyISPs are my tool of choice.
Microchip abought Atmel?
No wonder AvrStudio is on the fritz.
The fail was using windows in the first place, with linux it would be done in 5 minutes ... except for the connector issue of course.
Using WinXP for COM-port programming of controllers is much more convenient.
when he saw the green light for the first time I checked the video length and laughed. hahaha this is not going to work
those programmers are a nightmare, i had flash back to my student days!
The AVRisp II does work well with Studio 7, you just have to get it figured out and set up. Yah, it's a pain.
Installing the libusb-win32 driver is basically an obsolete thing to do. Modern versions of libusb 1.0 work fine with Microsoft's built-in generic USB driver, WinUSB.
There is a GUI app for avrdude called avrduess (what else?).
winavr is no longer being developed, the compiler is now maintained by Atmel.
You probably need the windows drivers for the programmer from Atmel, they would have been installed with AVR studio (maybe).
And all of this stuff just works on Linux with no "DLL Hell" and no missing drivers (it's already in the bloody kernel!).
I thought the avrisp II WAS 3.3 volt compatible from the factory. In fact, I think I've used mine (unhacked) on a 3.3 volt circuit. Oh I've made a few 106 pin adapters on some scrap perf board since I run into this issue all the time! I also have the Adafruit USBmini programmer. It's not 3.3 volt compatible, but it does have BOTH 10 pin and 6 pin cables. (it also won't program 128k or 256k devices).
The atmel device does NOT apply power to the device (unless you hacked that). The Adafruit can (jumper selectable)
Don't be so negative ;-)
The 10pin header is the normal header nowadays. And the installation doesn't have to be so painful even on Windows ;-)
AVRDUDESS is a nice front end for avrdude and all supported programmers...
Hmm and they say Linux is complex: I did "sudo apt-get install avrdude" plugged it in ran the command and I was done.
3:45 typical moment in the life of a windows user
The 10 pin ISP vs 6 pin ISP sucks... Once you made an adapter going from one to the other its ok, but I can never find it when I need it :)
Real men solder wires straight to the other side of the board.
hey Dave couldn't you just use the Arduino ISP I thought that they supported that particular chip
You have to reboot before you can actually use the drivers.
He said "Interwebs".