ELCT706 MicroLab Session #3 7-segment LEDs and Analog to Digital Conversion. Eng. Salma Hesham

Similar documents
International Islamic University Chittagong (IIUC) Department of Electrical and Electronic Engineering (EEE)

Chapter 11 Sections 1 3 Dr. Iyad Jafar

Data Conversion and Lab (17.368) Fall Lecture Outline

Interfacing Analog to Digital Data Converters. A/D D/A Converter 1

VikiLABS. a g. c dp. Working with 7-segment displays. 1 Single digit displays. July 14, 2017

Digital Clock. Perry Andrews. A Project By. Based on the PIC16F84A Micro controller. Revision C

Part (A) Controlling 7-Segment Displays with Pushbuttons. Part (B) Controlling 7-Segment Displays with the PIC

Analogue Inputs Resolution Assignment

Introduction to PIC Programming

RF4432 wireless transceiver module

Section bit Analog-to-Digital Converter (ADC)

Analog to Digital Conversion

Alice EduPad Board. User s Guide Version /11/2017

Fig. 1 Analog pins of Arduino Mega

CPE 310L EMBEDDED SYSTEM DESIGN (CPE)

Introduction to Mechatronics. Fall Instructor: Professor Charles Ume. Analog to Digital Converter

RF4432F27 wireless transceiver module

Ocean Sensor Systems, Inc. Wave Staff, OSSI F, Water Level Sensor With 0-5V, RS232 & Alarm Outputs, 1 to 20 Meter Staff

Converting between Analog and Digital Domains

Model Solution and marking scheme for Examination Paper EEE305J1: Microcontroller Systems 2004/5 General Observations

Tutorial on Technical and Performance Benefits of AD719x Family

EXPERIMENT 2: Elementary Input Output Programming

ADC Peripheral in Microcontrollers. Petr Cesak, Jan Fischer, Jaroslav Roztocil

Ocean Sensor Systems, Inc. Wave Staff III, OSSI With 0-5V & RS232 Output and A Self Grounding Coaxial Staff

Product Specifications

The Successive Approximation Converter Concept - 8 Bit, 5 Volt Example

Analog input and output

Analog-to-Digital Conversion

Converters: Analogue to Digital

SUBSYSTEMS FOR DATA ACQUISITION #39. Analog-to-Digital Converter (ADC) Function Card

Radio Clock with DCF77

Introduction to Embedded Microcomputer Systems Lecture Discrete digital signal. Continuous analog signal

MECE336 Microprocessors I

Combo Board.

Trial version. Analogue to Digital Conversion in Distance Measurement

64CH SEGMENT DRIVER FOR DOT MATRIX LCD

TV Synchronism Generation with PIC Microcontroller

Alice EduPad for Tiva or MSP432 TI ARM Launchpad. User s Guide Version /23/2017

Tutorial Introduction

Vorne Industries. 87/719 Analog Input Module User's Manual Industrial Drive Itasca, IL (630) Telefax (630)

Hello and welcome to this presentation of the STM32L4 Analog-to-Digital Converter block. It will cover the main features of this block, which is used

bit TFT Digital Driver Board Specification

Checkpoint 2 Video Interface

Embedded Systems. Interfacing PIC with external devices 7-Segment display. Eng. Anis Nazer Second Semester

35058-TE. PLJ-6LED-A LED Frequency Display Module Manual

Synthesized Clock Generator

Dynamic Animation Cube Group 1 Joseph Clark Michael Alberts Isaiah Walker Arnold Li

Point System (for instructor and TA use only)

NON-OVERSAMPLING DIGITAL TO ANALOG CONVERTER ASSEMBLY INSTRUCTIONS FEATURES DESCRIPTION JUNDAC FIVE

Analog Input & Output

ASNT_PRBS20B_1 18Gbps PRBS7/15 Generator Featuring Jitter Insertion, Selectable Sync, and Output Amplitude Control

Do the following: a. (12 points) Draw a block diagram of your circuit design, showing and labeling all essential components and connections.

Analogue output module DAO 081

ADC0804C, ADC BIT ANALOG-TO-DIGITAL CONVERTERS WITH DIFFERENTIAL INPUTS

HMC7056. Block Upconverters / HPA's. Typical Applications. General Description. Features. Functional Block Diagram

OBSOLETE HMC7056. Block Upconverters / HPA's. Typical Applications. General Description. Features. Functional Block Diagram

Application Note. A Collection of Application Hints for the CS501X Series of A/D Converters. By Jerome Johnston

S6B CH SEGMENT DRIVER FOR DOT MATRIX LCD

nc... Freescale Semiconductor, I

ABOV SEMICONDUCTOR 11 SEGMENT X 7 GRID LED DRIVER WITH KEYSCAN MC2302. Data Sheet (Ver. 1.20)

Harvatek International 2.0 5x7 Dot Matrix Display HCD-88442

o The 9S12 has a 16-bit free-running counter to determine the time and event happens, and to make an event happen at a particular time

PCI-DAS6034, PCI-DAS6035, and PCI-DAS6036

ABOV SEMICONDUCTOR 10 SEGMENT X 7 GRID LED DRIVER WITH KEYSCAN MC2102. Data Sheet (Ver. 1.21)

SignalTap Plus System Analyzer

o The 9S12 has a 16-bit free-running counter to determine the time and event happens, and to make an event happen at a particular time

UNISONIC TECHNOLOGIES CO., LTD TL431

3-Channel 8-Bit D/A Converter

Quadruple, 2:1, Mux Amplifiers for Standard-Definition and VGA Signals

Theory and Practice of Tangible User Interfaces. Thursday Week 3: Analog Input. week. Sensor 1: Potentiometers. Analog input

PART. Maxim Integrated Products 1

CXA1645P/M. RGB Encoder

Keyboard Controlled Scoreboard

Experiment 3: Basic Embedded System Analysis and Design

4.3 8 bit TFT Digital Driver Board Specification

Decade Counters Mod-5 counter: Decade Counter:

WECON LX3V-2PT2DA BD Board

RGB Encoder For the availability of this product, please contact the sales office. VIDEO OUT Y/C MIX DELAY CLAMP

TV Character Generator

Datasheet SHF A

SLD. Board FC/APC Connector. TEC Control. Board. Control Circuits. Control interface DB9 (Female)

LX3V-2PT-BD User manual

Experiment # 4 Counters and Logic Analyzer

INF4420 Project Spring Successive Approximation Register (SAR) Analog-to-Digital Converter (ADC)

WECON LX3V-2PT-BD Module

Lab #6: Combinational Circuits Design

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified) WINTER 2018 EXAMINATION MODEL ANSWER

Image Processing Using MATLAB (Summer Training Program) 6 Weeks/ 45 Days PRESENTED BY

SmartSwitch TM. Wide View Compact LCD 64 x 32 Pushbutton DISTINCTIVE CHARACTERISTICS PART NUMBER & DESCRIPTION

Experiment: FPGA Design with Verilog (Part 4)

Embedded Systems. Interfacing PIC with external devices 7-Segment display. Eng. Anis Nazer Second Semester

Embedded System Training Module ABLab Solutions

Complete 10-Bit/12-Bit, 25 MHz CCD Signal Processor AD9943/AD9944

Contact Image Sensor (CIS) Module. All specifications of this device are subject to change without notice.

0.56" 4 Digital Blue LED Panel Meter (rescalable) User s Guide

Analog-to-Digital Conversion (Part 2) Microcomputer Architecture and Interfacing Colorado School of Mines Professor William Hoff

Analog-to-Digital Converter

MATLAB & Image Processing (Summer Training Program) 4 Weeks/ 30 Days

DM Segment Decoder/Driver/Latch with Constant Current Source Outputs

8-BIT MCU WITH SINGLE VOLTAGE FLASH MEMORY, DATA EEPROM, ADC, TIMERS, SPI

Transcription:

ELCT706 MicroLab Session #3 7-segment LEDs and Analog to Digital Conversion

7-Segment LED Display g f com a b e d com c P

7-Segment LED Display Common Cathode - Com Pin = Gnd - Active high inputs - Example inputs to write 3: pins = a b c d e f g P 3 = 1 1 1 1 0 0 1 0 Common Anode - Com Pin = VCC - Active low inputs - Example inputs to write 3: pins = a b c d e f g P 3 = 0 0 0 0 1 1 0 1

Common Cathode 7-Segment input values

7-Segment LED Display Task 1 Write the MikroC code to control a one digit 7- segment display connected to PORTB of the PIC16F877A such that it counts from 0 to 9 with 1 second delay.

Analog to Digital Converter Analog voltage values binary numbers (digital values) - Larger number of bits= higher resolution/ more accuracy Example: Input voltage range from 0 to 5V Available bits = 5 bits 2 3 =8 different values Resolution = full range/#values = 5/32 = 0.625V Analog input voltage Digital values 0 0.625 V 000 0.625 1.25 V 001 1.25 1.875 V 010 1.875 2.5 V 011 2.5 3.125 V 100 3.125 3.75 V 101 3.75 4.375 V 110 4.375 5 V 111 Digital value = Analog value #values/full range Analog value = Digital value full range/#values

ADC in PIC16F877A - PIC16F877A: 10-bit ADC 2 10 =1024: from 0 to 1023 - PIC16F877A has 4 Specific Function 8-bit Registers for ADC module: 1. ADRESH 2. ADRESL 3. ADCON0 4. ADCON1 Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 ADRESH A2D Result Register - High Byte ADRESL A2D Result Register - Low Byte ADCON0 ADCS1 ADCS0 CHS2 CHS1 CHS0 GO/DONE - ADON ADCON1 ADFM - - - PCFG3 PCFG2 PCFG1 PCFG0

ADC in PIC16F877A 1. ADRESH & 2. ADRESL Registers - PIC: an 8-bit microcontroller - ADC result = 10 bits ADC result needs 2 registers ADRESH & ADRESL. Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 ADRESH A2D Result Register - High Byte ADRESL A2D Result Register - Low Byte ADCON0 ADCS1 ADCS0 CHS2 CHS1 CHS0 GO/DONE - ADON ADCON1 ADFM - - - PCFG3 PCFG2 PCFG1 PCFG0

ADC in PIC16F877A 3. ADCON0 & 4. ADCON1 Registers: Used to configure the ADC module ADCON1: Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 ADCON1 ADFM - - - PCFG3 PCFG2 PCFG1 PCFG0 Bit 7: ADFM: Analog to Digital Format of the 10-bit result in ADRESH and ADRESL Bit 7=0 Left justified result ADRESH ADRESL Bit 7=1 Right justified result ADRESH ADRESL 10-bit result 10-bit result

ADCON1: ADC in PIC16F877A Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 ADCON1 ADFM - - - PCFG3 PCFG2 PCFG1 PCFG0 Bits 6,5,4: Not used so typically = 000 Bits 3,2,1,0: PCFG3-0: PORT Configuration of ADC module

Analog to Digital Converter

ADC in PIC16F877A 3. ADCON0: Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 ADCON0 ADCS1 ADCS0 CHS2 CHS1 CHS0 GO/DONE - ADON Bit 7&6: ADCS1, ADCS0: clock frequency selects ADCS1 ADCS0 Clock frequency Max freq 00 Fosc/2 1.25 MHz 01 Fosc/8 5 MHz 10 Fosc/32 20 MHz 11 FRC internal Typ. 4us

ADC in PIC16F877A 3. ADCON0: Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 ADCON0 ADCS1 ADCS0 CHS2 CHS1 CHS0 GO/DONE - ADON Bit 5,4,3: CHS2, CHS1, CHS0: analog input channel selects CHS2 CHS1 CHS0 Analog Input channel 000 Channel 0 AN0/RA0 001 Channel 1 AN1/RA1 010 Channel 2 AN2/RA2 011 Channel 3 AN3/RA3 100 Channel 4 AN4/RA5 101 Channel 5 AN5/RE0 110 Channel 6 AN6/RE1 111 Channel 7 AN7/RE2

ADC in PIC16F877A 3. ADCON0: Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 ADCON0 ADCS1 ADCS0 CHS2 CHS1 CHS0 GO/DONE - ADON Bit 2: GO/DONE : Conversion status bit 2 = 1 Conversion in progress bit 2 = 0 Conversion done Bit 1: not used typically 0 Bit 0: ADON: Activate ADC module bit 0 = 1 ADC activated bit 0 = 0 ADC OFF

Steps for A to D Conversion in PIC16F877A 1. Configure analog & digital pins and Vref (ADCON1) 2. Select ADC clock frequency (ADCON0) 3. Turn ON ADC module (ADCON0) 4. Select ADC input channel (ADCON0) 5. Wait for Acquisition time ( 20µs) 6. Start conversion (set Go/Done bit = 1 in ADCON0) 7. Wait for conversion to complete(check on Go/Done) 8. Read ADC result from ADRESH and ADRESL Next conversion go back to step 4.

Show temperature on 7-segment display using LM35 and ADC in PIC16F877A Task 2 Write the MikroC code to display the room temperature on 2 digit 7- segment displays connected to PORTB and PORTD of the PIC16F877A. - The temperature is read by the sensor LM35 which inputs the analog voltage V in to the analog channel AN0/RA0 - The output of the sensor is linearly dependent on the temperature such that each 1 degree Celsius = 10mV.

Steps for A to D Conversion in PIC16F877A Example of inputs and outputs to the circuit If Temperature sensed by LM35 = 25 C, it will output 25 10mV = 250mV to Pin AN0 of PIC16F877A ADC module converts the 250mV to digital value = 250mV (1024/5V)= 51 Read output from ADRESH and ADRESL = 51 LM35 sensor Calculate the equivalent voltage from the DAC output : Veq = 51 (5V/1024)= 249mV calculate the temperature from the ADC output: 249mV/10mV=24.9 Send each digit of temperature to one 7 segment display Dr. Mohamed Abdel Gha