MCP 201: Fundamentals of Embedded C
No previous programming experience is required for this course, only basic PC usage is essential.
Course Duration
- Five days at 5 hours per day.
Course Materials
- Comprehensive delegate handbook.
Course Objectives
- Provide basic understanding of PIC microcontrollers design and programming using C language.
- Demonstrate a simple practical utilization of PIC microcontrollers for real-world applications using C.
Participants Will Learn
- Fundamentals of Embedded C programming.
- How to program a PIC16 microcontroller using C.
- Introduction to Embedded C (MikroC, CCS, MPLABC).
- Introduction to PIC18 microcontrollers: Architectural overview, CPU, instruction sets, stack, development tools.
- Primitive Types, Variables and Constants: Variable types, declaration, variable scope, local variables, global variables, numeric constants, enumerations, declaration and initialization, naming convention, assignment and arithmetic operators, type casting, precedence and associativity.
- Control Statements
- Sequential Statements
- Conditional Statements: Logical operators, comparison operators, if/else, switch/case.
- Looping: While loop, for loop, do-while loop, endless/infinite loops.
- Goto, Break and Continue Statements.
- Functions: Prototypes, functions with return types, functions with parameters/arguments, recursion.
- Arrays: Declaring an array, assigning values/elements to an array, sorting array elements.
- Memory Organization and Types, Real-Time Methods and I/O Ports: Register variables, using interrupts, counters and resets, state machines, data memory flash memory, return address stack, parallel slave port (PSP) mode.
- Timers: Timer0, Timer1, Timer2, watchdog timer, Serial I/O, USART, CAN, SPI, I2C, ADC
- Compiling and running programs: Introduction, compiling your program, assembling your program, download/burn/program code to microcontroller.
Lab
- Interfacing Different Hardware to Microcontrollers:
- LCD
- Seven Segment Display
- Keypad
- Stepper Motors
- PC Computer
Development Tools
- MikroC/Pic-C/MPLAB, Keil C, IAR, PICBasic Pro Integrated Development Environment (IDE), compiler, linker, simulator, programmers, PIC development boards.