PIC ATMEL ARM IDE (Compiler+Editor+Programmer)... - Page 1
Forum section: electronics / general

author: astra
author_rank: Contributor
timestamp: March 01, 2014, 11:29:55 pm
content: Hi,i'm sorry if i'm asking something that's already has been answered..I try to find with the search button in the forum but i could not find the answer..So that's the question...I’m an old EE but I’m new in the MicroController field… In this period I’ve try to learn some about the microcontroller because i like to build some project using Microcontrollers.I’m not so sure which Brand to choose..The parameters I need to respect are different...but in this moment the most important is the price because of the limited budget..So I try to understand what are the prices of the necessary tools (IDE, Editor, Compiler, Programmer…) of the different Brand's solutions that are offered.I try to understand something reading through the internet and i try to syntetize what I’ve understood:PIC :Editor :MPLab X IDE v2.05Price : FreeCompiler :MPLab XC 8 / 16 /32Price 8 Bit Standard HPA WorkStation: 73,33 €Price 8Bit Standard WorkStation:363,01 €Price 16 Bit Standard WorkStation: 363,01 €Price 32Bit limited: 0,00 €Programmer :[url=http://www.microchipdirect.com/ProductSearch.aspx?Keywords=PG164130]http://www.microchipdirect.com/ProductSearch.aspx?Keywords=PG164130Price : 32,96 €ATMEL:Editor :Atmel Studio 6.2 beta InstallerPrice : FreeCompiler :Atmel Studio 6.2 beta InstallerPrice : FreeProgrammer :AVRISP mkIIPrice :34 US$ARM :Editor :Eclipse ds5 community editionPrice : freeCompiler :Eclipse ds5 community editionPrice : FreeProgrammer :Ulink2Price :316,00€I do not put in this list other manufacturer (as Texas Instruments..only to try to focus on the major competitor in the market) and I do not watch the Microcontroller products…I like to have your opinion about the list above..have I right understood the situation..?I’d like to choose the way and in order to make the right choice I’d like to understand what I’m buying..For example is it true that PIC do not offer any free compiler for the 8bit and the 16bit Microcontroller..?Only the 32Bit limited (in optimization) version is free..?Thank you for the time you dedicate in helping me take the right choice..Astra.

author: dannyf
author_rank: Super Contributor
timestamp: March 02, 2014, 12:12:02 am
content: 8-bit low cost options:1) PIC: inexpensive but outdated chip, free but limited compilers, $50 programmer.2) AVR: inexpensive chip, free and unlimited compiler (gcc-avr + code block), <$10 programmer.3) STM8: inexpensive chip, free but limited compiler, hardware debugger.16/32-bit chip:1) PIC24: reasonably priced chip, free but limited compilers (C30/X16 + emBlocks), $50 programmer.2) STM32: inexpensive chip, free and unlimited compiler (gcc-arm + CoIDE), $10 programmer / hardware debugger.3) TI launchpad: inexpensive and somewhat quirky chip, free and unlimited compiler (gcc + eclipse), $10 - 20 programmer / hardware debugger.8-bit chips are fairly easy to learn and are reasonably capable - I would pick the avr there. 32-bit chips have a much steeper learning curve / complexity and may not be for everyone - my pick there would be STM32 for its value.

author: westfw
author_rank: Super Contributor
timestamp: March 02, 2014, 07:21:28 am
content: Microchip PIC has free "limited" versions of 8 and 16bit compilers as well as the 32bit.The AVRISP programmer you mention does programming only, but not debugging. (the PICKit3 and Ulink3 do both.) There are AVRISP clones that are MUCH cheaper than the official Atmel version.ARM doesn't sell chips, so you have to pick a vendor. TI, NXP, ST, Freescale, and probably others, are all selling very inexpensive (< $20) evaluation boards that include debugging and programming. The ULink is a very generic (and widely supported) but also very expensive tool for ARMs.IMO, it would be foolish not to consider Arduino variants. About $30 will get you AVR, ARM, or PIC32 versions with a fine compiler and bootloader, and a simple IDE, ready to plug into your choice of development system and start writing code.This MOOC on embedded systems is going pretty well. They're using a TI ARM board:https://courses.edx.org/courses/UTAustinX/UT.6.01x/1T2014/info

author: JoeN
author_rank: Frequent Contributor
timestamp: March 02, 2014, 08:33:07 am
content: J-Link EDU is a very capable programmer for ARM if you are going to be doing non-commercial hobbyist projects:http://www.segger.com/j-link-edu.htmlhttp://www.digikey.com/product-search/en?lang=en&site=us&KeyWords=J-Link+EDUIt works well with both Atmel Studio (free and unlimited for Atmel ARM chips) and Keil (limited, but supports basically every ARM chip up to limits).For about $70 all in you should be able to start working with ARM if you can convince Atmel to send you a few samples and make your own board.

author: Psi
author_rank: Super Contributor
timestamp: March 02, 2014, 08:57:02 am
content: Quote from: astra on March 01, 2014, 11:29:55 pmPersonally i recommend spending $30 on a proper AVR programmer..But the absolute cheapest option doesn't even need that...Find an old computer that has a printer port (LPT) and runs either windows 98, windows 2000 or windows XP.(XP64/vista/win7/win8 are a bit more tricky because they don't let programs access the printer port directly, so an old PC is best)Cost = freeBuy an ATtiny or ATmega MCU IC in DIP package - Cost $3Buy a breadboard - Cost $5(You could also use veroboard/DIP sockets etc.. but breadboard is easier to play with and change your circuit)Buy/find a DB-25 connector that will plug into your printer port - Cost $4Wire up the printer port to the breadboard/MCU so you connect the 5 pins as shown here..(The resistors in the picture can be left out if you're super cheap. Otherwise use 470R)Keep the cable length less than 1.5Meters between the breadboard and printer port.Now all you need is a 5V power from somewhere to run the chip. You can cut up a USB cable and use the red and black wires for super cheap 5V source.Now your MCU has power and programming pin connectedYou can write code in AVRstudio and upload it to the chip using AVRdude.You may want to write a simple batch file to copy the output hex file from avrstudio to a different location and run the avrdude command to upload it to the chip. You can even setup avrstudio to automatically run avrdude and upload your code when you hit compile.The important commandline options for avrdude are.-c bsd (sets the programmer type your using)-p m64 (tells avrdude your programming a ATmega64, change this as needed)-E noreset (tells avrdude to pull the reset line high after programming so the chip starts running)-e (erase the chip before programming)-U flash:w:mycode.hex (upload the mycode.hex file to the mcu in flash memory)eg.. avrdude -c bsd -p m64 -E noreset -e -U flash:w:mycode.hex

author: jaromir
author_rank: Unknown
timestamp: March 02, 2014, 09:22:45 am
content: You don't need to spend hundreds of bucks on C compiler from Microchip. I do all my spare time projects (http://jaromir.xf.cz/) with free versions from Microchip website.It is not limited in size of generated code and together with MPLAB(X) it gives me development platform much better suited for my needs than Atmel Studio (windows only) or Eclipse+ARM GCC (pain in the ass to set it up and actually use).

author: JoeN
author_rank: Frequent Contributor
timestamp: March 02, 2014, 09:35:59 am
content: Yeah, "Windows Only" is such a huge show-stopping pain in the ass. Only maybe 95% of the people out there have access to that platform.

author: jaromir
author_rank: Unknown
timestamp: March 02, 2014, 09:48:44 am
content: JoeN: please, reread it again.I wrote about my needs, not about "95% of the people", whatever that means.

author: JoeN
author_rank: Frequent Contributor
timestamp: March 02, 2014, 09:56:10 am
content: Quote from: jaromir on March 02, 2014, 09:48:44 amThis thread was never about your needs, it was about Astra's needs. But thanks for your input.

author: jaromir
author_rank: Unknown
timestamp: March 02, 2014, 10:31:19 am
content: JoeN: If this thread is about Astra's needs, what is the point of your posts here? I wrote about my experience with particular compilers, trying to help him. Your only input here are two useless postsBack to the topic: Astra can also consider LPCXpresso, based around NXP ARM micros. For me it works out of the box, comes with unlimited compiler (ARM-GCC in fact), but limited (256kB) debugger. The limit is quite high (compare with 32kB IAR) and applies only to debugger, so you can build binary of any size.It is still Eclipse based, however.ST Micro offers variety of boards with integrated st-link (all the Discovery boards and new Nucleo), working as programmer/debugger, so one doesn't need to buy J-link

author: bxs
author_rank: Regular Contributor
timestamp: March 02, 2014, 04:54:30 pm
content: Let's start, first just keep in mind that good and trouble free tools don't exist## Tools from manufacturers:- Microchip:Go with MplabX(free) as IDE based in Netbeans, XC 8,16,32,32++ as compilers, note that all compilers can be used for free, the catch is only in the level of optimizations.For 8bit the XC8(Hi-Tech PICC+PICC18) in free mode is quite bad, really bad, only use it if you buy a PIC with a good amount of memory and performance is not important, also is only a C compilerbut it's normal at least for more basic 8bit (10F, 12F, 16F) it's almost a miracle that they have a C compiler since their architecture is quite basic and limited.For 16bit go with XC16(GCC), it's a nice compiler even with the limited optimizations, also the 16bit PICs are nice, the bad is that it's only a C compiler.For 32bit go with XC32(GCC MIPS), again it's a nice compiler even with the limited optimizations, and also have C++. Keep some things in mid, all the world went with ARM for 32bit but Microchip had to be different, they with with MPIS for PIC32, also keep in mid that C and C++ uses completely different libs...To program/debug the cheap solution is Pickit 3, but PIC32 with pickit 3 can be painful for that I recommend the ICD3.Please never choose a PIC for a important project without reading their errata, many PICs are quite buggyWith Microchip tools you can go Windows, Linux and MAC- Atmel:Their IDE (free) is based in Visual studio so it's a nice IDE, also the compilers(GCC) are free and you get C and C++To program/debug you can find clones of Atmel tools quite cheapWith Atmel tools you can only use Windows (The IDE only support windows)-TI:Their IDE (free) CCS is based in Eclipse, the compilers(made by TI) are also free and have C/C++, the catch is in the debug code size limits, for example 16KB for MSP430(16bit) but for ARM(32bit), for example if you use it with a Tica C Launchpad it don't have any limitsThe future CCS v6 will have also the option to use the GCC compilers for MSP430 and ARM, also note that MSP430 with GCC don't have debug code size limit(for now exist a beta version for download)The msp430 are fine, but ARM chip are quite buggy.With TI you can find cheap clones to program/debug, but the for start simple get some Launchpads, they will do the job.With Ti tools you can go Windows and Linux, no MAC- NXP:Their IDE (free) LPCXpresso is based on Eclipse, the compiler (GCC) (free) do C/C++, the limit will be for debug, a 256K code size limit, note that 256K is a lotThe NXP chips are fine and cheap.The NXP have several cheap boards that also have a programmer/debugger.With NXP tools you can go Windows, Linux and MAC- STWith ST you Will not have any software tool at allST chips are nice and cheap.The ST have several cheap boards that also have a programmer/debugger.## Tools from other sources:Almost all they are well supported, many times will be Eclipse with some plugins for the IDE people and GCC as the compiler.Many people will simple use a makefile with their Editor of choice.Also, these tools will do fine in Windows, Linux and MACIn my opinion the chips with worse support are the Microchip ones, the support exist, but can't be compared with the others.

author: jaromir
author_rank: Unknown
timestamp: March 02, 2014, 09:04:30 pm
content: BXS: great overview!By the way, XC8 compiler optimizations went much better since 1.2 version. After all, it generates about half the size code compared to SDCC.For STM32 one can use CoIDE (just forget the RTOS stuff, or use it) or EmBlocks. Both run only under windows and are a not as straightforward to use as dedicated IDE from silicon vendor.TI MSP430 program/debug doesn't work under Linux with CCShttp://e2e.ti.com/support/development_tools/code_composer_studio/f/81/t/171173.aspxthough IDE itself runs fine.

author: dannyf
author_rank: Super Contributor
timestamp: March 02, 2014, 09:08:42 pm
content: -XC8 compiler optimizations went much better since 1.2 version-2nd that. I just did some benchmarking. Xc8, in free mode, produced faster code than picc18 pro. Not bad.

author: bxs
author_rank: Regular Contributor
timestamp: March 02, 2014, 09:24:58 pm
content: Quote from: jaromir on March 02, 2014, 09:04:30 pmEverything Vs SDCC will probably win, thats contributed to me saying:Quote from: bxs on March 02, 2014, 04:54:30 pmAbout XC8 v1.2, I made some tests with it Vs C18 in free mode, C18 won almost every project that I tested so you may have different experiences but at least for now I continue to see the XC8 in free as a weak compiler in free mode.About CCS and MSP430 debug in Linux, it just don't work with Launchpad MSP430G2 stuff, look at:http://processors.wiki.ti.com/index.php/Linux_Host_SupportEDIT:For example, if you look at some udev rules that CCS uses in Linux "61-msp430uif.rules" you can see what is supported for MSP430Code:#TI MSP430UIFATTRS{idVendor}=="2047",ATTRS{idProduct}=="0010",MODE="0666"ATTRS{idVendor}=="2047",ATTRS{idProduct}=="0013",MODE="0666"ATTRS{idVendor}=="2047",ATTRS{idProduct}=="0203",MODE="0666"Your link talks about rf2500 (0451:f432 Texas Instruments, Inc. eZ430 Development Tool) of first Launchpads that TI simple ignored in Linux...Edit2:The launchpad msp430f5529 is also said to work with linux since CCS 5.4, but I don't have one to test.About Launchpad stellaris/Tiva C they work in Linux, in CCS6 is out of the box, in CCS5.5 you have to manually replace a lib but it works.

author: zapta
author_rank: Super Contributor
timestamp: March 03, 2014, 04:14:04 am
content: Quote from: JoeN on March 02, 2014, 09:35:59 amaccess != preferred platform.

author: astra
author_rank: Contributor
timestamp: March 03, 2014, 11:53:50 pm
content: Thank you all for the time you dedicate in helping me.I think i'll go to choose a STMicroElectronics 32Bit platform.I see a large number of nice Discovery Board for many 32bit family,from theF0to the latest and more powerfulF4model..I'd like to do some analysis more on wich one to pick reading the specification of this boards.I agree with your opinion that in this moment the 32Bit ARM family is a good choice.I notice also that there is a really big difference in price for the STM32F429I-DISCOVERY betweenthe UK price of16,64 £and the European price of27,45 €....I was used to see a strange relationship between € and US$ but such a big difference between te official exchange rate and this particular one between £ and € it's sound annoyng...thank you again to all the guys who try to help me.astra.]

author: dannyf
author_rank: Super Contributor
timestamp: March 04, 2014, 12:27:35 am
content: The F0s are really for 8-bit replacement - they are slightly simpler and smaller;The F1s are fairly typical for a 32-bit chip. More powerful and represent a good starting point;The F3s have more peripherals and good for mixed signal or RC stuff;The F4s are for computational intensive jobs;The L1s are for low power consumption. The L152 in particular is a nice all-in-a-box board, with its lcd display.QuoteYes, if you have prior experience and are familiar with C and mcus. Otherwise, you will find the learning curve quite steep.

author: westfw
author_rank: Super Contributor
timestamp: March 04, 2014, 03:52:51 am
content: Quotehuh? That looks within 10% of what an exchange calculator says it should be.(now, I hear that it's pretty common for US items to (apparently) get UK pricing from converting from dollars to pounds without changing the actual number. But that's not how it should be, is it? And ST is not a US company.)

author: astra
author_rank: Contributor
timestamp: March 04, 2014, 02:37:02 pm
content: Quote from: westfw on March 04, 2014, 03:52:51 amMay be i'm wrong or i have not understood what you wrote, so please be patience with me...but according tothis siteit seems that 16,29 British Pound are roughly 19,77 €.So the difference between 19,77 € and 27,45 € is 7,68 € that in respect to 19,77 is roughly the 38,8% (not the 10%).Astra.

author: astra
author_rank: Contributor
timestamp: March 04, 2014, 03:53:01 pm
content: @dennyfthank you very much for you help and your useful information about STM Family.Now i can decide with more accurate information..About C.. i've read some books about this language in the past months.I'm more familiar with other languages... (RPG..Fortran..Basic..) but i could alsotry with Assembler..When i was 19 roughly 30 years ago i wrote some programs for mySharp PC 1500in Basic...but it took 3 second to calculate one information..So i decided to learn the assembler for this little calculator..and the difference wasincredible ... in 3 second it calculate 300 information...May be i'll try again..Astra.

author: dannyf
author_rank: Super Contributor
timestamp: March 04, 2014, 05:36:45 pm
content: On Basic, I think it will be a waste of your time.On assembler, unless you will do just extremely simple or extremely complex stuff AND you have lots of resources at your disposal, it too is a waste of your time on those chips.

author: granz
author_rank: Regular Contributor
timestamp: March 04, 2014, 06:42:09 pm
content: Quote from: astra on March 03, 2014, 11:53:50 pmMy experience about a year or so ago with one of the STM32 discovery boards was not good. On these (at least when I played with one) they incorporate their USB programmer on the board, and it was complete garbage, including horrible "engrish" programming software. That on top of the annoying tool-chain setup and I actually decided not to use an STM32 for the project I was working on because of how annoyed I was with the board. If you are certain you want to start out in the ARM world, the Atmel AT91SAMxxxx devices are nicer because you can use the much friendlier Atmel Studio.You could try something like this:http://www.digikey.com/product-detail/en/ATSAM4S-XPLD/ATSAM4S-XPLD-ND/3481162I use PIC32's quite a bit also, and they are also quite nice (but are a MIPS core, not ARM).Like others have mentioned, getting started with an 8-bit mcu might be a better idea. There is just so much more to learn with the higher-end devices.Since you'll likely be working in C/C++, I highly recommend that you get started learning the language first not on a microcontroller. Linux is a great environment to start in, because you can basically compile code with gcc from any ANSI C book and have it work, without the Windows-specific stuff. If you don't want to learn your way around Linux, I've taught some people C using Dev-C++, which is a free minimalistic IDE for windows (uses gcc underneath).On another note, if you're new to C, I wouldn't complicate it with C++. C++ really isn't a necessary complication until you are working on large projects (especially with multiple developers). Most microcontroller projects just don't need the higher-level of abstraction. Plain C is closer to the hardware.Good luck!

author: dannyf
author_rank: Super Contributor
timestamp: March 04, 2014, 06:56:16 pm
content: QuoteIn what sense?QuoteIt is done fully transparent to the user. so what programming software are you talking about?

author: granz
author_rank: Regular Contributor
timestamp: March 04, 2014, 07:19:33 pm
content: Quote from: dannyf on March 04, 2014, 06:56:16 pmI was referring to the stand-alone programmer software. This was a year or two ago also, and I was using the CodeSourcery build environment. What IDE do you use/have you found nice? I'd be willing to give the STM32 series another chance (I already have a custom dev board and a programmer).

author: dannyf
author_rank: Super Contributor
timestamp: March 04, 2014, 07:41:26 pm
content: IAR and Keil are both very good. IAR's user interface is more minimalist and to my liking.Of the free ones, CoIDE does an excellent job supporting STM chips. Pretty much all existing STM32F chips are supported and many on real time basis. The project wizard is top notch (far better than IAR's and Keil's for example), and there is no code size or time limits. It also supports stlink and other manufacturers' chips.However, its support for jlink is non-existent - segger's fault.

author: granz
author_rank: Regular Contributor
timestamp: March 04, 2014, 07:46:05 pm
content: Quote from: dannyf on March 04, 2014, 07:41:26 pmRight, we didn't want to purchase IAR or Keil stuff. Looks like CoIDE is fairly new? This is the first I've heard of it. Thanks for the mention--I'll have to give it a try, I already have the hardware so it's a no-brainer.

author: os40la
author_rank: Regular Contributor
timestamp: March 04, 2014, 07:58:46 pm
content: Quote from: granz on March 04, 2014, 06:42:09 pmI thought PICs are based on a modified Harvard RISC instruction?Just to add to the confusion... ARM = Acorn RISC Machine.

author: granz
author_rank: Regular Contributor
timestamp: March 04, 2014, 08:15:26 pm
content: Quote from: os40la on March 04, 2014, 07:58:46 pmRight. MIPS is a RISC architecture as well. ARM is a type of RISC, but ARM is not the only RISC.Alpha, SPARC are other examples, and there are many more. Just like ARM, there have been several versions of the MIPS instruction-set as well, just to add to the confusion.MIPS is actually older than ARM, and was created by the pioneer of RISC architecture.

author: astra
author_rank: Contributor
timestamp: March 04, 2014, 10:34:18 pm
content: Quote from: dannyf on March 04, 2014, 05:36:45 pmYou are right..I'll try with C...Astra.

author: Kremmen
author_rank: Super Contributor
timestamp: March 05, 2014, 11:20:58 am
content: Quote from: dannyf on March 04, 2014, 05:36:45 pmWhile i fully agree, let me just pick one nit: "extremely complex" would by definition be an anti-candidate for assembly. I think you rather mean extremely low-level stuff where you need detail level control of specific hardware beyond what an higher level language can provide.Even in that case one should encapsulate such functionality inside a library an use it from there.