What manufacturer/toolchain to start out with micros - Page 1
Forum section: electronics / general

author: donkey77
author_rank: Regular Contributor
timestamp: May 15, 2019, 07:18:04 pm
content: Hi All,Without wishing to start a flame war I would like a bit of advice please. I am looking to move beyond the odd arduino dabbling and start to turn some ideas into custom pcbs. Before I steer myself down a dead end which manufacturer/software package/range of microcontrollers would you recommend to a beginner. If I'm going to start from scratch I would like to learn something that is somewhat future proof. I'll probably only have one or two projects each year so I'm not talking about a massive usage.Currently I have the following requirements for the hardware: multipole PWM outputs, SPI, I2C communication etc, potential motor drive control/encoder input, adc/dac with 12 bit resolution or better, provision for a decent number of I/O, Display capability (LCD/Oled 4 line character type). As for software I would like a one off purchase instead of a subscription model. I understand upgrades and/or support for more advanced chip support may cost more but I hate having monthly/annual payments. I don't need either software or hardware to be the cheapest but at the sametime for something that at the moment is an occasional hobby I don't want to remortgage the house!Thanks in advance for any guidance and apologies if I haven't explained things clear enough.Rich

author: pigrew
author_rank: Frequent Contributor
timestamp: May 15, 2019, 07:48:02 pm
content: Your requirements seem to be pushing you towards a mid-range micro with a bunch of pins, but you don't need any of the IoT/wireless networking things. Perhaps the STM32F3 series would have a chip that fits your needs. Another possibility would be the TI TiVA C TM4C123G though those are a bit more expensive. I'm less familiar with the offerings from other companies, though I'm sure that NXP and Microchip have suitable processors.Most of the companies these days release free compilers + Eclipse-based IDEs. Otherwise, you would be looking at a toolchain from IAR. You probably should use the free development software that comes from the micro's manufacturer.In terms of a RTOS, FreeRTOS is pretty common except for TI chips which would use TI-RTOS.Your OLED display would probably use I2C or SPI, and not require any special MCU peripheral. Your motor drive and ADC requirements are probably the things to pay attention to. TI C2000 Piccolos are somewhat more difficult to program, but have some of the best motor-driving features (for example if you plan to drive BLDC).Most companies will sell you a development/breakout board for between $US10 and US$30 with an integrated programmer.

author: lucazader
author_rank: Regular Contributor
timestamp: May 15, 2019, 08:04:14 pm
content: There are quite a few options out there. I would probably suggest going to a manufacturer that uses the Arm Cortex-M cores in their range.Of these, the most common would be: ST's STM32, Atmel/Microchip's SAM, NXP and others.All of these are supported with open source toolchains as well as toolchains which can be purchased. However Mos people here would recommend using the free gcc toolchain.All three of these manufacturers provide a full toolchain and IDE for development for free. They all use the mentioned gcc compiler.There are extensive ranges of micros from these manufacturers, so while some of the lowest end ones might not work for you. As you soon as you move up in the product lineup there will be something to fit your needs.Personally I am an STM32 guy. As a simple way of getting started, you could download their new STM32CubeIDE (https://www.st.com/en/development-tools/stm32cubeide.html). This includes the full toolchain and an eclipse based IDE, as well as their CubeMX software which you can use to get started, configure pins as inputs or outputs, configure ADC/DAC peripherals and PWM channels etc. It will be a good starting point to have a play around.And the dev boards for STM32 are quite cheap. The official ones with an ST-Link debugger built in are about $10-20 USD depending on what you choose. With some much cheaper ones available on aliexpress.Anyway im sure some of the others will have more thoughts, opinions and advice on this and some will definitely disagree with me but hey, each to their own!

author: KC0PPH
author_rank: Unknown
timestamp: May 15, 2019, 08:55:42 pm
content: PIC32 seems like a decent fit, you can do all of your development on free software (MPLAB and Harmony) and your programmer is $50.

author: nctnico
author_rank: Super Contributor
timestamp: May 15, 2019, 08:56:00 pm
content: Nowadays Eclipse +GCC is pretty much standard. Manufacturers often bolt their own eco system on top of it but IMHO the added value isn't that high once you gained knowledge on how to configure the pins and peripherals. I strongly suggest to make sure to check out NXP's LPC ARM controllers. These are relatively simple to use and peripherials are the same across the entire line so you don't have to deal with a different peripheral if you need a controller with slightly different features.

author: NivagSwerdna
author_rank: Super Contributor
timestamp: May 15, 2019, 09:07:17 pm
content: Quote from: donkey77 on May 15, 2019, 07:18:04 pmThat was my idea too but the 328p (UNO) is such an easy to use eco-system it is hard to give up that easily. I would recommend producing some custom PCBs of your own around the 328p with the Arduino bootloader to start with. It is actually really cheap to buy chinese clones and strip these for core components using hot air (https://www.mikrocontroller.net/attachment/258727/CH340G_UNO_ArduinoBoard_3.pdfbeing my favourite variant to lift as it has a proper XTAL). You can take baby steps towards escaping by using AVR Studio but it might not be necessary.I have a selection of PIC Discovery boards (24 and 32) which are tempting but I haven't used them in anger yet... STM32 has been in my cupboard for a while.. again need a kick to use it... possibly STM32F4 or STM32F7?And if you can afford the power budget and need WiFi... you should really be looking at ESP32 etc.If I could only chose one and someone took away my AVRs... I would go STM32; in the meantime design a PCB with what you know... Elecrow et al... are waiting for your order (and use the free edition of DipTrace)PSMaybe you should swallow the Blue Pill? STM32F103C8? (Meets the requirements) [STM32VLDISCOVERY?]

author: IDEngineer
author_rank: Super Contributor
timestamp: May 15, 2019, 09:21:45 pm
content: Quote from: KC0PPH on May 15, 2019, 08:55:42 pmAnother vote for the Microchip PIC families. The free development environment works pretty well, and you can optionally buy "better" versions of the compiler on an annual or monthly subscription basis at anytime. You can also obtain a free 30 day trial period of the "better" versions to see how it works for you, and the development environment will do a real-time comparison to estimate how much code/data space you'd save with the "better" version. To be honest, I've done all of the above yet have reverted back to the free versions because they've been more than adequate for my needs.Customer support from Microchip is remarkable. Their support tickets get real attention from staff within very reasonable amounts of time. In one case, I raised a question and was asked if it was OK for them to set up a conference call with us to discuss it in real time. They weren't kidding around, they had at least two silicon engineers, at least two app engineers, and at least one sales and one management on that call! They stayed on the phone for an hour running through things, making sure we had a meeting of the minds, and copied me on the internal emails that addressed the question going forward. Best customer service I've EVER received in the component industry. (Funny side note: During the call we reminded them we aren't their largest customer, that year perhaps consuming 10K MCU's from them. They replied that they know smaller shops are their bread and butter and the mandate to support smaller shops comes straight from the top of the company. Sounds good to me!)The PIC's themselves have a bit of an odd MCU architecture but so far, when optimizing with hand-coded Assembly, I haven't had a reason to pound the table in frustration. Easily 95% of our firmware is in C/C++ so it's an edge case anyway. Their compilers are reasonable, have good libraries, and the head of the team that writes/maintains them personally hangs out in the Microchip forums. I'd say 50% of the threads raising questions about the compiler have an answer from that guy.Their on-chip peripherals are quite good, and I keep being amazed at what can be done with them to push functionality onto the hardware instead of the firmware. They have an MCU selector on their website that makes it easy to dial in the models that contain the peripherals, pin counts, etc. that you need for a given project.Finally, they have a nice range of debuggers. They sell one for $15 - not a typo - and the PICkit series is the ~$50 unit mentioned by KC0PPH above. Those are considered hobbyist level, the baseline professional unit is the ICD3 which has been recently replaced with the ICD4. Compared to the lesser debuggers the ICD series uses "production" programming voltages, has better hardware breakpoint support, etc. I've yet to hear from anyone that "needed" the ICD4 nor any better features unique to that unit, but the good side effect is Microchip is flushing out their stock of ICD3's right now for $99 each in their company store. I just picked up an extra one as a backup, at that price it's really cheap insurance. So if you go with Microchip, just spend the $100 and start with their professional-level ICD3. Since all the software is free, you're still only $100 out of pocket. This one debugger will work on almost every MCU they make, it gets transparently reconfigured with free firmware when you switch devices. By the way, Microchip shipped mine UPS Next Day Air yet shipping was under ten bucks.There are plenty of good MCU choices out there. Just wanted to give some background on why we like Microchip. Report back on what you decide!Disclaimer: No connection with Microchip except as a very happy customer.

author: NivagSwerdna
author_rank: Super Contributor
timestamp: May 15, 2019, 09:41:21 pm
content: Quote from: IDEngineer on May 15, 2019, 09:21:45 pmFWIW For PIC thehttps://www.microchip.com/promo/curiosity-development-boardsdev kits have PICKIT onboard so you don't need to buy a debugger initially.

author: Sal Ammoniac
author_rank: Super Contributor
timestamp: May 15, 2019, 09:47:42 pm
content: If you plan on doing motor control, take a look at the Infineon XMC4000 series. It's an ARM Cortex-M4 core with peripherals geared to industrial control applications like motor control.

author: westfw
author_rank: Super Contributor
timestamp: May 15, 2019, 10:53:49 pm
content: The STM32 series seems to offer the most "bang per buck" in development boards. $15 will get you a good-sized "Nucleo" Cortex M4 board with built-in debugger (actually, any of quite a range of M0, M3, M4 boards.) Industry standard ARM CPU(s), wide range of parts, some significant user base... Their support of "casual" and student users seems less than stellar (compared to Atmel/Microchip or TI) but...TI also has nice cheap development boards, but a much smaller portfolio of parts.Microchip (AVR, ARM, PIC32, PIC) has a lot of options, and the Arduino connection, but their bigger chips tend to come on expensive development boards. Or I guess you could buy one of the Arduino derivatives...

author: NorthGuy
author_rank: Super Contributor
timestamp: May 16, 2019, 12:50:14 am
content: Quote from: donkey77 on May 15, 2019, 07:18:04 pmDon't even think about purchasing software for 1-2 projects per year. There are plenty of free stuff. Every manufacturer whants you to try their stuff for free.

author: techman-001
author_rank: Frequent Contributor
timestamp: May 16, 2019, 01:25:54 am
content: Quote from: donkey77 on May 15, 2019, 07:18:04 pmIn 1976 we were paying $270 for a single 16 bit cpu with no peripherals and houses were cheap, nowadays embedded is literally as cheap as chips and houses are expensive.I recommend STM32 mcu's for one reason alone, what other manufacturer has paid million$ of Dollars for a established HIGH END IDE company to be able to GIVE their product away ?STM purchased Atollic so you can have a kickarse C development system with EVERYTHING totally FREE:-https://atollic.com/truestudio/Plus STM32 chips are really cheap, jam packed with serious peripherals and have extensive FREE Open Source Support.

author: KC0PPH
author_rank: Unknown
timestamp: May 16, 2019, 01:33:51 am
content: Quote from: IDEngineer on May 15, 2019, 09:21:45 pmAny huge reason for a hobby guy to get a icd3 over just using the pickit

author: NorthGuy
author_rank: Super Contributor
timestamp: May 16, 2019, 01:48:56 am
content: Quote from: KC0PPH on May 16, 2019, 01:33:51 amI wouldn't say that. The biggest difference is that ICD3 is faster than PICkit3.

author: rstofer
author_rank: Super Contributor
timestamp: May 16, 2019, 03:49:49 am
content: Why not write bare-iron code for the Arduino. The 328P is a capable chip, the toolchain is already available and there is a dumpster full of code to copy.I used the ATmega128 many years back - it's a great chip!I would rather take a beating than get back into the mid-range PICs. They are architectural disasters that somehow won't die. Constant paging and banking is part of the problem, the other is the lack of a stack pointer register. This means that C compilers are challenged to produce decent code and is the reason that for many years, only crippled compilers were available. GCC (probably the most used C compiler in the world) still doesn't handle PICs (AFAIK). Look at the assembly output of a C program and see all the banks and pages.The PIC32 is a pretty nice chip but the future belongs to ARM and it doesn't much matter which vendor you pick. I personally like the mbed LPC1768 module and I kind of like the online toolchain. Nobody around here agrees with me re: the online tools but that's the way it goes. Maybe ask someone who has actually used the toolchain to develop a project. And, yes, I can bring the code and all of the libraries down for use with a local toolchain. GCC works well. I have done it with Rowley Crossworks.Note that many STM32Fxxx boards are now mbed compatible... The mbed project is now owned by ARM.

author: wilfred
author_rank: Super Contributor
timestamp: May 16, 2019, 04:42:39 am
content: I suggest you consider the Texas Instruments Tiva C Launchpadhttp://www.ti.com/tool/EK-TM4C123GXLwhich is available from TI for US$13 plus shipping. I suggest it because it is pretty cheap from a reputable source and mostly because there is a Youtube channel that uses it for a series of course videos. They started out using the IAR toolchain which is free with code limitations but there is also the Code Composer Studio available from TI for free these days with no code limitations. They switched to CCS around video 18 or 19 IIRC.Watch the first few videos and see if it suits the way you like to learn. I thought it was very good and well structured. The last half dozen videos build a simple minimal RTOS (it is simple) that show the basic way an RTOS schedules threads. If there is a better intro to microcontrollers out there then I want to know of it.This is the course website.http://www.state-machine.com/quickstart/This is the YT video playlist.

author: techman-001
author_rank: Frequent Contributor
timestamp: May 16, 2019, 08:09:08 am
content: Quote from: rstofer on May 16, 2019, 03:49:49 amI just had a quick look at Mbed OS 5 (https://os.mbed.com/docs/mbed-os/v5.12/introduction/index.html) because of your post. I ran the obligatory 'blinky' on a brand new Nucleo-STM32L073 (https://www.arrow.com/en/products/nucleo-l073rz/stmicroelectronics).Here is my quick summary of Mbed on a Nucleo-STM32L073 on FreeBSD.* fastest C toolchain to set up ever: it's all cloud based and set up already* easiest system to flash the compiled binary to ever: just drag and drop the compiled binary file.* tons of information, nicely laid out* heaps of different boards and mcu support* IoT support* completely freeThis system is very impressive, and if one is into learning C, $13.28 (for the Nucleo board above) gets you *everything*, there is *nothing* else to buy. No wonder ARM is annihilating the embedded space competition with all this FREE support.If you want the nuclear option, get the FREE PC based Atollic IDE from STM.

author: SWR
author_rank: Regular Contributor
timestamp: May 16, 2019, 09:37:13 am
content: I will suggest that you take a serious look at the ESP32 suggested NivagSwerdna above.You already know Arduino programming and this is compatible with that UI.You have several SW choices: Arduino for ease of use, C programming IDE for more efficiency, Assembly for maximum efficiency on critical parts (although most won't need it because they're much faster than an AVR).You get tripple cores and plenty of memory & I/O's in those small modules.Two of the cores are high performance 32bit 240MHz while the third is low power for those long life battery applications.Here's a quick comparison...Code:Tech. data: Arduino Uno ESP Wroom32Price €20 $3MicroController ATmega328P Xtensa LX6Voltage 5V 3,3VCPU cores 1x8bit 3x32bitClock Speed 16M 240MDMIPS 4.8 600 (125x faster)DMIPs/MHz 0.30 2.5DMIPS/mW 0.10 7.5Float multiply 0.21MFLOPS 120MFLOPS (571x faster)Flash 32K 4M (128x larger)SRAM 2K 536KEEPROM 1K - (uses Flash)Mem. card - SD/eMMC/SDIODigital I/O 14 36PWM output 6 16Touch input - 10DAC output - 2x8bitADC input 6x10bit 18x12bitUART 1 3SPI 1 4I²C 1 2I²S - 2 (camera and high speed audio)IR - 1CAN 2.0 - 1Ethernet - 1Encryption - AES (HASH, RSA, ECC, RNG)Temperature - Built in temperature sensorMagnetic field - Built in hall sensorWiFi - Built in including antennaBlutooth - Built in including antennaLength 68.6mm 25.5mmWidth 53.4mm 18.0mmFor a dollar extra you get 16MB FLASH.They really pack a punch for the money you pay.Best regardsSoren

author: SteveyG
author_rank: Unknown
timestamp: May 16, 2019, 09:58:53 am
content: It surprises me how many are recommending 32-bit MCUs based on the requirements listed in the OP.The OP may as well start development on the Arduino already owned, developing and programming for the MCU already onboard.

author: Fred27
author_rank: Unknown
timestamp: May 16, 2019, 10:07:10 am
content: As I'm sure you're starting to realise, they're all good and all have their fans! I mostly played with TI, ST and NXP. I ended up on TI and lots of nice STM32 dev boards gathered dust. Another minor plus is that TI have Energia so you can start off with a familiar Arduino environment to start with. (I've never used it myself, but heard good things about it.)Definitely focus on one thought. The IDE and peripheral setup is just different enough that switching is a pain - for a hobbyist at least.

author: wilfred
author_rank: Super Contributor
timestamp: May 16, 2019, 10:18:06 am
content: The OP did say he wanted to move on from dabbling with Arduino. Perhaps people took that to mean move up from 8 bits to something larger. But I think the requirement for something future-proof is better taken up on an ARM device.I found the combination I recommended useful and I can identify with the OP. Even if he did nothing else with it I think it would be money well spent. He'd be much better able to decide the next step.I'm device/platform agnostic. If it suits the purpose, great. For hobby or self study I can't see it makes all that much difference whether it is 8 bits or 32bits.I found the course useful and it used a TI Launchpad. And I had one. And I only bought it because TI had a sale. It wasn't a complex selection process. I just got lucky.BTW to the OP the TI Stellaris the course mentions is now called a TIVA C but it was just a name change.

author: IDEngineer
author_rank: Super Contributor
timestamp: May 16, 2019, 05:08:48 pm
content: Quote from: rstofer on May 16, 2019, 03:49:49 amAnd yet, PIC's are everywhere. As I said earlier, their architecture is a bit odd but Microchip's compilers seem to have dialed in the process of yielding good code so you don't have to worry about the architecture unless you're hand-optimizing some Assembler. I'm on a PIC18 based project right now running at 64MHz, meaning an 8 bit CPU doing lots of double precision floating point math, and we're getting great performance. Their on-chip peripherals must be the result of several generations of refinement because they do a great job of offloading the workload from the firmware. This one device is doing full-duplex CAN network, interfacing with SPI peripheral chips (and doing math on the data obtained from them), doing A/D conversions, running four channels of PWM, plus three more real-time I/O operations and we have lots of idle CPU cycles.PIC is by no means the only game in town, but speaking personally I definitely don't think a "beating" is better!

author: nctnico
author_rank: Super Contributor
timestamp: May 16, 2019, 05:14:46 pm
content: Quote from: westfw on May 15, 2019, 10:53:49 pmBut the problem with the STM32 is that the serial bootloader is poorly implemented and the peripherals vary wildly so choosing a different controller requires learning different peripherals. The latter costs more in lost time in the end. Even for a hobby time is money. With NXP's LPC series it is very easy to move between various microcontrollers and use the same low-level code. As a result every project I build has a different type of microcontroller which is tailored to the project's requirement. You can't do that with STM32 (unless you use a bloated library provided by ST).

author: ucanel
author_rank: Regular Contributor
timestamp: May 16, 2019, 06:02:49 pm
content: Instead of loosing time on asking these kind of nonsense which to use questions you can easyly try all of them in a very short amount o time and use whichever you want to use.These are called TOOLS it does not matter which one you select or usethere are not big amount of diffence between them,important part is using the tools and achieving your goals.

author: Dubbie
author_rank: Unknown
timestamp: May 16, 2019, 06:40:15 pm
content: A few years back I faced the same question as you.I tried NXP, but didn’t click with the development boards (almost certainly because of my inexperience at the time). I then tried STM32 and have never looked back. Have used probably a dozen different parts from them now F0, F1 and F4 and had a very pleasant experience with all of them.

author: emece67
author_rank: Frequent Contributor
timestamp: May 16, 2019, 08:08:56 pm
content: .

author: Sal Ammoniac
author_rank: Super Contributor
timestamp: May 16, 2019, 08:20:41 pm
content: Quote from: NorthGuy on May 16, 2019, 01:48:56 amThe slowness of the pickit would drive me nuts. The cost difference for the ICD4 is worth it.

author: Sal Ammoniac
author_rank: Super Contributor
timestamp: May 16, 2019, 08:28:21 pm
content: Quote from: techman-001 on May 16, 2019, 01:25:54 amEverything except speed and responsiveness...Atollic took Eclipse (an okay IDE) and added every plugin and extra known to man, resulting in a ponderous, sluggish beast. You can do much better by starting with bare bones Eclipse, adding CDT, and EmbSysRegView andnothing elseand you'd have a much more responsive and usable IDE.

author: donkey77
author_rank: Regular Contributor
timestamp: May 16, 2019, 10:23:52 pm
content: Thank you for all of your replies and recommendations. I think from reading the responses you all get where I'm coming from, and it looks like a few have been in the same position in the past.For me personally I know I probably won't get weeks and months of time to play with different options, day to day work plus a young family put pay to that! Therefore a tool chain/software that is user friendly and fairly easy to pick up is a must. I don't come from a programming background so it will already be quite a steep learning curve.From reading on these forums over the years I can a lot of people mention using pics, but I wondered if people learnt that years back, knew the product, so stuck with it. I'm sure they are still a great product, but if starting out again would they choose the same path.As much as I've tried throughout my life to make choices on merit, be it which mobile phone/operating system/home entertainment and automation to go with, I'm also aware that sometimes its better to just go with the industry standard instead of getting stuck with an unsupported or obsolete paperweight.I guess I could stick with the 8 bit arduino path but feel if I'm going to invest the time to learn something in any detail I would be better to go with something that may benefit me in the future, maybe career wise. So far it seems there is a lot of love for the STM32 range.For my personal projects the cost of the part isn't an issue, so picking a device that is perhaps overkill for that particular project, instead of the minimum required so as to save £5, wouldn't be a problem.Thanks again for all of your advice.Rich

author: NorthGuy
author_rank: Super Contributor
timestamp: May 16, 2019, 11:51:23 pm
content: Quote from: donkey77 on May 16, 2019, 10:23:52 pmIMHO, If this is your hobby, then neither cost nor popularity should be your criteria. Nor would I worry about "future proofing" - technology has changed on me so many times. Unless you're interested in sustainable production, don't worry about future proofing. If you do, then 5-10 years from now it'll be dragging you back to Today's technologies (just as the people who use older obsolete PICs now because they future proofed themselves some 10 years ago). Instead, be open to the change. You can't predict the future now.There's no boss yelling at you. You can do whatever you please. Take advantage of this situation and do what you really want instead of thinking of what's efficient, cheap, or whatnot.

author: techman-001
author_rank: Frequent Contributor
timestamp: May 17, 2019, 01:19:14 am
content: Quote from: nctnico on May 16, 2019, 05:14:46 pmIt's funny how experiences differ. I first programmed a micro back in 1976, and have built burners for and programmed several Micro types over the years including SC/MP,Z80,8085,6805,68HC11,6502 and PIC16F84. After 13 years away from embedded (2000 - 2013) I decided to get back into it and to learn Forth. I bought some NXP gear (as they do make beautiful boards), some STM32F disco boards, some 18 and 24 series Pics plus a pickit2 and some AVR's.The STM32 Discovery boards worked straight away after I plugged in the USB connector, I could program them easily with Openocd and Gcc or a number of other tools. I initially tried the STM software with (those massive bloated libraries) which didn't compile so I just Googled a simple blinky.c example that used Gcc, a loader, header and Makefile and it worked fine.From that point I started learning Forth and have stayed there ever since. The STM32F's program fine for me with the serial bootloader, or USB.The Pics were fine and I had last used them pre 2000 in the 16 series, but they were only 16 bit. The Avr's were ancient and I wasn't impressed with Atmels poor Linux tools.The NXP boards are still sitting in the box they came in, I could never program them because they either wasn't Linux friendly or used tiny connectors I didn't have, or both. The NXP series may be the smoothest, fastest, nicest, coolest micros that ever existed, but sadly I was never able to talk to one to find out. The boards were beautiful, packaged nicely and really looked fantastic. I tried several times over the years, always getting nowhere.Plus, NXP parts seem more expensive than STM32F. I bought a heap of STM32F051 in 32QFN for $0.56 USD ea in 2013 from Avenet. They are 64KB flash, 8KB Ram and the 32 peripherals on chip. They have done everything I've asked of them and I'm surprised I haven't managed to blow one up or cook one yet.So for me NXP = 0, STM32 = 1 ... and the winner is STM32!

author: bhave
author_rank: Contributor
timestamp: May 17, 2019, 01:56:38 pm
content: Quote from: NorthGuy on May 16, 2019, 11:51:23 pmThis 100%! There are so many nice and inexpensive development boards. Find a few with features you like and start messing with them. If you are not sure what features you want, come up with some project to create and use that to determine the feature set. Once you dive more deeply into the hardware, supporting software, and documentation you will start figuring out what you prefer. Then you can use the development board as a reference to create your own board, adding or removing extra stuff as wanted.To be honest, everything is pretty good these days and it is hard to make a bad choice.

author: rstofer
author_rank: Super Contributor
timestamp: May 17, 2019, 02:24:09 pm
content: Quote from: donkey77 on May 16, 2019, 10:23:52 pmAs I said above, I'd rather take a beating than use the mid-range PICs - 16Fxxx chips. They're fine if you plan to write the code in assembly language but decent C compilers don't really exist. There are some minimally featured (in terms of language constructs) compilers around but they are crippled. I used the 16Fxxx family extensively about 15 years ago.QuoteYou can play with the Arduino and replace the library code with your own as you learn how the various peripherals work. Start simple: replace the serial library with your own code. That part would be easy. I'm not sure how ugly it would be to make it interrupt driven. It could be pretty easy.I had the same issue with the mbed platform. The libraries provide terrific functionality but they don't provide interrupt driven SPI slave mode. It only took a few minutes to replace the SPI driver with my code and hook into the interrupt controller. That was possible because I had extensive experience with other NXP chips like the LPC2106 and LPC2148.As you replace bits and pieces, you will eventually own the chip. Everything you learn will better prepare you for a different chip. There is almost no commonality between the ATmega328P and an STM32Fxxx except for concepts.You can certainly skip ahead and go for the STM approach. In fact, the Nucleo boards are already set up to use the mbed approach to programming. In addition, they have headers that align with Arduino shields.https://os.mbed.com/platforms/?q=&Target+Core=Cortex-M0&Target+vendor=STMicroelectronicsThese boards come with a programmer attached or they can use the mbed 'mass storage device' approach.I would think that the STM learning curve would be quite steep due to the complexity of the device itself. Replacing the library code might be quite involved. I haven't used the mbed libraries with an STM device. It could be that most of the bloat has been removed but I don't know that. The limit of my experience with mbed is with the LPC1768https://os.mbed.com/platforms/mbed-LPC1768/I built a daughter card with a MagJack and, voila', instant networking. I needed to take in SPI slave at a low number of MHz (interrupt driven into a circular buffer), reformat the information and blast it out to a networked LaserJet. It works perfect. I really like the 'stamp' form factor because it is easy to plug it into some kind of custom daughter card. Using the online toolchain is simple: compile the code and it will download to the PC. Drag and drop it on the LPC1768 mass storage device (virtual hard drive). Hit reset and you are off and running. The only debugging capability is printf() so get your UART running first!

author: SteveyG
author_rank: Unknown
timestamp: May 17, 2019, 03:07:56 pm
content: Quote from: donkey77 on May 16, 2019, 10:23:52 pmCareer-wise is a different selection process altogether. Unless you're talking low volume devices, you'll need to get used to using the cheapest MCUs on the market - that means squeezing every inch out of a low cost MCU rather than using much more capable devices.For general use, there's not much difference between any device - they all have their quirks and odd features

author: rstofer
author_rank: Super Contributor
timestamp: May 17, 2019, 05:41:54 pm
content: It isn't the CPU that is important, it's the peripherals and how they are programmed. Especially those that are connected to a DMA channel. The CPU adds and subtracts, the peripherals do the work.In many ways, once you have configured a serial port on one device, you have done it on all of them. At some level, they all work the same way. The details are different but the ideas are the same. Same with the NVIC, SPI, I2C and other port functions (input vs output, analog vs digital). The real learning is in how to configure these from bare iron.Here is an elegant example of coding for the NXP LPC2148 (ARM7TDMI-S) and all of its peripherals:http://www.jcwren.com/arm/There's a lot to learn from this project. Not so much in the application but rather in the way every single peripheral is configured. Of course it also has a filesystem (FatFS) and real time operating system (FreeRTOS). It's an older ARM chip but it's a lot of fun to play with and the code is a great example of doing things right.Programming via ICSP (serial port) or JTAG - again, get the serial port working first!https://www.olimex.com/Products/ARM/NXP/LPC-P2148/One of my favorite boards!

author: NorthGuy
author_rank: Super Contributor
timestamp: May 17, 2019, 06:10:33 pm
content: Quote from: rstofer on May 17, 2019, 05:41:54 pmIMHO, configuring "bare iron" is not a good place to start learning. Things that you mention are simple communication protocols, and what is worth learning is how they work - what is happening on the wire, what is the timing etc. Once you figure that out, it makes much easier easy to configure "bare metal" despite the set of registers on different MCUs may be very different.Same about interrupt controllers. What is worth learning is what are the interrupts, how do they happen, what happens to the main program when an interrupt happens etc. Once this is understood, it won't take long to configure the interrupt controller.

author: KC0PPH
author_rank: Unknown
timestamp: May 17, 2019, 06:59:43 pm
content: Decided to look into the STM32 series and am going to buy a development board. I am pretty good with the PIC32 and have been thinking about moving from the MX to MZ due to graphics. Considering that is a big jump, why not explore another mfg. Undecided on which demo board to get. Probably the Discovery with the STM32F7 as it comes with an integrated display for tinkering.

author: rstofer
author_rank: Super Contributor
timestamp: May 17, 2019, 07:33:09 pm
content: Quote from: NorthGuy on May 17, 2019, 06:10:33 pmI have always thought there were just two choices: Use a library written by somebody else and about which I know essentially nothing or write my own code. Arduino versus bare iron.Understanding library code is a lot more difficult because it will inevitably be splattered with conditional compilation depending on a specific board/chip/device/<whatever>. This is very general, of course, but essentially impossible to understand without a lot of effort. It truly is easier to read the datasheet and write device specific code. Sure, it's not 'general' but it will be understandable.

author: rstofer
author_rank: Super Contributor
timestamp: May 17, 2019, 07:55:52 pm
content: Quote from: KC0PPH on May 17, 2019, 06:59:43 pmIt might be worth understanding the difference between the Discovery and Nucleo boards. I have both and the Nucleo boards seem more useful but I can't say I have built anything with either flavor.

author: NorthGuy
author_rank: Super Contributor
timestamp: May 17, 2019, 08:30:23 pm
content: Quote from: rstofer on May 17, 2019, 07:33:09 pmYes, of course.But that's not where you start to learn. If you want to do UART, for example, you don't start from figuring out what registers to write or what library functions to call. You start from learning what UART is and how UART works. This lets you figure out how to deal with UART. This is very simple, very little, and you do it only once. And it works for every MCU, FPGA, or whatnot the same.Memorizing register names (or library function names for that matter) does not really help - it takes only a minute to look them up in the datasheet, they are different for different MCUs, are they are likely to change in the future. But I'm sure if you know how UART works, it won't take you long to make it work on any MCU - the UART modules are specifically designed to do UART. Consulting the datasheet is not a big deal. For example, I used UART in PIC16s many times, but I don't remember what's the write register name. TXBUF comes to mind, but it doesn't really sound right. Looking at the datasheet ... TXREG it is. Took me 40 seconds. Now I will remember for few days, may be weeks, then I'll forget and will have to look it up again. This doesn't bother me a bit.But if you know nothing about UART, it'll be next to impossible to write your own code. It may be even difficult to understand the datasheet. Thus you will have to use something written by others. Whether the code deals with registers, or a library, it may or may not work. And if it doesn't, you're doomed, because you have no idea what might've gone wrong.Of course, after you learn UART inner workings, the library will look to you as a redundant extra layer which doesn't add anything to the mix except limitations, annoyances, and bloat.

author: rstofer
author_rank: Super Contributor
timestamp: May 17, 2019, 10:00:50 pm
content: Quote from: NorthGuy on May 17, 2019, 08:30:23 pmThe OP has some level of experience with Arduinos. The Arduino doesn't deliberately expose the UART so it may not be useful experience. But at least he knows he needs serial IO. Google for 'stm32f serial IO' and here comes:http://embedded-lab.com/blog/stm32-serial-communication/If the OP knows nothing about the STM32F USART, he'll do what every other programmer does when they first start with bare metal: Hit up GoogleMaybe at some point the OP will want interrupt driven serial IO - hit up Google:https://ioprog.com/arm-cortex/stm32/stm32f0discovery/serial-communications-on-the-stm32f0discovery/The downsides of using DMA mean I won't be searching for that solution to this particular peripheral but Google did turn up some hits.Interrupt driven serial IO is a long leap from the polled solution. It'll be a while...Most everything I have learned about uCs has been in the form of copy and paste - then refine.The tricky part of all newer ARM chips is the clock. There are clock domains all over the place and many are turned off by default. Just getting clocks to all the peripherals can be a challenge. Nevertheless, once burned, twice shy. Once the programmer discovers that clocks are a nightmare, they'll start there. There are also some power management features that need to be discovered.Create simple example projects - test just one peripheral at a time. Write a lot of comments in the code about WHY everything is done the way it is. Then integrate the peripherals to form a project.I personally favor the chips I know and they are all obsolete: LPC2106, LPC2148 and LPC1768 (more modern). For ARM chips, they are simple and straightforward. Over the years the chips have become much more complex and that's the reason the factories are providing so much library code.The HAL code is generally thought to be bloated and over the top. The thing is, it allows the programmer to concentrate on the application and not the nits of the chip. It's not really a bad way to start.The Cypress PSOC tools create exactly the right code to implement exactly what is desired. They don't generate the application but they do darn near everything else. And they do it well! I really like the PSOC 6 and the video series is outstanding:There are so many chips and so little time! I think ARM is the way to go and I suppose it might as well be a current incantation so there is no reason not to use the STM32Fxxx devices. The boards are cheap, code is all over the place but I do wonder if the learning curve is going to be too steep. That's another reason to look at the PSOC 6; the video series. Sometimes a little hand holding goes a long way.ETA:The PSOC 6 has an ARM-M0+ and an ARM-M4 core. The video series deals with multicore applications.https://www.cypress.com/products/32-bit-arm-cortex-m4-psoc-6

author: techman-001
author_rank: Frequent Contributor
timestamp: May 18, 2019, 01:12:04 am
content: Quote from: rstofer on May 17, 2019, 07:33:09 pmAs someone who first programmed ROMs with 3 different timing critical voltages ( or the expensive $70 chip would blow up ) in the mid 1970's I couldn't agree with you more.I come from a era when there were no 'libraries', no ready made cheap hardware so everything started at the data book. Burners were designed and built or the ROMs couldn't be used. The only alternative was to write the machine code and send it to the ROM manufacturer who would make a mask and the program would be inserted at the chip manufacturing stage with minimum runs in the 100,000's.The boss would just throw a box with some new chip, and a data book on my desk and say "make a burner for that'. No Internet just the data book.I learnt to love data books and I still do because they are the heart and soul of the hardware.I've written my own Forth libraries for every stm32F0 peripheral I've used, it's easy enough, Cortex-M0's practically run themselves, this isn't 1974 any more this is the golden age of microprocessors and softwareI tested Mbed on a $13USD NUCLEO_L073RZ board the other day, very easy to use. The Mbed binary for a one led blinky was 26,076 bytes. Did they use a blocking or non blocking delay ? I don't recall the documentation mentioning it.I can do the same in Assembly in 80 bytes using a blocking delay.Ignorance and inefficiency are some of the prices of using other peoples libraries.

author: NorthGuy
author_rank: Super Contributor
timestamp: May 18, 2019, 04:04:20 am
content: Quote from: rstofer on May 17, 2019, 10:00:50 pmNot this. This is an absolutely horrible article written by a person who understand very little in embedded programming in general and in serial communications in particular.The best place to start is something of this sort:https://en.wikipedia.org/wiki/Universal_asynchronous_receiver-transmitter

author: luiHS
author_rank: Frequent Contributor
timestamp: May 18, 2019, 04:30:44 am
content: The best without hesitation, ARM NXP > RT1020 (Cortex M7 500Mhz), MCUXpresso.Cheap, powerful, environment and C/C++ compiler totally free, cheap evaluation boards, a great NXP community, excellent official support both in forums and private.I have worked with Microchip (PIC32) and STM32, and right now without hesitation, RT1020 is the best and with the best future in the market.