What’s wrong with assembler?Assembler language programming gives very precise control over code,Such as execution time, program size, data location etc.Assembler programming however, does require a significant amount of disciplineThe specifics of microcontroller hardware needs to be well understood, hardware registers, as well as instructions, general purpose register allocation, program & data layout etc.Each microcontroller AVR, Microchip , Motorola etc. will have hardware & instruction set differences, making it difficult to re-use code from one microcontroller on another.The compactness of program and speed of operation are beyond question.It is often difficult to re-use code written for one application for another.Often however, we may not need this compactness or operating speed and the convenience of software of development may be more important.
What’s right with C ?C is a programming language developed by Kernighan & Ritchie. C is a basic Programming language from which most of the modern programming languageshave been derived.There are many tasks which are common to all microcontrollers such as mathematics, standard input & output, string handling etc. Standard libraries exist for most functions that you wish to execute.Most microcontrollers can be written in C and the AVR ATMega128 is noexception. By using C, much code can be written, which will potentially runon any microcontroller and hence can be ported from one controller to the next.Code is more easily re-used.Some specific microcontroller knowledge is required, but much of the tediumis obviated. Floating point numbers & mathematical functions are easilyImplemented.To write code for the AVR ATmega128, a C complier is required which convertsthe C instructions into suitable binary code. There are many compilerswhich will perform this task. These can cost from $0 to $1000
This preview has intentionally blurred sections.
Sign up to view the full version.