Sunday 10 July 2016

microcontroller - Programming languages for electronics engineers


I am an Electronics and Communications Engineering student, before I got to college, I have been interested in programming and computer applications. I had focused on designing Windows applications and learning its techniques, but now, I feel that this is useless in my field... I don't have to learn everything about computer science and developing software! (Am I right about this?)


I know VB .Net, C# and C++. I have plenty of time in my holiday so I want to delve deeper programmatically in "electronics field". So what would you recommend to learn or to focus on?


I want those languages used in programming Microcontrollers and other integrated circuits. Is C++ enough or I should master C as well? Tell me your thoughts please.



Answer



Yes, it's almost certainly a good move to learn to use C as well as possible (C++ will give you a helpful starting point, although as leftaroundabout notes, there will still be plenty to pick up, especially the differences between coding for small embedded systems compared to writing for something like Windows) given it's ubiquity.


Most microcontrollers below a certain size (e.g. PIC, AVR, MSP430, etc) use C (or assembler) as there are many high quality (free and $$ versions - e.g. many commercial compilers are based upon the free GCC compiler) C compilers available.

You do get other languages like the excellent JAL for PIC (original author Wouter Van Ooijen who is a member here), PICBASIC, Ada variants, but due to it's popularity and number of compilers available, I'd say C is the language of choice for most. While this certainly doesn't mean it's the best language, using the most popular language comes with obvious advantages (documentation, support, portability, collaboration, etc)
For the more complex and larger 32-bit micros like many ARM variants, there are also C++ and other compilers available.


I would jump right in and grab a few development boards and get coding. You could pick a low end 8-bit micro like the PIC16F (many starter kits on Microchip Direct)
A middle of the range 16-bit micro like the PIC24, and also a C/C++/embedded linux ARM of some sort - the STM32F4 ARM Cortex M4 Discovery is an very cheap dev board that might be worth grabbing.
On the programmable logic and hardware description language (HDL - the big two are Verilog and VHDL) side, it may be also worth getting hold of an FPGA or CPLD dev board from Diglent or similar.


If you don't want to wait for a dev board, you could download MPLAB or MPLABX and use the excellent simulator to try your hand at PIC development. Same goes for other tools too, for instance you can download Xilinx ISE Webpack for free and try out HDLs and programmable logic design.


No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...