Author Topic: FFS Why can't anybody make a decent AVR programmer  (Read 7756 times)

0 Members and 1 Guest are viewing this topic.

Online chris_leysonTopic starter

  • Super Contributor
  • ***
  • Posts: 1541
  • Country: wales
FFS Why can't anybody make a decent AVR programmer
« on: July 24, 2018, 12:06:10 am »
I've spent two hours of my life trying to program an ATtiny5 using an Olimex AVR-ISP-MK2 and Atmel studio 7.0.
AT7 sometimes says programmer not found, cheap construction techniques and connectors on the Olimex programmer or maybe or a Windows driver conflict, that's happenend before. AT7 seems to randomly fall over no matter what AVR parts I want to program. I get the "can't enter programming mode" message. FFS I've done the "join the dots" thing connecting up the programmer to the ATtiny5, it's not rocket science. So now I have use a scope and maybe a logic analyser to see if the programmer is even talking to the ATtiny5  :palm: How difficult can it be to transfer an ASCII HEX file just using three wires. Tried it at 3.3V and 5V, no difference. I should be debugging my software not 3rd party stuff. Rant over.
Any suggestions for a more robust ATtiny programming platform would be welcome, haven't tried using a UNO as a programmer, might give that a try.
« Last Edit: July 24, 2018, 12:14:18 am by chris_leyson »
 

Offline tsman

  • Frequent Contributor
  • **
  • Posts: 599
  • Country: gb
Re: FFS Why can't anybody make a decent AVR programmer
« Reply #1 on: July 24, 2018, 12:21:55 am »
I've got a Olimex AVR-ISP-MK2 as well and always found it to be weird. I've never had much luck with the other Olimex programming adapters either TBH. I stopped using the AVR-ISP-MK2 as it just gave me too many problems and got an AVR Dragon instead. The AVR Dragon has its own issues but it is a hell of a lot better than the AVR-ISP-MK2.
 


Offline HwAoRrDk

  • Super Contributor
  • ***
  • Posts: 1471
  • Country: gb
Re: FFS Why can't anybody make a decent AVR programmer
« Reply #3 on: July 24, 2018, 12:47:24 am »
I believe for the most part the problem is AS7. I have a clone AVR-ISP MkII and also sometimes have problems with it randomly not wanting to program a device. But simply quitting AS and restarting it - literally touching nothing else - will usually have things working again.
 

Online chris_leysonTopic starter

  • Super Contributor
  • ***
  • Posts: 1541
  • Country: wales
Re: FFS Why can't anybody make a decent AVR programmer
« Reply #4 on: July 24, 2018, 12:49:35 am »
@tsman, might give the AVR Dragon a shot, will have to do some research.
@ebclr Thanks, I might have to invest in something that actually works as specified in the programming documentation.
Looks like somebody has been taking shortcuts, the number of physical and software abstraction levels involved in writing a standard Intel HEX file to a processor is just getting ridiculous. I've calmed down a bit, rant over. I might try the Aurduino ISP route tomorrow as a quick fix, at least it's easy to reverse engineer. If I want to use Atmel Studio in the long term then I will probably have to go for Atmel Ice.
@HwAoRrDk, I've had to reboot AS7 several times to get the programming tools to work, it doesn't inspire confidence and it really slows down development when it takes longer to program a part than it does to do a few software tweaks.
@Westfw, not related to Attiny but Optiboot works just fine, works half duplex with AVRdude with a few hardware additions :-+
« Last Edit: July 24, 2018, 01:08:47 am by chris_leyson »
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11236
  • Country: us
    • Personal site
Re: FFS Why can't anybody make a decent AVR programmer
« Reply #5 on: July 24, 2018, 12:59:24 am »
This one  is decent
Why would you buy Atmel-ICE from AliExpress for $200, when it is $130 on the official Microchip store?

Link: http://www.microchip.com/developmenttools/ProductDetails/PartNo/ATATMEL-ICE
Alex
 
The following users thanked this post: hans, janoc

Offline ajb

  • Super Contributor
  • ***
  • Posts: 2599
  • Country: us
Re: FFS Why can't anybody make a decent AVR programmer
« Reply #6 on: July 24, 2018, 01:26:25 am »
The Dragon is pretty old at this point, and really only worthwhile if you want to do high voltage programming.  Otherwise an Atmel ICE is the way to go, especially if you want support for the latest devices.
 

Online chris_leysonTopic starter

  • Super Contributor
  • ***
  • Posts: 1541
  • Country: wales
Re: FFS Why can't anybody make a decent AVR programmer
« Reply #7 on: July 24, 2018, 01:31:14 am »
Thanks for the heads up Ataradov, $130 isn't so bad. I've picked AVR over PIC because of better documentation and the AVR peripheral hardware is more consistent between devices than PICs. Then there is bloatware... I'm programming the ATtiny old school in assembler because then I know exactly what's going on and I don't have to second guess a compiler that may or may not be properly documented.
Funny, just noticed that the Farnell description on the packaging says DFN-6 when it's really SOT23-6 or is that SOT26 ?
 

Online chris_leysonTopic starter

  • Super Contributor
  • ***
  • Posts: 1541
  • Country: wales
Re: FFS Why can't anybody make a decent AVR programmer
« Reply #8 on: July 24, 2018, 01:32:33 am »
Thanks, looks like Atmel ICE is the way to go  :-+
 

Online T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21657
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: FFS Why can't anybody make a decent AVR programmer
« Reply #9 on: July 24, 2018, 07:42:47 am »
Bloatware... but you're using AVR Studio 7...

Fucking 5 gig+ pile of shit!  I didn't even bother trying to install it...  :rant:

Right now, I use AVR-GCC (same thing what's inside AS), Code::Blocks (good general purpose IDE, has built-in support for GCC), and libusb0 + AVRDUDE for programming.  I have an authentic (...vintage?) AVRISPMKII, with more-or-less current firmware (supports ISP and PDI I guess, but not debug).

Should be, anything that AVRDUDE can talk to, will work just fine.  If the Olimex version doesn't, well, it's just not very good I guess... one then wonders what they intend you to use it with, in the first place? ???  Start with their instructions and tools, and start changing out parts until you get back to your present toolchain.  Something must be funny?

The original ISP, at least, is little more than a PDIUSBD12 (parallel USB interface), ATMEGA128, and a pile of support logic and transistors (signal conditioning, protection).  So, basically all the functionality / behavior is down to firmware.  Presumably, the same is true of the Olimex version (if maybe not with the same exact devices, I have no idea).

Not that that's much help if you can't program the programmer... :(

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline HB9EVI

  • Frequent Contributor
  • **
  • Posts: 722
  • Country: ch
Re: FFS Why can't anybody make a decent AVR programmer
« Reply #10 on: July 24, 2018, 08:04:52 am »
I never bothered buying one of those programmers from aliexpress & co. When I came to the avr family I built 2 USBasp which do a good job ever since.
 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 8167
  • Country: fi
Re: FFS Why can't anybody make a decent AVR programmer
« Reply #11 on: July 24, 2018, 08:49:28 am »
I always had problems in AVR Studio, Windows. General non-robustness, booting or replugging the devices required, random error messages...

With Linux & AVRDUDE, any programmer I have ever tried (original AVRISP II, pirate AVRISP II, several Ebay USBISP MK IIs, USBASP... anything), never any issue whatsoever, 100% robustness.

So I really think it's most likely
1) first and foremost, the classical "crappy USB driver" issue,
2) possibly an AVR Studio issue

Getting things (like printers...) work in Linux is often a lot more demanding than in Windows, but USB serial devices and MCU programmers/debuggers seem to be an exception to this rule. In Windows, it's always a pain in-the-ass with drivers, downloading custom "change COM port number" software, or outright unstable. In linux, these seem to "just work" (which is a funnily rare situation in linux IME).
 

Offline stj

  • Super Contributor
  • ***
  • Posts: 2155
  • Country: gb
Re: FFS Why can't anybody make a decent AVR programmer
« Reply #12 on: July 24, 2018, 12:49:51 pm »
yes, win and AS7 are both junk.

as7 even installs without basic checks first,
years ago i tried to install AS6 or 7 on a machine and it started installing, then tried to install visual studio framework,.
got maybe 50% of that installed, then declaired the system wasnt compatable with the visual studio version and left it partially bricked!!  |O

i have never and will never use any dev software on windows again!

as the last guy said, Linux, GCC, AVRdude.
and i use a generic USBasp to program and it has never let me down.
 

Offline HB9EVI

  • Frequent Contributor
  • **
  • Posts: 722
  • Country: ch
Re: FFS Why can't anybody make a decent AVR programmer
« Reply #13 on: July 24, 2018, 12:58:16 pm »
What choice do you actually have on win to work with the avrs. Wingcc is long time not maintained anymore, and I suppose Microchip will go to phase out the support AVR Studio as well, since their main interest seems to be for every price force the market adopting their commercial mplabx.

Personally I'd likely long time give it up working on mcu if I had to work on windows - not only the software side is a pain but also the ever repeating hardware issue - like the already mentioned usb-serial devs, which all just work out of the box on linux never mind if the chip is genuine or not
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11236
  • Country: us
    • Personal site
Re: FFS Why can't anybody make a decent AVR programmer
« Reply #14 on: July 24, 2018, 03:59:51 pm »
$130??? I paid $50 when I bought it. There was a $100 option (which is the now $130 version) that came with some adapter cables, and a $50 version with the pod and only one JTAG cable (10p+6P combo) plus a USB cord. I went with the latter.
Well, yes, it is $30 more now. But it is unfair to compare different versions of the old and new product. You can go cheaper. as cheap at $50 for a bare PCBA version.
Alex
 

Online T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21657
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: FFS Why can't anybody make a decent AVR programmer
« Reply #15 on: July 24, 2018, 04:59:11 pm »
What choice do you actually have on win to work with the avrs. Wingcc is long time not maintained anymore

I have GCC 8.1.0 installed. ???
http://blog.zakkemble.co.uk/avr-gcc-builds/

Quote
and I suppose Microchip will go to phase out the support AVR Studio as well, since their main interest seems to be for every price force the market adopting their commercial mplabx.

Good riddance anyway, last good version was AS4 or so.

Quote
Personally I'd likely long time give it up working on mcu if I had to work on windows - not only the software side is a pain but also the ever repeating hardware issue - like the already mentioned usb-serial devs, which all just work out of the box on linux never mind if the chip is genuine or not

You can use much the same drivers on Windows.  Like I mentioned earlier, libusb0 makes a generic IO driver, tailored to a given device.  No mucking around with COM ports. :)

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline HB9EVI

  • Frequent Contributor
  • **
  • Posts: 722
  • Country: ch
Re: FFS Why can't anybody make a decent AVR programmer
« Reply #16 on: July 24, 2018, 05:40:20 pm »
really nice, that somebody still offers a win version.

i actually never took the pain on me to try all those things on win; the only windows installation I have is on the notebook, and the last thing I used it for was trying to configure an old fashioned isdn pbx - without success since the old w2k piece of software doesn't want to run on win10
 

Offline VinzC

  • Regular Contributor
  • *
  • Posts: 227
  • Country: be
  • See you later, oscillator.
Re: FFS Why can't anybody make a decent AVR programmer
« Reply #17 on: July 24, 2018, 06:03:14 pm »
What choice do you actually have on win to work with the avrs.

Arduino anyone? The long path would be to install the Arduino IDE and hack it — it comes with a full-fledged avr-gcc distribution, which you can "derive" to compile for more AVR than just atmega328[p] ;). Other than that, there's always Winavr. FTR I tried it one or two years ago on an old [controlled] Win XP virtual machine that I run on my Linux laptop. Worked a treat.

EDIT: Follow Tim aka T3sl4co1l for an updated GCC suite for AVR on Windows.

I have GCC 8.1.0 installed. ???
http://blog.zakkemble.co.uk/avr-gcc-builds/

Wingcc is long time not maintained anymore

EDIT: After reading your post once again, I assume you're talking about win-avr, rather wingcc, which is a totally different project. Indeed win-avr on Sourceforge is dead. T3sl4co1l posted a link to an updated compiler suite.

WinGCC has been superseded by MinGW not so recently. It's still maintained and used. Code::Blocks uses it to build Windows applications, for instance. And if I'm not mistaken, it can also be used to compile native AVR applications — you're free to use any compiler after all and avr-gcc for Windows is one of them. It's just one, single example.

Personally I'd likely long time give it up working on mcu if I had to work on windows - not only the software side is a pain but also the ever repeating hardware issue - like the already mentioned usb-serial devs, which all just work out of the box on linux never mind if the chip is genuine or not

Well, that's not quite trolling indeed and I can relate to that.

As per my experience, I, too, never had issues with avr-gcc on any Linux machine I installed it on: Gentoo, Arch, Mint, Raspberry pi (comes pre-installed with Raspbian, by the way). Besides there are lots of choices for complete IDE on Linux, from Eclipse to KDevelop (Felix from The Ben Heck Show uses it for their Atmel projects), via Geany (the one I use).

The only issues I saw were from fellow programmers who were using Windows. As hinted: USB programmer suddenly stopped or stopped being detected (plugging it on a Linux machine showed the programmer was perfectly in order and working fine), random or spurious errors that require complete-uninstall-and-reinstall of the drivers... They never had an issue anymore once they switched to Linux.

This doesn't count as an absolute and definite proof "Linux is better than Windows" troll. Just the report of a one or two guys' experience. *You* judge.
« Last Edit: July 24, 2018, 06:20:09 pm by VinzC »
 

Offline HB9EVI

  • Frequent Contributor
  • **
  • Posts: 722
  • Country: ch
Re: FFS Why can't anybody make a decent AVR programmer
« Reply #18 on: July 24, 2018, 06:16:49 pm »
I plainly don't like the arduino ide. It might be nice for the start, but I like bare metal; if you have to rely on the basic arduino functions, you have to live with quite an overhead in the flash and a lack of speed; sure, the program works, but far away from being optimal.

I have no need to warm up that old story; I'm just sometimes wonder; the usb-serial chips are an evergreen in the ham forums; in the german ham forums you get at least once per day a new thread opened about non-working usb-serial chips, wrong com-port numbering, access problems to the serial ports by ham software a.s.o.
that's quite bizarre and seems to me totally half assed.
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11236
  • Country: us
    • Personal site
Re: FFS Why can't anybody make a decent AVR programmer
« Reply #19 on: July 24, 2018, 06:18:45 pm »
I plainly don't like the arduino ide.
You don't  have to use it. But you cat extract the working compiler from there and use it with whatever IDE you like.
Alex
 
The following users thanked this post: VinzC

Offline VinzC

  • Regular Contributor
  • *
  • Posts: 227
  • Country: be
  • See you later, oscillator.
Re: FFS Why can't anybody make a decent AVR programmer
« Reply #20 on: July 24, 2018, 06:28:16 pm »
[...] the usb-serial chips are an evergreen in the ham forums; in the german ham forums you get at least once per day a new thread opened about non-working usb-serial chips, wrong com-port numbering [...]

As Tim mentioned earlier, using the libusb library frees you from the spurious "COM" port errors as it uses native USB to talk to the programmer. You need the proper arguments to avrdude though. IIRC Dave showed in one video a while ago there was a specific argument to force avrdude to use the USB protocol instead of autodetection... which favours serial communications. I believe the argument is -P usb on Windows but don't quote me on that.
 

Offline senso

  • Frequent Contributor
  • **
  • Posts: 951
  • Country: pt
    • My AVR tutorials
Re: FFS Why can't anybody make a decent AVR programmer
« Reply #21 on: July 24, 2018, 06:57:07 pm »
Win10, with latest AtmelStudio, with a Dragon, never had a problem programming AVR/Atmel parts.

OMG 5GB for an IDE, SSD's are cheaper than RAM, and running any IDE from an HDD is asking for slowness, also my laptop uses DDR3L, so its still cheaper than DDR4, so I'm running 32GB of RAM and 512GB of SSD plus 1TB of 7200rpm HDD, I have zero problems running any IDE be it for AVR, the MPLab crap, VisualStudio for python and C# on Windows(for linux I just spin up one of the VM's), PSoC Creator also runs perfectly, fast and snappy.

I dont understand how so many people on tech forums have the most bugged out OS installs where everything runs like crap...
 

Offline stj

  • Super Contributor
  • ***
  • Posts: 2155
  • Country: gb
Re: FFS Why can't anybody make a decent AVR programmer
« Reply #22 on: July 24, 2018, 07:41:46 pm »
OMG 5GB for an IDE, SSD's are cheaper than RAM, and running any IDE from an HDD is asking for slowness, also my laptop uses DDR3L, so its still cheaper than DDR4, so I'm running 32GB of RAM and 512GB of SSD plus 1TB of 7200rpm HDD, I have zero problems running any IDE be it for AVR, the MPLab crap, VisualStudio for python and C# on Windows(for linux I just spin up one of the VM's), PSoC Creator also runs perfectly, fast and snappy.

your just making excuses for shitty bloated software.
why should i need 32gigs of ram and an i45 with 6TB SSD to run something that should be fine on a 32bit system with a gig of ram??
 

Offline HB9EVI

  • Frequent Contributor
  • **
  • Posts: 722
  • Country: ch
Re: FFS Why can't anybody make a decent AVR programmer
« Reply #23 on: July 24, 2018, 08:26:58 pm »
As Tim mentioned earlier, using the libusb library frees you from the spurious "COM" port errors as it uses native USB to talk to the programmer. You need the proper arguments to avrdude though. IIRC Dave showed in one video a while ago there was a specific argument to force avrdude to use the USB protocol instead of autodetection... which favours serial communications. I believe the argument is -P usb on Windows but don't quote me on that.

I don't even bother anymore to answer on those posts, since it's not really my domain; actually the biggest problem will be to explain those people how to use the way over the libusb; normally things already fail when a dialog box in english pops up; it's pretty hopeless
 

Online T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21657
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: FFS Why can't anybody make a decent AVR programmer
« Reply #24 on: July 24, 2018, 08:38:00 pm »
It's not unreasonable to have an IDE that requires capabilities similar to its target.

Visual Studio on a PC, compiling x86 and x64 and god knows what other extensions you're targeting (or the whole ARM ecosystem just as well), working within a bazillion frameworks, languages* and dialects, doing graphical interfaces, doing internal and inter-process and inter-network message passing, building APIs and frameworks from the ground up yourself (not just using those others have made), the list goes on.

*Okay, I don't know if VS does languages other than C/C++/C#.  I'm guessing there may be a few blobs of other languages spread about Windows and other M$ products.  I'd further guess they use VS all the same, though maybe with plugins to better support other languages (or custom scripts or..), rather than out-of-the-box functionality.  No idea, I don't work at M$...

I can excuse something that has to do all those things, and takes up a few gigs.  While the average user isn't going to even begin to scratch the surface of the true power, the wide breadth of features available (and, inevitably, the painful obscurity of the bugs in all of them), I can accept that, okay, it's made for the worst case, tallest enterprise, expert coders, while still having nice enough features that the ordinary coder isn't overwhelmed.

I can accept that.

But five gigs for an 8-bit micro?  There can't possibly be anything that needs that much information, data, code, to support something so simple.  That's practically enough data to map out every possible state of the platform and write provably-complete programs with (heh, given that the time required to evaluate those proofs may not exist in this universe).  Even including XMEGA, AVR32 and ARM, all the combinations and types of peripherals, all the extensions and variants, all the descriptors for those should total a couple of megs.  GCC knows most of these things (that is, only to the level it needs, not to some imaginary extreme case) and does it all in a few dozen megs.

The sheer fact that you're running a graphical IDE, with rich features, code inspection tools, all the usual nice things, I can accept that that takes a few hundred megs (of storage or RAM, usually both).  That's true regardless of target platform.  When you want that level of richness of capability, and structuring, there's a price to be paid.  Likely it's not actually that high (did anyone make a modern-featured IDE back in the 90s, say, running in DOS/Win/*nix, that took up only a couple megs?), but most of what you're paying, at that point, is dealing with the OS you're running on (which often takes a few megs just to get started with anything at all), and providing pleasing graphics (which can consume a hundred megs easily, for high res, low compression graphics).

Basically, you're paying for the convenience of coding on your personal supercomputer.  Being a supercomputer, it takes a lot of code to do much of anything, no matter how simple it is; and for not much more work, we can use a rich system that makes our job easier, whether writing for such simple platforms as AVR, or otherwise.

I can accept that.

But driving a simple platform from an enterprise-grade system?

That just don't make no fuckin' sense.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf