Tuesday, July 7, 2009

Embedded Software Developing USING C Programming language ( C Programming)

Embedded Software in C Using ICC11/ICC12/Metrowerks



Chapter 1: Program Structure
A sample program introduces C
C is a free field language
Precedence of the operator determines the order of operation
Comments are used to document the software
Preprocessor directives are special operations that occur first
Global declarations provide modular building blocks
Declarations are the basic operations
Function declarations allow for one routine to call another
Compound statements are the more complex operations
Global variables are permanent and can be shared
Local variables are temporary and are private
Source files make it easier to maintain large projects


Chapter 2: Tokens
ASCII characters
Literals include numbers characters and strings
Keywords are predefined
Names are user
defined
Punctuation marks
Operators


Chapter 3: Literals include numbers characters and strings
How are numbers represented on the computer
8-bit unsigned numbers
8-bit signed numbers
16-bit unsigned numbers
16-bit signed numbers
Big and little Endian
Boolean (true/false)
Decimal numbers
Hexadecimal numbers
Octal numbers
Characters
Strings
Escape sequences


Chapter 4: Variables
A static variable exists permanently
A static global can be accessed only from within the same file
A static local can be accessed only in the function
We specify volatile variables when using interrupts and I/O ports
Automatic variables are allocated on the stack
We can understand automatics by looking at the assembly code
A constant local can not be changed
External variables are defined elsewhere
The scope of a variable defines where it can be accessed
Variables declarations
8-bit variables are defined with char
Discussion of when to use static versus automatic variables
Initialization of variables and constants
We can understand initialization by looking at the assembly code



Chapter 5: Expressions
Precedence and associativity
Unary operators
Binary operators
Assignment operators
Expression type and explicit casting
Selection operator
Arithmetic overflow and underflow


Chapter 6: Flow of Control
Simple statements
Compound statements
if and if-else statements
switch statements
while statements
for statements
do statements
return statements
goto statements
Null statements


Chapter 7: Pointers
Definitions of address and pointer
Declarations of pointers define the type and allocate space in memory
How do we use pointers
Memory architecture of the 6811 and 6812
Pointer math
Pointer comparisons
FIFO queue implemented with pointers
I/O port access


Chapter 8: Arrays and Strings
Array Subscripts
Array Declarations
Array References
Pointers and Array Names
Negative Subscripts
Address Arithmetic
String Functions defined in string.h
Fifo Queue Example



Chapter 9: Structures
Structure Declarations
Accessing elements of a structure
Initialization of structure data
Using pointers to access structures
Passing structures as parameters to functions
Example of MC68HC812A4 extended addressing
Example of a Linear Linked List
Example of a Huffman Code


Chapter 10: Functions
Function Declarations
Function Definitions
Function Calls
Parameter Passing
Making our C programs "look like" C++
Stack frame created by ICC11 and ICC12
Animation of ICC12 function call
Finite State Machine using Function Pointers
Linked list interpreter



Chapter 11: Preprocessor Directives
Using #define to create macros
Using #ifdef to implement conditional compilation
Using #include to load other software modules
Using #pragma to write interrupt software


Chapter 12: Assembly Language
How to insert single assembly instructions
How to compile with a mixture of assembly and C files
Assembler Directives
How to use assembly to optimize a C function


Appendix 1: Kevin Ross BDM - Adapt812 Interface
Kevin Ross's Background Debug Module
ICC12 options menu for developing software for the Adapt812
Adapt 812 Board Jumpers
What you need to get started
Development Procedure
Web sites for more information


Appendix 2. Metrowerks TechArts 9S12C32 Setup
What you need to get started
Installing Metrowerks
Instructions for handling the Technological Arts 9S12C32 board
Development Procedure
Interrupt vectors for the 9S12C32
Web sites for more information.

No comments:

Blog List