Question:
What is the best computer programming language for an electronic engineer?
John Samarasinghe
2013-08-29 22:36:29 UTC
I am a student studying Mechatronic engineering. Sometimes my projects involve data input and output from an MCU to a computer program. (for example: serial communication). I do not know how to create PC applications at all. Please let me know what's the best programming language to learn to do this?
Four answers:
?
2013-08-30 00:55:58 UTC
Micros are usually programmed in assembler, and this means a different assembler for each processor type (vendor/manufacturer dependant)

Many manufacturers of micros provide an IDE for their programming (often C and Assembler).

Otherwise, C and C++ are quite useful.



One restriction, though: compiled C/C++ sources result in a binary 6 to 10 times BIGGER than the same code developed directly in assembler! I re-wrote a C code in assembler: C: 12Mb, Assembler: 2Mb! When the E2P of the chip is limited, this counts...
anonymous
2013-08-30 12:19:09 UTC
Arduino is a new programming language used by many electronics engineers and that's what it does "Arduino is a great tool for developing interactive objects, taking inputs from a variety of switches or sensors and controlling a variety of lights, motors and other outputs. Arduino projects can be stand-alone or they can be connected to a computer using USB. The Arduino will be seen by the computer as a standard serial interface (do you remember the COM1 on Windows?). There are serial communication APIs on most programming languages so interfacing Arduino with a software program running on the computer should be pretty straightforward.



The Arduino board is a microcontroller board, which is a small circuit (the board) that contains a whole computer on a small chip (the microcontroller). There are different versions of the Arduino board: they are different in components, aim and size, etc. Some examples of Arduino boards are: Arduino Diecimila, Arduino Duemilanove, Freeduino, Arduino NG and lot more. Arduino schematics are distribute using an open licese so anyone is free to build his own Arduino compatible board. The Arduino name is a registered trademark so you won't be able to call your hacked board Arduino." I remember to have used it during my A+ course.
crofoot
2016-12-12 20:45:25 UTC
Electronic Programming
justme
2013-08-30 08:10:33 UTC
Typically microcontroller programs are written in C (rarely if ever C++) these days. Some still use assembly but that is only if you need very optimized code, otherwise the C compiler does a pretty good job at optimization.



Being an electrical engineer, knowing C would be helpful. If you need to write applications to run on a PC then you need to learn C++, especially if you need to interface with the serial port. Neither is a quick or wasy task to learn.



EDIT: I thought you were asking about applications on a PC. I use Microsoft Visual Studio (6.0 which is old) to create my applications. Most of the ones I do are windows based and not console programs which is why I use MVS but you can also do console applications with it. The language I use is C++ (although there are other languages you can use) because its the language I know the best.



I have done many applications that interface with microcontrollers through the serial port and ethernet (not USB though) and once you have the libraries to do it, its quite easy to do. I actually built some DLL's to do the interface so all I have to do is call the functions in the DLL's.



C++ and Microsoft Visual Studio are not easy to learn so its going to take quite a bit of time. Not sure if the latest versions even support C++. There are books that will walk you through setting up projects and building applications but make sure you get a book that matches the version of MVS you have!!


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...