So recently in school we have started programming klm25z boards using ARM Assembly. I was wondering if in most industry jobs, microcontrollers are really programmed in assembly over C. It seems to take at least 2-3 times longer to program in assembly and does not seem to have any significant enhancements in speed, that are at least noticeable.
2 Answers
Most end-user applications are written in C or a close derivative of C, or another language, like Lua or BASIC or something. However, a lot of the really interesting jobs with microcontrollers require a thorough understanding of assembly, because you're writing or supporting the libraries, doing things with new parts that don't have support in a high-level language yet, building and troubleshooting circuits by reading datasheets that are written in terms of assembly instructions, etc.
In other words, if you want to work or do hobbies using prebuilt circuits and libraries, you don't often need assembly. If you want to be the guy that builds those circuits and libraries for other people to use, assembly will come up a lot. That's why schools make you do it the hard way.
- 148,830
Most of the embedded solutions are written in C. The reason being, C is a very powerful language and the user has a lot of control on hardware. On the other hand it also helps you create abstractions, however the development has to be done by the team.
This is the reasons most semiconductor companies provide C/C++ compiler with their toolset.
One resorts to assembly only when looking for very precise timings of hardware or control. However, this is on the decline especially with the increase of speed in semiconductors and the use of real time operating system.