Assembly Programming -III
In this module, students will explore advanced assembly programming concepts, focusing on the PIC16(L)F18855/75 microcontroller and its ADC2 module. This module is designed to provide an in-depth understanding of the ADC2 functionalities and configurations, along with practical lab assignments that reinforce theoretical knowledge through hands-on projects.
Part 1: Introduction to PIC16(L)F18855/75 ADC2 Module
This section introduces the ADC2 module, which allows the conversion of analog input signals to 10-bit binary representations. Key features include:
- Sample and Hold Circuit: Captures and holds the analog input voltage.
- Successive Approximation Converter: Performs the analog-to-digital conversion.
- Result Registers (ADRESH:ADRESL): Store the conversion results.
- Advanced Features: 8-bit acquisition timer, capacitive voltage divider (CVD) support, automatic repeat and sequencing, computation features such as averaging and low-pass filter functions, and selectable interrupts.
Part 2: Detailed Configuration and Operation of the PIC16(L)F18855/75 ADC2 Module
This section covers the detailed configuration and operation of the ADC2 module, including:
- Port Configuration: Setting the I/O pins for analog input.
- Channel Selection: Choosing the appropriate analog input channel.
- Voltage Reference Selection: Configuring the positive and negative voltage references.
- Conversion Clock Source: Selecting the clock source for the ADC.
- Interrupt Control: Enabling and handling ADC interrupts.
- Result Formatting: Choosing between left-justified and right-justified formats for the 10-bit conversion result.
- Starting and Completing a Conversion: Procedures for initiating and completing an ADC conversion.
Readings Specific to Lab Assignments
This section provides readings and resources specific to the lab assignments, helping students understand the practical applications of the ADC2 module and other microcontroller features.
Lab #8: Make Three Programs Using External Circuit
In this lab assignment, students will write three assembly programs to interact with external circuits. The lab will cover:
- Configuring I/O Ports: Setting up the microcontroller ports for external circuit control.
- Using External Inputs and Outputs: Implementing programs that read from and write to external circuits.
- Creating Delay Routines: Adding delay loops to control the timing of interactions with external circuits.
Objectives:
- Understand how to configure I/O ports for external circuit control.
- Learn to use external inputs and outputs in assembly programs.
- Gain practical experience in writing and debugging assembly programs with delays.
Lab #9: Home Security System (Alarm System)
In this lab assignment, students will design and implement a microcontroller-based home security system. The lab will cover:
- Sensor Inputs: Configuring the microcontroller to read inputs from door/window sensors and motion detectors.
- User Interface: Implementing a keypad for arming/disarming the system and an LCD display for system status.
- Outputs: Controlling LEDs and a piezo buzzer or siren for alarm indications.
- Timing Considerations: Implementing entry/exit delays and alarm activation delays.
- State Machine: Managing the system’s behavior in different states (disarmed, armed, alarm triggered).
Objectives:
- Learn to configure sensor inputs and user interface components.
- Understand the importance of timing and state management in security systems.
- Develop skills in writing complex assembly programs for real-world applications.
Lab #10: Temperature Indicator
In this lab assignment, students will build and program a temperature indicator using the MCP9701 sensor and the ADC2 module. The lab will cover:
- Analog-to-Digital Conversion: Configuring the ADC2 module to read the temperature from the MCP9701 sensor.
- Temperature Calculation: Converting the ADC reading to a temperature value.
- LED Indicators: Using LEDs to indicate the temperature status (high, low, on target).
Objectives:
- Understand how to configure and use the ADC2 module for analog-to-digital conversion.
- Learn to calculate temperature values from ADC readings.
- Gain practical experience in writing assembly programs that interact with sensors and indicators.
These topics will be discussed in detail later in the module, providing students with both theoretical knowledge and practical skills in advanced assembly programming for the PIC16(L)F18855/75 microcontroller.