Microchip Certified Training - PIC18 Intermediate Workshop using Assembly Code — A 4 day course
This hands-on course aims to provide engineers involved in product design with a detailed understanding of the features of the high-end PIC18 family of microcontrollers, and how to use the on-chip peripherals to create simple interfaces to real-world devices.
It will also explain how the linker provided with the Microchip development tools enables relocatable code modules to be created which can be re-used across multiple projects.
The course includes many practical workshop exercises which are interleaved with the relevant presentation material for maximum impact and variety. These exercises are carried out using MPLAB software running on a Windows PC, an ICD programmer/debugger and a target development board containing a PIC microcontroller on which programs created during the exercises can be observed to be running in real-time.
This course will enable delegates with the following skills:
- Gain a detailed understanding of the features of the PIC18 family of microcontrollers
- Obtain hands-on experience with the use of on-chip peripherals for applications such as timing, digital control, analogue input, pulse width modulation, event capture and serial communication.
- Be introduced to the use of the linker to create relocatable code modules
Overview of Microchip, PIC16 and PIC12 Architectures and Development Tools
Op-codes and addressing modes: immediate, direct, indirect, PC absolute and PC relative
Classes of operations performed by op-codes
Interrupt model and how to create interrupt service routines
On-chip peripherals: overview and detailed description
Special features: e.g., clock options, sleep mode, watchdog timer, brown-out detection
The MPLAB Linker
Overview of MPLINK and its relationship to the other MPLAB components
Use of linker scripts, command files and map files
Allocation of sections for relocatable code
Global and external declarations
Macros and macro assembler programming
Program specification and design using Pseudocode and Flowchards
Conversion of Pseudocode and Flowcharts into assembler code
Modular approaches to assembly language programming
Structured approaches to multi-tasking in assembler - polling approaches, interrupt driven approaches, hybrid approaches.
Finite State Machines and their implementation in assembler.
Making effective use of Interrupt Prioritisation
Understanding the implementation and functions of a bootloader
Porgramming techniques and patterns for power conservation
- Create, build and debug projects on the development board using MPLAB and the ICD
- Switch LEDs and other loads on and off using digital outputs
- Read an external keypad using wake-up from sleep mode on Port B digital inputs
- Display information on an LCD module
- Create a real-time clock display using timers and interrupts
- Read the values of analogue inputs using the A-to-D converter
- Collect data in the background using an interrupt handler routine
- Set up a Pulse Width Modulation (PWM) output with a variable duty cycle
- Measure the period of a pulse train using the capture/compare module
- Communicate with a PC over a serial interface using the USART peripheral
- Calculate a checksum for program memory using the microcontroller self-read capability
This course is aimed at engineers who are familiar with the baseline PIC18 architecture and wish to extend their knowledge of the capabilities of the higher-end micro-controllers as well as mastering more advanced structure assembly programming techniques.
Experience of assembly language programming is assumed, as well as familiarity with the Windows environment on a Personal Computer. Some knowledge of electronics will be advantageous for an understanding of the more advanced concepts presented during this course.