Advanced C Programming for Microcontrollers
The course is for experienced C programmers, working on embedded systems, who would like to learn structured programming techniques, fill in gaps in their knowledge, and learn about more advanced data structures and algorithms.
It will also cover object oriented programming techniques as implemented in C, useful in projects where a UML design is to be realised in C and assembler.
Coverage of the MISRA programming guidelines for developing safety critical code are included, and the tools available for checking conformance to these guidelines are reviewed
Extensions to ANSI C that are provided by various compilers targeted at micro-controller based systems - such as pragmas, keywords for specifying a function as an interrupt handler, keywords for specifying special function registers, and addressable bits are critically discussed.
Code profiling, tuning and optimisation techniques are discussed, including discussion of situations where it might be better to implement modules in assembler that can be accessed via C function calls.
A considerable part of the course is devoted to detailed coverage of interrupt handling, multi-tasking via polled,interrupt driven and hybrid approaches, timer driven multi-tasking scheduler implementation, control of access to critical resources, memory and buffer management,and the implementation of device driver software.
|
Course Outline
C syntax - intensive overview
- Base data types, operators, functions, if .. else, switch, for loops, while and do - while loops
- structures, arrays of structures and pointers to structures
- function pointers
- C Macro pre-processor
Finite State Machines (FSMs)
- Event driven systems
- FSM diagrams
- Switch statement implementation of an FSM
- Table driven implementation of an FSM
- Push Down Automata
- Extending FSMs via Statecharts
- Implementing Statechart designs in C
Modular code - Components and Object Oriented Coding in C
|