Course M309 - Advanced C Programming of Microchip 32 bit Microcontrollers using MPLABX and the XC32 C Compiler
Duration: 5 Days
Intended Audience
Attendees should have some experience of embedded systems programming and a good basic knowledge of the C language, and have a keen interest in mastering more advanced algorithms and data structures of use in embedded systems application development.
Synopsis
The course emphasises the implementation of disciplined and well structured code and the design of modules with clean interfaces. Topics covered include:
- Advanced use of dynamic data structures and algorithms for manipulating them.
- Structured interrupt handling
- Strategies and patterns for the implementation of basic multi-tasking applications
- Basic and Extended finite state machines and their uses
- More advanced data structures and algorithms - binary trees, heaps, hash tables, CRC checksums
Course Outline
- Intensive overview of essential C concepts and idioms
- Data types, data structures, pointers and arrays
- Using pointers to search collections of data
- Arrays and buffers
- Circular buffers
- Polygonal buffers
- I/O vectors
- Linked Lists in depth
- Singly linked and doubly linked lists
- Using lists to implements FIFO queues and LIFO queues (stacks)
- Using lists of linked lists
- Using linked list nodes containing void * pointers to implement heterogeneous collections of data
- Using linked lists to implement resizeable arrays
- Binary trees, their uses and their relations
- Basic binary trees
- Overview of Self-balancing binary trees (AVL, Red-Black, Splay)
- Heaps and their uses
- Overview of Huffman encoding
- Overview ofPriority queues
- Error detection
- CRC checksums (16 bit and 32 bit)
- Implementing simple memory management schemes
- Implementing simple flash memory file systems
- State Machines and Statecharts
- Event driven programming
- Basic FSMs
- Overview of FSM approaches to simple Pattern matching and Parsing of structured messages
- State driven hardware and communication protocols
- Implementing FSMs using switch statements
- Implementing FSMs using a table driven approach
- Limitations of FSMs
- Extending FSMs by adding variables and conditional transitions
- Nesting state machines (push down automata)
- Basic multi-tasking concepts
- Task life cycle
- Task management
- Communication between tasks
- Controlling access to shared resources using semaphores
- Timers and schedulers
- Designing Device drivers for small embedded systems