Microcontroller Programming Languages
If you are a beginner, this article is good to know before you find knowledge of microcontrollers. This article discusses microcontroller programming languages that can be used to program chips of microcontrollers, especially Microcontroller Atmel Family. Before you read this article, It is better you have knowledge of what’s microcontroller, how’s to program the chip, etc.
Today, almost electronic devices, such as hand-phone, DVD player, Television, etc had been using a microcontroller as a main control system. The using of microcontroller has many advantages, such as:
· Small
· Low Cost
· Low Power usage
· All-in-one (CPU, ROM, RAM, I/O ports, others are integrated in the chip)
To make a microcontroller useful for us, it needs programs that can be downloaded into the chip. There are several ways how to write a program for the chip.
First, you can use assembly language (low level programming).
Assembly language is a symbolic representation of a microcontroller's native code. Using machine code allows the programmer to control precisely what the microcontroller. It offers a great deal of power to use all of the features of the microcontroller. The resulting program is normally very fast and very compact. In small programs it is also very predictable. Timings, for example, can be calculated very precisely and program flow is easily controlled. It is often used for small, real time applications.
Statements in assembly language are written using short codes for the instruction and arguments, such as "MOV $12 SP", as opposed to machine language, where everything is written as numbers. Assembly language can have comments and macros as well, to ease programming and understanding. Generally, programs called "assemblers" transform assembly language to machine language. This is a relatively straightforward process, there being a clear 1-to-1 transformation between assembly and machine language. This makes assembly language very fast.
However, the programmer needs to have a good understanding of the hardware being used. As programs become larger, assembly language get very cumbersome. Maintenance of assembly language is notoriously difficult, especially if another programmer is brought in to carry out modifications after the code has been written. Assembly language also has no support of an operating system, nor does it have any complex instructions. Storing and retrieving data is a simple task with high level languages; assembly needs the whole process to be programmed step by step. Mathematical processes also have to be performed with binary addition and subtraction when using assembly which can get very complex. Finally, every microcontroller has its own assembly language. If you use a new microcontroller, you need to learn a new language each time.
Second, you can use high level programming language (BASIC, C/C++, etc)
If you use high level programming, you can use one of languages, such as, C/C++, Basic, or others. This type programming is easier than assembly language. The way you make a program is the same as you make program with C or Basic languages for computer. However, you need software to convert high level to low level languages, called cross compiler. So, it takes much time than use assembly.
Statements in high level language are general for any type microcontrollers. The instruction codes are easy to read and understand. When you write a program for any type microcontrollers, you don’t have to know assembly language for that microcontroller. Cross Compiler will take care of transforming high level language program into assembly. However you need to select the target of microcontroller you want to use. Some cross compiler such as,
· Basic Stamp is a product of Parallax Incorporated. It’s designed to customize PIC microcontroller family can understand BASIC language
Compare to assembly language, you can program easier because there are a lot of functions, procedures and tools that help you programming and the language is more comprehensible. Though it is much easier to code in a high level language, oftentimes access to more low-level functionalities are lost. For instance, the ability to communicate directly with the compiler and alter code before it gets transferred into machine code is lost.
What is the casino? - SEPT
BalasHapusThe best casino online is the communitykhabar One of the main reasons why people are spending novcasino money on a game is by having a few 바카라 사이트 options. One of septcasino the reasons