PERIPHERAL INTERFACING Rev. 1.0

Similar documents
PERIPHERAL INTERFACING Rev. 1.0

arxiv:physics/ v1 [physics.ed-ph] 19 Oct 2004

MICROPROCESSORS AND MICROCONTROLLER 1

Topics Introduction to Microprocessors

INTERFACING ADC/DAC. DAC INTERFACE SECTION: DAC 0800 is a monolithic, high speed, current output D/A Converter. Its unique features are:

NODIA AND COMPANY. Model Test Paper - I GATE Digital Electronics. Copyright By Publishers

Microprocessor & Interfacing Lecture Programmable Interval Timer

Chapter 10 Counter modules

8253 functions ( General overview )

PCL-836 Multifunction countertimer and digital I/O add-on card for PC/XT/ AT and compatibles

8085 MICROPROCESSOR PROJECT


Thursday 5 June 2014 Afternoon

R.B.V.R.R. WOMEN S COLLEGE (AUTONOMOUS) Narayanaguda, Hyderabad. ELECTRONIC PRINCIPLES AND APPLICATIONS

Electric Druid Note Divider NOTEDIV 1

Operating Instructions

III/IV B.Tech (Regular) DEGREE EXAMINATION-Schema. Answer ONE question from each unit.

11 Counters and Oscillators

Hashemite University Faculty of Engineering Mechatronics Engineering Department. Microprocessors and Microcontrollers Laboratory

OPERATING MANUAL DIGITALLY CONTROLLED FREQUENCY SYNTHESIZED OSCILLATOR MODEL NUMBER: ADSDFS-A DOCUMENT NUMBER: 51A19937C

MK7A20P 8 bit microcontroller

Thursday 6 June 2013 Afternoon

ELECTRONICS AND COMMUNICATION ENGINEERING

A MORON'S GUIDE TO TIMER/COUNTERS v2.2. by

RC Filters and Basic Timer Functionality

Regarding the change of names mentioned in the document, such as Mitsubishi Electric and Mitsubishi XX, to Renesas Technology Corp.

EE 109 Midterm Review

GATE Online Free Material

ESE 350 Microcontroller Laboratory Lab 5: Sensor-Actuator Lab

Experiment#6: Speaker Control

ANGULAR POSITION CONTROL OF DC MOTOR USING SHORTEST PATH ALGORITHM

CS/ECE/EEE/INSTR F241 MICROPROCESSOR PROGRAMMING & INTERFACING MODULE 8: I/O INTERFACING QUESTIONS ANUPAMA KR BITS, PILANI KK BIRLA GOA CAMPUS

Review for Final Exam

Flux Gate Musical Toy

CONTENTS Sl. No. Experiment Page No

DEPARTMENT OF ELECTRONICS

Faculty of Engineering Electrical Engineering Department Communications and Electronics Program. Student Lab Manual. CC 421 Microprocessors Lab

Visa Smart Debit/Credit Certificate Authority Public Keys

DTMF Generation with a 3 58 MHz Crystal

Review for Final Exam

LC-10 Chipless TagReader v 2.0 August 2006

Function Block DIGITAL PLL. Within +/- 5ppm / 10 years (Internal TCXO Stability) 1 External Reference Frequency Range: 10MHz +/- 100Hz

EE 308 Apr. 24, 2002 Review for Final Exam

EVDP610 IXDP610 Digital PWM Controller IC Evaluation Board

Available online at ScienceDirect. Measurement of Power Frequency with Higher Accuracy using PIC Microcontroller

Lecture 2. Digital Basics

Lecture 12 Timer Functions

R & D Electronics DIGITAL IC TRAINER. Model : DE-150. Feature: Object: Specification:

Monitoring of Intravenous Drip Rate

Modb us-r T U is im p lem ented w ith th e function of a slav e. T h e follow ing Modb us functions are

Analog-to-Digital Conversion

SAX263 [10 30] MHz Tunable Bandpass Filter

B.Sc. ELECTRONICS (OPTIONAL) Second Year DR. BABASAHEB AMBEDKAR MARATHWADA UNIVERSITY, AURANGABAD

C Mono Camera Module with UART Interface. User Manual

Dev Bhoomi Institute Of Technology Department of Electronics and Communication Engineering PRACTICAL INSTRUCTION SHEET

SRI SUKHMANI INSTITUTE OF ENGINEERING & TECHNOLOGY DERA BASSI DEPARTMENT: ELECTRONICS & COMM. LABORATORY MANUAL LAB: EMI SUBJECT CODE: SEMESTER: 4th

Design and build a prototype digital motor controller with the following features:

. HIGH SPEED .LOW POWER DISSIPATION .HIGH NOISE IMMUNITY M54/74HC40102 M54/74HC STAGE PRESETTABLE SYNCHRONOUS DOWN COUNTERS

SUMMER 2016 ECE 103 ENGINEERING PROGRAMMING MUSIC SYNTH PROJECT TECHNICAL GUIDE ECE DEPARTMENT PORTLAND STATE UNIVERSITY

The HT6P20x2 Encoder IC

SUPPLY NETWORK ANALYZER CVM-96 SERIES

Unit-6 PROGRAMMABLE INTERRUPT CONTROLLERS 8259A-PROGRAMMABLE INTERRUPT CONTROLLER (PIC) INTRODUCTION

82C54. CMOS Programmable Interval Timer. Description. Features. Pinouts 82C54 (PDIP, CERDIP, SOIC) TOP VIEW. March 1997

A.M. WEDNESDAY, 19 May minutes

HCC/HCF40102B HCC/HCF40103B

MAINTENANCE MANUAL AUDIO MATRIX BOARD P29/

PESIT BANGALORE SOUTH CAMPUS BASIC ELECTRONICS

DEGEN DE1103 FM / MW / SW RECEIVER FM / AM / SSB / CW MODES OPERATING MANUAL

GCE A level 1145/01 ELECTRONICS ET5. P.M. THURSDAY, 31 May hours. Centre Number. Candidate Number. Surname. Other Names

ArduCAM USB Camera Shield

Development Of a Simple Robot Arm Using Servo Motors

Four Quadrant Speed Control of DC Motor with the Help of AT89S52 Microcontroller

Solapur University, Solapur Syllabus for B.Sc. II Electronics Semester System To be implemented from Academic Year ) Course Structure: -

AC LAB ECE-D ecestudy.wordpress.com

EE 314 Spring 2003 Microprocessor Systems

40106 Hex Oscillator Workshop Instructions. bbob drake, aka fluxmonkey

PC-OSCILLOSCOPE PCS500. Analog and digital circuit sections. Description of the operation

ELCT 912: Advanced Embedded Systems

DS1633. High Speed Battery Recharger PIN ASSIGNMENT TO 220 FEATURES. PIN DESCRIPTION V CC Supply Voltage V BAT Battery Output GND Ground

Micro Controller Based Ac Power Controller

7.S-[F] SU-02 June All Syllabus Science Faculty B. Sc. II Yr. Eelectronics [Sem.III & I - 1 -

Fast Dynamic Parallel Data Interface for the NGD RF Driver

I2C Demonstration Board LED Dimmers and Blinkers PCA9531 and PCA9551

Input/Output Control Using Interrupt Service Routines to Establish a Time base

Homework #01. Electronics Homework 01 MSCI 222C

This Errata Sheet contains corrections or changes made after the publication of this manual.

MICROPROCESSOR TECHNICS II

A MICROPROCESSOR BASED FIRING SCHEME FOR THREE-PHASE CONVERTERS WORKING UNDER A VARIABLE FREQUENCY SUPPLY


The counterpart to a DAC is the ADC, which is generally a more complicated circuit. One of the most popular ADC circuit is the successive

^3 PMAC2-PCMACRO Interface Board. ^4 3Ax xUxx. ^5 October 23, 2003

RF RECEIVER DECODER RDF1. Features Complete FM Receiver and Decoder. Applications

16.1 ADC ADC ADC10

Voltage regulator TAPCON 240

DIAMOND-MM Multifunction Analog I/O PC/104 Module

EE445L Fall 2014 Quiz 2B Page 1 of 5

Create exciting, computer generated, three-dimensional drawings on your oscilloscope

BAND DECODER and CONTROLLE R. Accessibility Upgrade and Operating Instructions

' The PicBasic Pro Compiler Manual is on line at: '

Specifications Test Conditions Vs = ± 15 V, Ta = 25 C Gain Gain Values 40, 60, 80, 100 db indicated by four LEDs Gain Accuracy ± 0.1 % (between settin

Transcription:

This work is licensed under the Creative Commons Attribution-NonCommercial-Share Alike 2.5 India License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/2.5/in/deed.en or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA. Page #1

TONE GENERATOR AIM To wite an assembly language program to generate tones using software. APPARATUS REQUIRED 8085 Microprocessor Trainer kit Flat Ribbon Cable Tone generator kit Power Supply DESCRIPITION Tone generator is a circuit which generator different tones depending on the input signal and its frequency. This circuit contains AND gates (IC is 74HC102 ).The two inputs for AND gates are one from 8255 (26 core FRC cable connected to P3) and other input is from 8253 IC on the kit. With the help of FRC, we can connect this signal from p2 on the kit to JP2 On the interface. These input signal are modulated and outputted to the transistor Q1 whose collector current varies depending on the base current fed by the O/P of the AND gate, this variation in collector current causes the speaker diaphragm to vibrate at different frequencies and hence to output various tones. The user can write various program to generate different tones to the output of speaker. On the interface one beard speaker is mounted and also to work under silent areas headphone socket is provided in addition to this, a volume control pit R6(500 ohm) provided to vary the volume of the output. Steps to be followed to generate tone using software Calculate the Hexa count to be loaded to 8253 16 bit counter for the particular frequency of the required time. Using the formula, Count ( dec ) =1.5 MHz / (frequency required ) After this convert the count in decimal value to Hex value & load 16 bit data to 8253 counts. In hardware of the interface when you connect FRC clock1 of 8253 is shorted to clock2 of the same on the kit, at clock2 you have 1.5MHz of the frequency. a) Disable the output of AND gate by sending 0 to PC7 b) Enable the same by sending1 to PC7 c) Call different delays to generate tones for that particular duration d) Disable AND gate output and call delay in order to give pause between tones e) Load next 16 bit hex data to 8253 counter and repeat the above steps Some of the fundamental frequencies are given below TONE NAME OCTAVE 0 OCTAVE 1 OCTAVE 2 OCTAVE 3 Sa 130.810 261.630 523.250 1046.500 Re 146.830 293.660 587.330 1174.700 Ga 164.810 329.630 659.260 1318.500 Ma 174.610 349.230 698.460 1396.900 Page #2

Pa 196.000 392.000 784.000 1568.000 Dha 220.000 440.000 880.000 1760.000 Ni 246.940 493.883 987.770 1975.540 CIRCUIT DIAGRAM TO WORK WITH TONE GENERATOR a) In addition to the FRC connected from P3 of kit to JP1 on interface(26 pin). Connect one more FRC connect P2 (20 pin) on the kit to JP2(20 pin) on the interface. b) Connect +5 & GND to generate low, execute the program as GO <starting address> <EXEC>. Now you can hear music (or tone) at the output of the speaker depending on your program. The tone volume can be controlled by varying R6 pot mounted on the interface. If you connect head phone externally to jack provided the on board speaker is disabled and you will get the output on head phone. FUNDAMENTAL FREQUENCY OCTAVE 1 SA = 1.5 Mhz / 261.630 = 5740.5 = 5741 d = 166D H RE = 1.5 Mhz / 293.660 = 5107.9 = 5108 d = 13F4 H GA = 1.5 Mhz / 329.630 = 4550.5 = 4551 d = 11C7 H MA = 1.5 Mhz / 349.230 = 4295.1 = 4295 d = 10C7 H PA = 1.5 Mhz / 392.000 = 3826.5 = 3827 d = 0EF3 H DHA = 1.5 Mhz / 440.000 = 3409.09 = 3409 d = 0D51 H NI = 1.5 Mhz / 493.883 = 3037.15 = 3037 d = 0BDD H ASSEMBLY LANGUAGE PROGRAM ADDRESS LABEL MNEMONICS OPCODE/OPERAND C100 MVI A,80 H 3E 80 C102 OUT CWR D3 DB C104 MVI A,B6 H 3E B6 C106 OUT TIMERCTRL D3 CB C108 REPEAT MVI B,07 H 06 07 C10A LXI H,C200 H 21 00 C2 Page #3

C10D NEXT MVI A,M 7E C10E OUT TIMER2 D3 CA C110 INX H 23 C111 MOV A,M 7E C112 OUT TIMER2 D3 CA C114 MVI A,80 H 3E 80 C116 OUT PORTC D3 DA C118 CALL DELAY CD 27 C1 C11B MVI A,00 H 3E 00 C11D OUT PORTC D3 DA C11F INX H 23 C120 DCR B 05 C121 JNZ NEXT C2 OD C1 C124 JMP REPEAT C3 08 C1 C127 DELAY MVI C,04 H 0E 04 C129 START LXI D,FFFF H 11 FF FF C12B LOOP1 DCX D 1B C12C MOV A,E 7B C12D ORA D B2 C12E JNZ LOOP1 C2 2B C1 C131 DCR C 0D C132 JNZ START C2 29 C1 C135 RET C9 PROGRAM TRACE LABEL MNEMONICS DESCRIPTION MVI A,80 H Initializing the ports of the PPI 8255 as O/P ports by writing the control word as 80 H. DATA D 7 D 6 D 5 D 4 D 3 D 2 D 1 D 0 BITS 1 0 0 0 0 0 0 0 COMMENT I/O Mode0 PortA PortC Mode0 PortB PortC mode O/P Upper O/P O/P Lower O/P 80 H is moved to accumulator. A 80 F B C H L OUT CWR Control word specifies the I/O function for each port of 8255. MVI A,B6 H Initializing the COUNTER 2 of the PIT 8253 in MODE 3 writing the control word as B6 H. by COMMENT SELECT COUNTER READ/ LOAD MODE SC1 SC0 RL1 RL0 M2 M1 M0 DATA D 7 D 6 D 5 D 4 D 3 D 2 D 1 D 0 BITS 1 0 1 1 0 1 1 0 BCD/ BINARY COUNT OBSERVE C0UNTER 2 LSB/MSB MODE 3 BINARY COUNT Page #4

OUT TIMERCTRL B6 H is moved to accumulator. A B6 F B C H L NOTE: 8253 IS USED TO GENERATE ACCURATE TIME DELAY FOR THE SQUARE WAVE IN MODE3. AT THE END OF COUNT, A PULSE IS GENERATED WHICH INTERRUPT THE MICROPROCESSOR. Output it through TIMERCTRL. NOTE: Opcode of TIMERCTRL is CB. REPEAT MVI B,07 H Initialize B register with number of count. A F B 07 C H L LXI H,C200 H Initialize the memory pointer at C200 H.i.e. loads the 16- bit data in the register pair designated. A F B 07 C H C2 00 L C200 H is the memory pointer. C200 C201 C202 C203 C204 MEMORY CB 2C E7 27 8D NEXT MVI A,M LSB of Sa is loaded in to accumulator. A B D H CB F C E L OUT TIMER2 INX H CB H is outputted thro TIMER2. NOTE: Opcode of TIMER2 is CA. Increment the HL register pair by 1.The instruction views the contents of the HL registers as a 16-bit number. No flags are affected. Page #5

A B D H CB 07 C2 01 F C E L MOV A,M C201 H is the memory pointer. MEMORY C200 C201 C202 C203 C204 CB 2C E7 27 8D HL memory pointer MSB of Sa is loaded in to accumulator. A 2C F B 07 C H C2 01 L OUT 2C H is outputted thro TIMER2. TIMER2 MVI A,80 H Move 80 H immediately in to accumulator. A 80 F B 07 C H C2 01 L OUT PORTC Initialize the ports. DATA BITS PC 7 PC 6 PC 5 PC 4 PC 3 PC 2 PC 1 PC 0 1 0 0 0 0 0 0 0 PC 7 =1,Enable AND gate output by sending 1 bit (high signal) to PC 7. CALL Call delay sub program. DELAY MVI A,00 H Clear the accumulator. A 00 F B 07 C H C2 01 L OUT PORTC Initialize the ports. DATA BITS PC 7 PC 6 PC 5 PC 4 PC 3 PC 2 PC 1 PC 0 0 0 0 0 0 0 0 0 PC 7 =0,Disable AND gate by sending 0 bit (low signal) to PC 7 Page #6

INX H Increment the HL register pair by 1. A E7 F B 07 C H C2 02 L DCR B JNZ NEXT JMP REPEAT Decrease the count of B register since Sa is obtained. A F B 06 C H C2 02 L For single loop, to play sa, re, ga, ma, pa, dha, ni Jump to next. In order to play continuously the tune, repeat the process. DELAY MVI C,04 H Move 04 H immediately to C register. A F B 04 C H L START LXI D,FFFF H Initialize the memory pointer at FFFF H.i.e. loads the 16-bit data in the register pair designated. A F B 04 C D FF FF E H L FFFF H is the memory pointer. FFFF FFFE FFFD FFFC FFFB MEMORY LOOP1 DCX D Decrement the HL register pair by 1.The instruction views the contents of the HL registers as a 16-bit number. No flags are affected. A F B C D FF FE E H L FFFE H is the memory pointer. Page #7

MOV A,E FFFF FFFE FFFD FFFC FFFB MEMORY DE memory pointer Move E register to accumulator. A FE F B C H L ORA D OR the accumulator content with D register content. JNZ LOOP1 Jump if no zero to Labled LOOP1. DCR C Decrement the C register content. A F B 03 C H L JNZ START Jump if no zero to Labeled START. RET Return to main program. EXECUTION ADDRESS TONE FREQUENCY NAME (Hz) HEXADECIMAL (hexa) C200 Sa 261.630 1665 H C202 Re 293.660 13F4 H C204 Ga 329.630 11C7 H C206 Ma 349.230 10C7 H C208 Pa 392.000 0EF3 H C20A Dha 440.000 0D57 H C20C Ni 493.883 0BDD H REFERENCE 1. Ramesh S.Gaonkar, Microprocessor Architecture, Programming, and Applications, Fourth Edition, Penram International Publishing (India), 2000. 2. S.Subathra, Advanced Microprocessor Laboratory, Record work, Adhiparashakthi Engineering College, Melmaruvathur, October 2002 3. S.Subathra, Programming in 8085 Microprocessor and its applications An Innovative Analysis, Technical Report, Adhiparashakthi Engineering College, Melmaruvathur, March 2003 Page #8

4. Micro-85 EB, User Manual, Version 3.0, CAT #M85 EB-002, VI Microsystems Pvt. Ltd., Chennai. Page #9