PROGRAMMING PIC MICROCONTROLLERS IN C:PERSISTENT VARIABLES AND ABSOLUTE ADDRESS VARIABLES

PERSISTENT VARIABLES Normally, the initial values of variables are cleared to zero when the program starts up (i.e. whenever reset is applied to the microcontroller). The persistent qualifier prevents a variable from being cleared at start-up. In the following example, the variable max is declared persistent and as a result its value is not cleared […]
Continue reading…

 

PROGRAMMING PIC MICROCONTROLLERS IN C:STORING VARIABLES IN THE PROGRAM MEMORY

STORING VARIABLES IN THE PROGRAM MEMORY In PICC Lite, variables are normally stored in the RAM memory of the target microcontroller since the value of a variable is expected to change during the running of a program. There are many variables whose values do not change during the lifetime of a program, and these variables […]
Continue reading…

 

PROGRAMMING PIC MICROCONTROLLERS IN C: STATIC VARIABLES AND VOLATILE VARIABLES

STATIC VARIABLES Static variables are usually used in functions. A static variable can only be accessed from the function in which it was declared. The value of a static variable is not destroyed on exit from the function, instead its value is preserved and becomes available again when the function is next called. Static variables […]
Continue reading…

 

PROGRAMMING PIC MICROCONTROLLERS IN C

Microcontrollers have traditionally been programmed using the assembly language. This lan- guage consists of various mnemonics which describe the instructions of the target microcon- troller. An assembly language is unique to a microcontroller and cannot be used for any other type of microcontroller. Although the assembly language is very fast, it has some major disad- […]
Continue reading…