Editing Programming Languages
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
== Introduction == | == Introduction == | ||
− | + | Very high level languages are less suitable for microcontrollers, so the choices are less then one would find on a PC. The main programming languages used | |
− | + | in microcontrollers are Basic, C, and assembly. Microcontrolers are generally harder to program then PCs because it isn't as easy to view debugging output, it takes more time to flash a new firmware, and the tools are generally less developed then PC tools. One suggestion is to learn basic programming on a PC first and then migrate to embedded systems after gaining some understanding. | |
− | Very high level languages are less suitable for microcontrollers, so the choices are less | ||
− | |||
== Basic == | == Basic == | ||
− | Some people consider | + | Some people consider this to be the easiest programming language to learn. The language is line oriented so compilers tend to produce more debugable error messages. Basic can either be interperated as in the Basic Stamp from Parallax or compiled as in PicBasic. |
− | |||
− | |||
− | |||
− | |||
− | Basic can either be | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== C == | == C == | ||
− | C is a middle level language that is considered to be high enough for productivity but close enough to the hardware to have some of the power of assembly. C has free form formating rules so the look of C varies according to style and C compilers tend to produce harder to debug error messages. C is gaining in popularity | + | C is a middle level language that is considered to be high enough for productivity but close enough to the hardware to have some of the power of assembly. |
− | + | C has free form formating rules so the look of C varies according to style and C compilers tend to produce harder to debug error messages. C is gaining in popularity in microcontrollers as embedded systems are becomming more and more complex. C is almost always compiled instead of interperated. Advanced C requires understanding of pointers which requires lower level understanding of the hardware then some people are interested in going. Several free or demo versions of compilers such as variations of GCC for microcontrollers or C18/C30 for Microchip PIC processors are available. | |
− | Advanced C requires understanding of pointers which requires lower level understanding of the hardware | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== Assembly == | == Assembly == | ||
− | Assembly is a near exact mapping to the actual instructions executed by processors. It is very processor specific. | + | Assembly is a near exact mapping to the actual instructions executed by processors. It is very processor specific. Some architecture such as the older PIC processors are optimized for assembly programming where some RISC based architectors are optimized for higher level languages. Some C compilers do not produce the best possible code so writing in assembly can theoritically produce faster code, but poorly written hand assembly can be worse. Some people mix C and assembly in the same project and most compilers make it easy to integrate assembly in C programs. |
− | |||
− | |||
− | Some C compilers do not produce the best possible code so writing in assembly can | ||
− | Some people mix C and assembly in the same project and most compilers make it easy to integrate assembly in C programs. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |