Transcription of 8-bit Microcontroller Application Note
{{id}} {{{paragraph}}}
1 AVR035: efficient C Coding for AVRF eatures Accessing I/O Memory Locations Accessing Memory Mapped I/O Accessing Data in Flash Accessing Data in EEPROM Creating EEPROM Data Files efficient Use of Variables and Data Types Use of Bit-field and Bit-mask Use of Macros and Functions Eighteen Ways to Reduce Code Size Five Ways to Reduce RAM Requirements Checklist for Debugging Programs Updated to Support IAR Version 2 CompilersIntroductionThe C High-level Language (HLL) has become increasingly popular for programmingmicrocontrollers. The advantages of using C compared to Assembler are numerous:Reduced development time, easier maintainability and portability, and easier to reusecode.
If consecutive memory mapped addresses are accessed, the most efficient way to access them is to declare a constant pointer and add an displacement value to this off-set. The example below shows how to access memory mapped I/O this way. The generated assembly code for each instruction is shown in italic. /* Define the memory mapped addresses */
Domain:
Source:
Link to this page:
Please notify us if you found a problem with this document:
{{id}} {{{paragraph}}}