element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Embedded and Microcontrollers
  • Technologies
  • More
Embedded and Microcontrollers
Polls Favorite microcontroller language?
  • Blog
  • Forum
  • Documents
  • Quiz
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Embedded and Microcontrollers to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Engagement
  • Author Author: neuromodulator
  • Date Created: 20 Oct 2018 7:22 PM Date Created
  • Last Updated Last Updated: 11 Oct 2021 2:58 PM
  • Views 1915 views
  • Likes 1 like
  • Comments 12 comments
Related
Recommended

Favorite microcontroller language?

I like C++ a lot, specifically I love OOP and the STL. If I had to write everything in plain C I would end up writing a lot of boilerplate code ('\0' supporting strings structures and functions; and container-alike structures and functions), time I would rather like to spend on the system functionality. Still, C++ is not well supported on microcontroller, as plain C has been the defacto for a long time.

 

What is your favourite language when programming microcontrollers and why?

  • Share
  • History
  • More
  • Cancel
  • Sign in to reply

Top Comments

  • shabaz
    shabaz over 6 years ago +7
    Hi! I think for most people the beginner language might still be C with just a bit of C++ (i.e. just classes), since this is what the Arduino IDE and many example programs for Arduino use far as I can…
  • genebren
    genebren over 6 years ago +6
    I mostly use C, but I will drop down to assembly for critical timing needs.
  • glennvanderveer
    glennvanderveer over 6 years ago +6
    I am also an old school programmer from a time when RAM/ROM were at a premium and C and assembly were the only way to make programs fit and run with the limited resources...
  • gsgill112
    gsgill112 over 6 years ago

    C will always be my first love no matter what image its a beautiful language and one I never get tired off but yet sometimes I really get stuck image

     

    Regards,

    • Cancel
    • Vote Up +4 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • beacon_dave
    beacon_dave over 6 years ago in reply to clem57

    "I only mentioned it for anyone thinking of languages."

     

    As far as I understand it (so far), it is a 'framework' and not a language. Python is the language whereas PYNQ is the framework providing all the drivers, API's, libraries to allow Python to play nicely with the Zynq hardware, resulting in the 'Python productivity for Zynq'.

     

    As for microcontrollers, it perhaps gets a little more 'interesting' when you start to use the Jupyter Notebook 'magic's' within the PYNQ framework to additionally write code blocks in other languages such as C to run on the PicoBlaze/MicroBlaze soft processors implemented in the FPGA hardware... Xilinx after all refer to PicoBlaze as an 8-bit microcontroller core.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • clem57
    clem57 over 6 years ago in reply to Fred27

    Agreed. I only mentioned it for anyone thinking of languages.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Fred27
    Fred27 over 6 years ago in reply to clem57

    I'm not sure you can count Zynq as a microcontroller. It's s little bit more than just that! As far as I know the Python bit of Pynq isn't running directly on the ARM core - there's a Linux OS in between.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • clem57
    clem57 over 6 years ago

    Pynq since the syntax is Python. Indentation is a must.image

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • korn
    korn over 6 years ago

    My oldest and probably most used over the years is MeLabs PicBasicPro.  I've been using that for well over a decade now.

     

    What language I use is usually driven by the project and especially the people I need to work with. I'll use what they know  to speed up things.

     

    For most things PIC I can get anything done in picbasicpro. I've even taken a project from mplab ide and rewrote it..... I think the real reason is so much code I've  already written is there waiting for me... Tons of reusable stuff and what seems like almost bulletproof Interrupt driven USB routines from Darrel Taylor.

     

    I hate to admit it but I still use the old 16c5X OTP chips. The flash chips are great for development but when I'm done if I can cram it in a 12c509, 16c54 or 16c57 I will. I even have a few 16c711's left for simple USB stuff. My old Galep III still get used for these. I keep an XP machine around with a parallel port just for this. .....

     

    I will use the arduino IDE for hacker stuff. Its great for playing around. I spend a lot of time tweaking the libraries though.  I guess that means my second favorite is C

     

    I do have the MPLAB IDE loaded up and kept current for any official or "fancy" PIC stuff. And ATMEL Studio for the 328PB Xplained boards I'm playing with right now....

    • Cancel
    • Vote Up +5 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • johnbeetem
    johnbeetem over 6 years ago

    I use the term "microcontroller" to mean a single chip with a fairly weak CPU, a moderate amount of non-volatile memory (usually Flash or FRAM), and a small amount of RAM (usually SRAM).  Since the MCU has limited processing power and memory, it's important to use those resources efficiently.  Thus I prefer to program it in C, which is essentially a portable assembly language that uses high-level language notations.  C and ASM make it a lot easier to keep track of low-level resources and use them efficiently.  With a good compiler, C is usually as efficient as ASM these days so there's rarely a need to program in ASM.  Plus C source code is more compact than ASM and is (mostly) portable so you can use the same source code if you switch processors.

    • Cancel
    • Vote Up +5 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • michaelkellett
    michaelkellett over 6 years ago

    For me it's C !

     

    C is an amazing, and possibly unique, engineering tool.

     

    It manages to come closer to Einstein's "as simple as possible but not too simple" than pretty much anything.

     

    You can use it to write a three line port toggle, or GIT (written AFAIK in C. not C++).

     

    It gives you the close control you need in embedded micro-controller programming but has the power to do the hard stuff.

     

    It's simple enough that the compilers actually work.

     

    It's easy to learn.

     

    I'm frequently struck by just how well it hangs together.

     

    Of course it isn't the right tool for everything, you need VHDL for FPGAs and Visual Basic 6image for PCs.

     

    MK

    • Cancel
    • Vote Up +6 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • shabaz
    shabaz over 6 years ago

    Hi!

    I think for most people the beginner language might still be C with just a bit of C++ (i.e. just classes), since this is what the Arduino IDE and many example programs for Arduino use far as I can tell (I don't use Arduino much). Lots of people start with Arduino it seems.

    Similarly, mbed provides this too. The newer programmers (learning with say micro:bit) have the option of Python, scratch etc., since that is supported in the online development environment for micro:bit and some other boards too.

    For me, I like C with a bit of C++ for microcontrollers too. But it could change, since there is now massive amounts of resources on a microcontroller in comparison to a decade ago.

    But when writing an application for an SBC (e.g. Pi, BBB) running Linux, then I think the time has gone to write everything in C or C++ these days, because other languages make you more productive. Speed could be a concern of course, and then there are some choices to be made, e.g. drop down to a lower-level language like C++, or choose a different processor/SBC or do some offload, all depending on the task-at-hand. Sometimes I'll write bits in C++, and write the rest in some other language (JavaScript for me usually, but I'm experimenting more and more with Python - still not my favourite language, but if it works and gets me results then I'm willing to spend time learning it). From my perspective that is the best of both worlds, speed&familiarity with C or C++, and speed of development for the non-time-sensitive parts of the application with JavaScript or Python.

    A similar thing is possible with microcontrollers; script using (say) LUA, write the rest in C perhaps. I've not used LUA so far though, but I intend to sometime.

    • Cancel
    • Vote Up +7 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • dougw
    dougw over 6 years ago

    I have not discovered my favorite programming language yet, possibly because I haven't learned very many of the modern languages. (I've tried about 4 or 5 that were developed after 2000)

    All of the above languages are ancient. and none of the above languages are in the top 3 most popular programming languages in the world today.

    Some of the other popular languages would be:

    Java, JavaScript, SQL, C#, Python, PHP, Ruby on Rails, Scala, node JS, Go, Rust, Kotlin, Swift, Elixir, R, VB.Net, Perl, Visual Basic, MATLAB, Scratch, Lua

    I don't claim to be a programmer (although I've written many hundreds of programs)  and I do not aspire to write large programs that take months or years to develop, so simplicity and productivity are the keys for me in choosing a programming language. The development environment (IDE) is a big factor in productivity and can influence the choice of language.

    • Cancel
    • Vote Up +4 Vote Down
    • Sign in to reply
    • More
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube