Affordable Microcontroller and Programmer - Page 1
Forum section: electronics / beginners

author: ceamiclover
author_rank: Contributor
timestamp: October 09, 2014, 01:49:49 pm
content: I am looking for cheap, programmable micro-controllers and a programmer to embed in simple hobby circuits. Examples motion-triggered light, etc.pic10f200 are less than a dollar.PICkit3 PIC KIT3 debugger is on ebay for $27Are these reasonable for simple projects and learning?

author: Scrts
author_rank: Frequent Contributor
timestamp: October 09, 2014, 02:12:50 pm
content: You should really look at ARM options. E.g. STM32 Discovery boards, which have the debugger on-board already.

author: Sebastian
author_rank: Regular Contributor
timestamp: October 09, 2014, 03:22:59 pm
content: Take a look at TIs Tiva C series. They have a very inexpensive evaluation board with on-board debugger. (http://www.ti.com/tool/ek-tm4c123gxl)Their IDE CCS6 and compiler are free with unlimited code size as long as you are using the lowest end debugger (XDS-100).Those MCUs are ARM Cortex-M4 based and come in many different versions with peripherals like USB, CAN, ADC, PWM, ...

author: Unknown
author_rank: Unknown
timestamp: October 09, 2014, 03:40:33 pm
content: In my opinion you can't go wrong with the microchip parts for hobby use.With the same programmer/debugger and IDE you have a big range of chips, from the dirty cheap PIC10 to the PIC32 and most of them are avaible in DIP package that is great for hobby use.You should buy the original pickit3, on mouser is "only" 50 bucks.

author: zapta
author_rank: Super Contributor
timestamp: October 09, 2014, 03:45:33 pm
content: Arduino pro mini, $2.50 shippedhttp://www.ebay.com/itm/New-Pro-Mini-atmega328-5V-16M-Replace-ATmega128-for-Arduino-Compatible-Nano-/131261720809?pt=LH_DefaultDomain_0&hash=item1e8fcee8e9You will need a USB/Serial adapter like the one below and the free Arduino IDE. It gives you a 16Mhz 32k FLASH MCU, a word c/c++ compiler and tons of libraries and people that will help you along the way.http://www.ebay.com/itm/FTDI-BASIC-BREAKOUT-5V-USB-TO-TTL-6-PIN-MODULE-FOR-MWC-MULTIWII-LITE-SE-EM-01-/310938444698?pt=Radio_Control_Parts_Accessories&hash=item486560239a

author: Seekonk
author_rank: Super Contributor
timestamp: October 09, 2014, 04:20:07 pm
content: I have a stack of knock off UNO's that I've picked up for $8-10. All you need is a laptop with a USB port and to download the FREE development system. You can't get cheaper than that. Easy to use and quite powerful. I've used the serial port to drive opto-22 magic type cards for more outputs. Micro controllers are like children, everyones different but they are all the same. That's my pick.

author: suicidaleggroll
author_rank: Super Contributor
timestamp: October 09, 2014, 04:54:46 pm
content: TI's launchpads are pretty good for this. I'm a fan of the MSP-EXP430G2For $10 you get a programmer, debugger, and two DIP MCUs (MSP430G2553andMSP430G2452). You can use the programmer to flash DIPs, or you can air-wire the test, reset, and ground lines to a 3-pin header on a PCB and flash nearly any MSP430G series MCU that is made, in any package. It comes with the USB cable, all you need to do is download the free (restricted) version of CCS or IAR, or use the free Linux mspgcc toolchain to build/flash/debug.

author: Flenser
author_rank: Regular Contributor
timestamp: October 10, 2014, 12:58:46 am
content: +1 for either Microchip/PIC or Atmel/AVRThere is an active forum for Atmel/AVR at avrfreaks.net where you can get help. You have the option of using Arduino boards and IDE, if you would like to. You can get a USBASP programmer on ebay for $2.50 to program the chips that use the ISP protocol (attiny and atmega chips only I think)http://www.ebay.com.au/itm/New-1pc-USB-ISP-Programmer-For-ATMEL-AVR-ATMega-ATTiny-51-Development-Board-/400596661681?pt=AU_B_I_Electrical_Test_Equipment&hash=item5d456bf5b1. You can also load a sketch into an Arduino board to program raw chips using ISP.Microchip/PIC seem to have a wider range of chips and chips that are cheaper than Atmel. Their entry level PICKIT programmer/debugger is cheaper than the Atmel entry level programmer/debugger, the Dragon. Microchip to produce a couple of boards in the Arduino format so that you can take advantage of the Arduino shields. Not sure about the IDE for these.

author: Scrts
author_rank: Frequent Contributor
timestamp: October 10, 2014, 08:25:20 am
content: Forget that AVR stuff. Real developer needs adebugger. Go step by step in the source code and check the register values instead of doing bunch of prints to the console or even worse - play the try&fail game.

author: miguelvp
author_rank: Super Contributor
timestamp: October 10, 2014, 08:38:15 am
content: Quote from: Scrts on October 10, 2014, 08:25:20 amTrue, even if in the old days we used a couple of LEDs to do different blinking patterns to let us know what was going on.What a PITA that was.

author: 22swg
author_rank: Frequent Contributor
timestamp: October 10, 2014, 02:04:07 pm
content: I found the MicroChip DM240013-2 part a good starting place for getting into C mcu and debug etc. Its 5v ( there is 3v version) includes a PIC24FV16KM202 and is upgradeable and it plugs into a standard bread board, no xtals or psu (USB powered) truly plug and play... connects to MPLABX ( win7 ) no problems. and reasonable cost.

author: os40la
author_rank: Regular Contributor
timestamp: October 10, 2014, 03:42:34 pm
content: Quote from: Flenser on October 10, 2014, 12:58:46 am+2 for MicrochipI have ordered some 32 bit PIC's. (PIC32MX250F128B) 28 pin dip's. They are easy to work with. You can even dab into the Arduino world with this chip by downloading an IDE from chipkit and loading a boot rom. The IDE looks and functions just like the Adruino IDE. I was very impressed on how close it was. You can pratically copy and paste your code between the two IDE's.I still perfer the Microchip IDE. Debugging is much easier. With this chip you can have both worlds that can be breadboarded.For a test I have done this on a 2013 Macbook Pro (running VMWARE with WIN7), pickit3 and a breadboard. The IDE's are available for both Windows and OSX. I have run both IDE's on a MAC and in Windows on the mac. The pickit3 programmer works on the MAC and in a VM on the MAC.

author: tylernt
author_rank: Newbie
timestamp: October 10, 2014, 07:16:16 pm
content: Quote from: Scrts on October 10, 2014, 08:25:20 amAtmel sells an AVR Dragon that can be used to debug ATmega/ATtiny AVRs.

author: Flanbix
author_rank: Contributor
timestamp: October 10, 2014, 07:51:00 pm
content: There is the Nucelo boards from ST which include a built-in programmer/debugger.Arduino like footprint and not expensive at all.

author: ceamiclover
author_rank: Contributor
timestamp: October 12, 2014, 01:10:58 pm
content: Quote from: zapta on October 09, 2014, 03:45:33 pmI have used arduino some and am otherwise very green at programming, so the $2.50 mini arduino is appealing. However, the programmer in that post was $100.Will the $3 programmer be ok?http://www.ebay.com.au/itm/New-1pc-USB-ISP-Programmer-For-ATMEL-AVR-ATMega-ATTiny-51-Development-Board-/400596661681?pt=AU_B_I_Electrical_Test_Equipment&hash=item5d456bf5b1I don't expect to do anything particularly sensitive or complicated any time soon. I also like the idea of having all of the arduino examples already available.

author: Flenser
author_rank: Regular Contributor
timestamp: October 16, 2014, 01:34:17 pm
content: I don't own one of these boards but I think that you should be OK.Your link is a Funduino Pro Mini. This sitehttp://arduino-board.com/boards/funduino-pro-minidescribes the Funduino Pro Mini as a copy of the Arduino Pro Mini. The Arduino Pro Mini schematichttp://arduino.cc/en/uploads/Main/Arduino-Pro-Mini-schematic.pdfshows that the pins marked 9, 10 and 11 are SCK, MISO and MOSI so you will be able to program it using the ISP programmer.

author: ceamiclover
author_rank: Contributor
timestamp: October 16, 2014, 01:47:46 pm
content: Good. Thank you. I ordered 2 of them from China, so they will get here in 1-100 business days.

author: macboy
author_rank: Super Contributor
timestamp: October 16, 2014, 05:48:51 pm
content: If you get something like this one:http://www.ebay.com/itm/usb-nano-v3-0-atmega328-16m-5v-micro-controller-ch340g-board-for-arduino/311064700128?hash=item486ce6a4e0(only as example) then you can use USB to download your sketches to the micro without needing any additional programmer; it uses the standard Arduino bootloader. It also has pads for an ICSP header.

author: mazurov
author_rank: Frequent Contributor
timestamp: October 16, 2014, 07:38:30 pm
content: Quote from: Scrts on October 10, 2014, 08:25:20 amDefine "real". I (as well as main contributors) wrote this in Arduino IDE ->https://github.com/felis/USB_Host_Shield_2.0, using mainly prints for debug. I have an AVR Dragon which provides step debugging but c++ code gets so mangled by the compiler that this feature has very little value, at least for ppl fitting my definition of "real developers". I've been coding for about 40 years and today I mostly need direct register access when I'm discussing an undocumented bug in some PIC peripheral with their support; for all other cases of developing for micros making less mistakes is the best approach since finding them afterward will be difficult, with or without a debugger. In my experience, this is especially true for real-time stuff which you simply can't stop. So no, real developers don't "need" a debugger - it's nice to have one for the platform but a lot can still be done without it, if you are a good coder.AVR, which comes with bootloader and therefore won't require a programmer is very good for newbies; most of them lose interest soon after encountering their first missing semicolon. If a newbie wants to continue, an AVR debugger is not out of reach either. On the other hand, unless you're willing to deal with gdb ARM development becomes very expensive as soon as one grows out of demo boards.One bad thing about Atmel is that they don't have any good parts except entry level 8-bitters so there is nowhere to grow. PICs are much better in this respect, their 16-bitters are very nice micros and from what I see Microchip actively develops this line.

author: diyaudio
author_rank: Frequent Contributor
timestamp: October 16, 2014, 07:58:02 pm
content: +1Nucelo boards from ST, Discovery boards

author: ceamiclover
author_rank: Contributor
timestamp: January 29, 2015, 05:11:42 pm
content: Quote from: Flenser on October 16, 2014, 01:34:17 pmI have spent a decent amount of time trying to get this to work without results.Does anyone have a link to a decent tutorial on how to use the USB ISP to program Pro Mini atmega328?

author: mayor
author_rank: Regular Contributor
timestamp: January 30, 2015, 01:18:45 am
content: Quote from: suicidaleggroll on October 09, 2014, 04:54:46 pm+1

author: aeberbach
author_rank: Regular Contributor
timestamp: January 30, 2015, 02:32:14 am
content: I like this one -Teensy 3.1is a Cortex M4 core, Arduino compatible, no special programmer required, under $20. Yes you can save maybe $5 by buying a Chinese clone but you might consider supporting the designers.

author: f5r5e5d
author_rank: Frequent Contributor
timestamp: January 30, 2015, 04:38:14 am
content: not sure why this thread was restarted buthttps://www.edx.org/course/embedded-systems-shape-world-utaustinx-ut-6-02xis just in its 2nd week most could probably catch up

author: rickselectricalprojects
author_rank: Regular Contributor
timestamp: January 30, 2015, 12:38:25 pm
content: hi!i am a big fan of arduino and for a beginner like me get an arduino board. a fake one on eBay is under $10 and a real one from rs components is about $30. it is very easy to do and there is alot of support and countless projects to do. and there is also a heap of modules and Shields for the arduino and the software is easy to use and free!and if you don't want an arduino should get a cheap avr programmer and a couple of atmel chips of eBay for about $15 (programmer and chips)

author: ceamiclover
author_rank: Contributor
timestamp: January 30, 2015, 02:53:36 pm
content: I have an Arduino, which I would use for prototyping and learning on. I was looking for a cheap controller to embed in simple projects.I am not very creative, so I would rather sink $3 into a motion-light for my kitchen, for example, that I will probably replace and upgrade several times.I come from an automotive installation background and am used to just hardwiring everything. I have no programming or electrical engineering background, and am trying to push this hobby/interest further. I thought incorporating micro-controllers with some logic would be the next step.I'm finding it difficult and not user-friendly at this point.As I have not gotten the USBASP, I picked uphttp://www.ebay.com/itm/311064700128?_trksid=p2059210.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AITto see if I have better luck.

author: BlueBill
author_rank: Regular Contributor
timestamp: January 30, 2015, 04:54:01 pm
content: You really can't go wrong with a PICkit3, too bad it isn't as loaded with extras like the older PICkit2. These are full featured programmers (but not production) and can program and debug a blank PIC, no bootloader required.That said, I still use my old PICkit2 (I also sold kit versions "Junebug" under the name BlueRoomElectronics).Aside from the PICKit2 having only beta support for some PICs using MPLABX it has some neat secondary features that I still use. A 3 channel logic analyzer and a UART tool, nice.

author: dannyf
author_rank: Super Contributor
timestamp: January 30, 2015, 05:13:52 pm
content: QuoteIt is. It just requires some skills that may or may not be natural to you.1) programming skills;2) comprehension - you need to be able to read datasheet quickly;QuoteUnfortunately true. But the reward can be significant as well.The arduino / AVR is a good starting point -> they are lot easier to work with than the PIC and are also more feature rich.

author: kamtar
author_rank: Regular Contributor
timestamp: January 30, 2015, 11:00:03 pm
content: By which logic you can recommend for a beginner who want to make some hobby projects something else then arduino? He can start with simple projects using all arduino function and then when he wants to learn more he can try to make some native C AVR code.. learning about registers and MCU while he can fix harder problems just by calling a lib function. But no they will recomend you STM32.. really? -_-

author: dannyf
author_rank: Super Contributor
timestamp: January 31, 2015, 01:33:13 am
content: It depends on who the beginner is.

author: Scrts
author_rank: Frequent Contributor
timestamp: March 25, 2015, 10:32:09 am
content: Quote from: mazurov on October 16, 2014, 07:38:30 pmWe can get into a discussion what happens after newbie passes that semicolon problem, but is it really worth it? See, if the newbie manages to pass the compiler errors, the next step is to pass the code errors.Regarding the compiler: I always turn off the optimization when doing debug, so nothing gets mangled.

author: Zero999
author_rank: Super Contributor
timestamp: March 26, 2015, 08:49:45 am
content: Quote from: BlueBill on January 30, 2015, 04:54:01 pmThe main disadvantage with PICs the optimised C compiler is ridiculously expensive and the licensing is silly. It's fine if you're Ok with a crappy unoptimised compiler (read deliberately made slow) and using assembly but it's no good really. Microchip are really shooting themselves in the foot by charging so much for their development software.With AVR you get a nice free optimised compiler and plenty of other free tools.

author: janoc
author_rank: Super Contributor
timestamp: March 26, 2015, 10:06:18 am
content: Quote from: mazurov on October 16, 2014, 07:38:30 pmI haven't tried debugging with my Dragon yet (I generally find the problem by debug prints on AVRs faster than it would take to hook the Dragon up), but GDB has no problems with C++ code. Are you sure you are loading a non-stripped, non-optimized ELF binary (not disassembling the raw binary used for programming!) into it? That is not how the code is compiled by default by the Arduino toolchain, so you may want to ensure you have -g -O0 options enabled (-g = debug symbols, -O0 = disable optimization). You can find the compiler settings in one of the text files in the Arduino folder (don't remember which one it was out of top of my head now).Quote from: mazurov on October 16, 2014, 07:38:30 pmWell, unless you are dealing with AVR Studio, AVR debugger is also GDB-based - avr-gdb.Re ARM development - most expensive proprietary toolchains use variants of the free (and pretty good) GCC/GDB behind the scenes, only putting fancy IDE in front. A really glaring example is LPCXpresso from NXP - a crippled version of Eclipse preconfigured to work with their Xpresso demo boards and nothing else, using a gcc/gdb toolchain.If you are a bit skilled with the tools (and you probably should be if you are developing for ARM), it will take you perhaps half an hour to set up a free toolchain with an IDE of your choice, including debugger integration, so that you can use graphical debugger instead of typing GDB commands directly.I am developing on STM32 series of chips using a self-compiled toolchain, CMake and Emacs, but I am software dev by profession, so I prefer to have things set up my way. Otherwise e.g. Eclipse works really fine (I am using it for AVR stuff), but there are others, such as CoIDE (basically preconfigured Eclipse) or emIDE (http://www.emide.org/- CodeBlocks).Unless you have a particular requirement that necessitates it, there is really no need for hobbyist to blow thousands of $$ to buy a proprietary toolchain and IDE (such as Keil or IAR) when developing for ARM. However, you may have to invest a bit of time to learn the ropes how to set things up - which will make you a better dev, IMO. Pushing magic buttons on a black-box IDE that spits out a binary is cool - when it works. When something goes south, you are screwed unless you know how it is setup and how it is supposed to function.Quote from: mazurov on October 16, 2014, 07:38:30 pmIndeed - I wouldn't say that the parts are not good, more like they are really overpriced for what they offer. This is pretty much the reason I am using AVRs only for quick hacks and prototyping where the Arduino libraries are a large time saver. Anything more "permanent" or "serious" will likely get a PIC or ARM in it instead.

author: janekm
author_rank: Unknown
timestamp: March 26, 2015, 10:45:18 am
content: Quote from: kamtar on January 30, 2015, 11:00:03 pmYes, absolutely I would recommend an STM32 (or similar) to a beginner. If they're keen on having the Arduino style of quickly getting an LED blinking they could use mbed, which is a web-based IDE with drag-and-drop programming:http://developer.mbed.org/platforms/ST-Nucleo-F103RB/And from there they can expand to basically anywhere, even within the mbed ecosystem there are many interesting options including Bluetooth LE, fast options with DSP-style functionality (Cortex-M4F), multi-core devices, ultra-low power devices, large memory devices... That beginner could run the same code on devices from a sub-$1 Cortex-M0 to a 120MHz Cortex-M4. How would the AVR line compete?(and yes, once they get bored of the web IDE they can download the code for the project and continue developing in a gcc environment).I consider it very limiting to recommend a single-vendor solution to a beginner these days considering what the ARM ecosystem has to offer (sound a bit like a sales drone... but it just makes sense doesn't it?).

author: dannyf
author_rank: Super Contributor
timestamp: March 26, 2015, 10:54:42 am
content: QuoteHow such a recommendation will actually work out for a beginner is highly questionable.QuoteYou can certainly write a piece of code for CM0 and not have it run on CM4. You can actually write a piece of code for CM0 and not have it run on the same vendor's other CM0.QuoteI can certainly write a piece of code for one AVR and have it run on another AVR, or PIC, or CM0 or CM4, ...

author: janekm
author_rank: Unknown
timestamp: March 26, 2015, 11:52:21 am
content: Quote from: dannyf on March 26, 2015, 10:54:42 amWhat makes you say that? I've played with some of the mbed dev-boards and the experience appears just as easy (if not more so) than on an Arduino to me (I may have some blindness since I can't quite call myself a beginner). But the "path to blinky" is simply:Plug dev-board into computer, it appears as a USB driveLog in to developer.mbed.org/compiler/Hit New, Select Platform, Select "Blinky" TemplateHit Compile, the compiled .hex file is downloadedDrag&Drop that file to the dev boards "USB Drive"That's not harder than using Arduino is it? But that same dev board also has a proper debug interface included so it offers space to grow.QuoteOK I wasn't being explicit enough here... The nice thing here is that you can take a whole application, making use of a hardware abstraction layer that handles things like GPIO, I2C, SPI (...), and libraries that interface with many external chips (http://developer.mbed.org/components/), and directly recompile it for a different dev-board from a different manufacturer, having to change nothing other than the pin assignments (and quite possibly not even that if you use the default assignments for the dev boards). Of course you can also screw that up, mainly by not using that HAL, but that's all part of the learning experienceSure to some extent the Arduino ecosystem offers something similar, and the libraries have been ported to different manufacturers dev boards, but to me the non-AVR Arduino environments always appeared a bit like second-class citizens (but I may be mistaken).(I'm not saying mbed is the greatest thing since sliced bread... I don't use it myself in earnest though I have played with it, and may well use it more in the future... But for a beginner it's a sensible option to consider).

author: Alex Eisenhut
author_rank: Super Contributor
timestamp: March 26, 2015, 12:03:15 pm
content: Quote from: Scrts on October 10, 2014, 08:25:20 amOr at least a simulator. When I do write some PIC stuff, I always simulate many times before programming an actual chip.

author: dannyf
author_rank: Super Contributor
timestamp: March 26, 2015, 12:35:59 pm
content: QuoteTry something a little bit more, like reading from an i2c adc and sending the data to a spi dac, all over dma.Do it on STM32F1 and then STM32F4.If you get it working then share the code here for us to try.QuoteOnly true for some of the simplest things you do on those chips, and only assuming that those libraries exist for the target board and maintain the same calling convention.

author: Fat
author_rank: Regular Contributor
timestamp: March 26, 2015, 01:39:56 pm
content: Quote from: ceamiclover on October 16, 2014, 01:47:46 pmIsn't that the truth. Last one I ordered took 65 days.

author: janekm
author_rank: Unknown
timestamp: March 26, 2015, 02:32:50 pm
content: Quote from: dannyf on March 26, 2015, 12:35:59 pmWell, the DMA part I wouldn't consider a beginner's problem, from what I remember of the DMA controllers on the STM32 line they're not exactly beginner friendly, I had to read over that section of the reference manual a good number of times before it made senseFor the rest of it, here you go:http://developer.mbed.org/users/janekm/code/ADC2DAC/(granted without DMA it's fairly trivial).QuoteTrue enough, once you're interesting in using the more unique features of a chip (even just DMA or more specific configuration of a peripheral) that's the limit of this sort of approach. But for a beginner it can take you pretty far (similar to the Arduino environment, granted).

author: janoc
author_rank: Super Contributor
timestamp: March 26, 2015, 02:38:57 pm
content: Quote from: Alex Eisenhut on March 26, 2015, 12:03:15 pmHmm, I think the last time I have used a software simulator was sometime around 2000 or so, working with AT89C2051 ... Considering the problems with simulating the hardware accurately, I prefer the real thing and a debugger.If you have high level code, then it is probably better done on a PC with stubs and test harnesses and then ported to the embedded system.

author: dannyf
author_rank: Super Contributor
timestamp: March 26, 2015, 02:44:18 pm
content: QuoteIf so, how's an ARM materially better than an AVR, or a PIC, etc.? Whatever those "simple things" a CM0/CM4 chip can do, an AVR/PIC/etc. can do too.

author: janekm
author_rank: Unknown
timestamp: March 26, 2015, 03:09:37 pm
content: Quote from: dannyf on March 26, 2015, 02:44:18 pmOf course, but what's the justification for recommending a PIC or AVR to a beginner? Are they materially easier to get started with? I'm not convinced.Any other reason?So why not recommend the ecosystem which can quite literally offer a microcontroller for practically any conceivable need, all with the same toolchain and a lot of overlap in calling conventions, register naming conventions, etc? I'd wager it's a lot easier to move from one manufacturer's Cortex-M chip to another one's than between AVR and PIC, for example (in terms of the mental effort, at least). And there's something very fun about for example using a micro with built-in radio peripheral:Code:(snip config)NRF_RADIO->SHORTS = ( RADIO_SHORTS_READY_START_Msk | RADIO_SHORTS_END_DISABLE_Msk | \RADIO_SHORTS_ADDRESS_RSSISTART_Msk | RADIO_SHORTS_DISABLED_RSSISTOP_Msk )NRF_RADIO->PACKETPTR = (uint32_t)&packet;NRF_RADIO->TASKS_TXEN = 1U;while (NRF_RADIO->EVENTS_DISABLED == 0U){// wait}

author: BlueBill
author_rank: Regular Contributor
timestamp: March 26, 2015, 03:25:46 pm
content: Quote from: ceamiclover on October 09, 2014, 01:49:49 pmPICs & AVR 8 bit microcontrollers are pretty similar, available in DIP (through hole), have high current ~20mA output pins, and require little more than power to get running. On the other hand an ARM is more a microcomputer and much more powerful and complex. if you need that kind of horsepower a Raspberry Pi or MIPs core PIC32 might be of interest.I use a PICkit3, MPLABX, XC8 & SwordFish BASIC (for the 18F series it's very easy & powerful).The PICkit3 can program & debug, too bad it doesn't have the logic or UART tool the old PICkit2 had.

author: dannyf
author_rank: Super Contributor
timestamp: March 26, 2015, 03:51:04 pm
content: QuoteThe same is true for PIC / AVR / etc.QuoteI thought you had agreed earlier that the same can be done with AVR/PIC/etc., especially if you stay with the simple stuff.QuoteYou can do that with lots of 8051 chips.

author: Alex Eisenhut
author_rank: Super Contributor
timestamp: March 26, 2015, 04:03:44 pm
content: Quote from: janoc on March 26, 2015, 02:38:57 pmLuxury! I mean for stuff I'm making at home, there isn't any known good hardware to start with, so at least with the simulator I can check for gross software mistakes.

author: janekm
author_rank: Unknown
timestamp: March 26, 2015, 04:28:44 pm
content: Quote from: dannyf on March 26, 2015, 03:51:04 pmIs there really a compiler toolchain that targets both PIC and AVR? Or a debug interface that can talk to both?QuoteBut there's a difference between "can be done" and "easier"...QuoteThat same code would look a lot more complicated on a CC2430 (you'd need to set up DMA and handle the interrupts) or an NRF24LE1 (uses an internal SPI interface). And besides even TI just came out with the CC2650 which has both a CM0 and CM3 inside:http://www.ti.com/product/CC2650Anyway my sole point was that if a beginner came to me asking for a recommendation, I would in many cases point them towards the ARM ecosystem (though I have also on occasion pointed them to Arduino when that would clearly suit their needs, i.e. if they were more interested in interfacing sensors to actuators in creative ways rather than being interested in learning about microcontrollers and embedded development per se).I have not yet seen a convincing argument for why one of the ARMs would be a bad choice for a beginner, the nicer ones (not necessarily STM32, though they often have the most bang for buck...) combine the nice Arm cores with simple and elegant peripherals (the NRF51 for example has a really elegant set of peripherals and task/event system).

author: dannyf
author_rank: Super Contributor
timestamp: March 26, 2015, 05:21:24 pm
content: QuoteWhy does it have to be the same? You can code them so that the same source file works under different chips.

author: dannyf
author_rank: Super Contributor
timestamp: March 26, 2015, 05:26:24 pm
content: QuoteComplexity, both in terms of hardware and software. A uart may take 5 registers to setup on a PIC/AVR, and it is not uncommon for them to have 20 - 30 registers in the ARM land.The setting up of a project itself can be quite involved as well. For PIC/AVR, it is fire-and-go; For those ARM chips, you have to load up the right start-up files, load up the right cmsis (and -dsp, -os, or -dap if you wish to use them), the OEM libraries, board package definitions, and set up the environmental variables + paths....They may not seem to be a lot for people who have done it. To people who are new, it is a different matter.

author: BlueBill
author_rank: Regular Contributor
timestamp: March 26, 2015, 09:25:09 pm
content: QuoteBoth the PICkit3 and AVR Dragon have debug. The PICkit3 uses debug hardware on the target PIC but I believe the Dragon is more an emulator. Both are inexpensive.

author: janoc
author_rank: Super Contributor
timestamp: March 26, 2015, 10:13:56 pm
content: Quote from: dannyf on March 26, 2015, 05:26:24 pmTrue, indeed. On the other hand, Arduino supports ARM (the Arduino Due boards) too and there is also mBed.However, for a really really green person who barely knows C, I would recommend starting with the Arduino boards (not PIC - nothing against PICs, but there simply isn't the beginner learning community around it) and then "upgrading" once feeling comfortable.

author: JacquesBBB
author_rank: Frequent Contributor
timestamp: March 26, 2015, 10:39:43 pm
content: If I have to advise a beginner, I definitively recommend an Arduino. This is how I started two years ago. I was amazed that starting from nothing,in just one hour, I could have an Arduino running with a DS18B20 recording the temperature every minute at very high precision.In all the discussion of this thread, I hear speaking of the various advantages of one IDE or debugger against others, and there are certainly better IDE that the Arduino (I hate its editor and use an external one),but there is something that does not exists with any of the other platforms :The huge community of the Arduino users which has totally changed the world of microcontrollers.Because of this community, there is also a huge amount of libraires of all kind for a large variety of components and sensors. Even if the quality of the coding is very uneven, it often provides an easy access to the interface of a component.When I search for an easy to handle component, I usually search on google with a generic name associated with arduino. Even if I do not want to use an arduino, I know that this will led me towards easy to use components.Of course, one should not stay with the Arduino. But once you have done the first step, going forward is much more easy. One of the thing that is very nice with the Arduino board, and especially with the Uno, is that you rapidly realize that you can construct it by yourself and do not need the board, and can just assemble a few components to geta perfectly usable Arduino.This is something you lose when you go to the more complex boards with more powerful processors.

author: janoc
author_rank: Super Contributor
timestamp: March 27, 2015, 02:25:14 pm
content: Quote from: BlueBill on March 26, 2015, 09:25:09 pmDragon uses the built-in JTAG/DebugWire/AWire debugging hardware of the Atmel chips. In theory you could use any generic JTAG dongle with JTAG-capable AVRs too, however the Atmel JTAG command implementation is not documented, that's why Dragon has another micro on board that acts as an interface (among other things).DebugWire and AWire are proprietary Atmel debugging protocols requiring only a single pin (typically RESET) on the small micros like the Mega and Tiny series. Even the Mega168/328 used in the most Arduinos supports DebugWire, so, in theory, the Arduino IDE could integrate support for step-by-step source debugging if they interface with avr-gdb which works with it.

author: katzohki
author_rank: Frequent Contributor
timestamp: March 27, 2015, 02:42:48 pm
content: Quote from: wilfred on March 26, 2015, 11:44:12 pmHm, exactly the same reason I avoid Arduino. Interesting isn't it? Very different approaches we all have.By the way, this thread was originally started October 10, 2014.

author: zapta
author_rank: Super Contributor
timestamp: March 27, 2015, 03:54:54 pm
content: I discovered mbed a few months ago (hobby only) and am very impressed with it.Last year I switched from Arduino/AVR to ARM M0. Initially I took the hard way and implemented APIs for uart, serial over USB, timer, etc and they did work and I was happy. Then I discovered the mbeb community, the rich libraries its provides (e.g.http://developer.mbed.org/handbook/USBDevice) and the prompt response to questions and issues and now uses it whenever I can.My general flow is creating the project in the online IDE, importing the libraries I need (e.g. USBSerial) and then importing the entire project to a local eclipse/lpcxpresso and going from there. Mbed did very good job with the project exporters, recognizing the limited appeal of the online IDE (which works quiet well) and the Eclipse project structure they generate is very clean. They also have exporters to other tool chains which i didn't try.Overall it's a great resource.

author: janoc
author_rank: Super Contributor
timestamp: March 27, 2015, 03:59:44 pm
content: Quote from: katzohki on March 27, 2015, 02:42:48 pmAnd you likely aren't a green green newbie who was the subject of that comment neither. Thank you for a pointless Arduino-bashing comment.Quote from: katzohki on March 27, 2015, 02:42:48 pmSo? That's the way forums (unfortunately) work. People revive old threads because they find them interesting.

author: janoc
author_rank: Super Contributor
timestamp: March 27, 2015, 04:05:17 pm
content: Quote from: Alex Eisenhut on March 26, 2015, 04:03:44 pmI guess we build stuff in very different ways then - I first design and build/prototype the hardware (even if it is on a breadboard and using an MCU devboard) and write firmware only after I have at least a vague idea about the hardware it is going to drive and means to test it.

author: katzohki
author_rank: Frequent Contributor
timestamp: March 27, 2015, 05:55:34 pm
content: Quote from: janoc on March 27, 2015, 03:59:44 pmI wasn't bashing Arduino. In fact, I was commenting that it is interesting that people have very different approaches to learning about microcontrollers. No need to be so defensive for Arduino, they are very popular and everyone knows that. I don't develop with them, but I think Arduino is great for being so easy to use.As for the second comment, just sayin'.

author: Alex Eisenhut
author_rank: Super Contributor
timestamp: March 27, 2015, 06:10:51 pm
content: Quote from: BlueBill on March 26, 2015, 09:25:09 pmOh absolutely, I have a PICKit3, but I'm talking at home, there is no hardware to plug the PK3 in the first place. I just prefer looking over my code many times first. Then I start breadboarding.