SC EMCH 367 - Lab 3 Timer Functions - Bolt Drop And Square Wave

Unformatted text preview:

Lab 3 – Timer Functions: Bolt Drop and square waveObjectivePREREQUISITESPROCEDUREPart I – Bolt Drop Experiment (50%)Wiring DiagramBolt Drop Circuit DiagramPre-test ProcedureTest ProcedurePart III – Square Wave Generation with Timer Functions (30%)Wiring DiagramTest ProcedureEMCH 367 Fundamentals of MicrocontrollersLAB 3 – TIMER FUNCTIONS: BOLT DROP AND SQUARE WAVEOBJECTIVEThis lab will use MC6811 to perform time measurements. Part I will perform time measurements on adropping bolt using input capture (IC) timer functions. Part II will generate a square wave using outputcompare (OC) timer functions.PREREQUISITESFloppy disk with the asm codes for the programs:- LASTNAME_Firstname_Drop.asm- LASTNAME_Firstname_OC_sqwav.asmHard copy (printout) of Hmwk5 – Timer functions. When printing, use the 'pages per sheet'option in the lower right corner of the print dialog-box with settings of 4 or 2 (depending on youreyesight) to save paper. (We may want to experiment a little with this before printing the fulldocument.)PROCEDUREThe students will utilize the asm code developed with the THRSim11 simulator for Hmwk5. Thestudents will go through the printout of Hmwk5 step by step and will verify that the MCU responds toinstructions as expected. The lab is divided into sections. After completing each section, the student will ask the TA to check thestudent’s work and make a check mark on that section.The asm code is activated into the MCU following the standard procedure learned in Lab 1.Dr. Victor Giurgiutiu Page 1 1/14/2019EMCH 367 Fundamentals of MicrocontrollersPART I – BOLT DROP EXPERIMENT (50%)Note: This part uses the timer programLASTNAME_Firstname_Drop.asm developed in thesection “Input capture – bolt drop experiment” ofHmwk5.MC6811 will be used in an experiment to measure travel times. A 1.5-in bolt will be held by anelectromagnet at the top of a drop shaft. The electromagnet is connected to the MCU. . This magnet iscontrolled by any of the 8 pins on PORTB. It is turned on by sending 5V through parallel PORTB. Whena keystroke occurs, the MCU commands the electromagnet to release the bolt. Simultaneously, thetime origin, T0, is recorded. The bolt travels down the shaft. After falling a specified distance (L = 48.75-in), the bolt crosses an infrared emitter-detector sensor and interrupts its beam causing its outputvoltage to fall from high (+5V) to low (~0V). When the bolt exits the emitter detector sensor, its outputvoltage comes back up to high (+5V). The output from the emitter-detector sensor is wired into the inputcapture pins IC1 and IC2 of the MCU. You will program the microcontroller to perform the followingfunctions: (a) control the electromagnet, (b) take the initial time when the process starts, (c) measurethe time required for the free-falling bolt to reach the emitter-detector; (d) measure the time required forthe bolt to pass through the emitter-detector.Dr. Victor Giurgiutiu Page 2 1/14/2019 Electronics Electromagnet Emitter-detector sensor Drop shaft Figure 1 Bolt drop experimental setupEMCH 367 Fundamentals of MicrocontrollersWIRING DIAGRAMWire ConnectionGreen wire: +15VRed wire +5VBlack wire GroundWhite wire: To parallel port B pin controlling the magnetYellow wire with 2 prongs:Signal wire to the input capture pins IC1and IC2Dr. Victor Giurgiutiu Page 3 1/14/2019EMCH 367 Fundamentals of MicrocontrollersBOLT DROP CIRCUIT DIAGRAM Comparator LM2901 1 1K 12 3 +5V 6 7 1K 1K +5V Port A pin 1 Port A pin 2 Electromagnet +15V 10 Port B pins IRF510 R250 D + +5V E + +5V 1K + - 470K PRE-TEST PROCEDUREBefore starting your test, perform the following pre-test procedure to verify that your experimental set-up is performing correctly:i) Check the correct wiring of the bolt drop set up:Wire Connection Check markGreen wire: +15VRed wire +5VBlack wire GroundWhite wire: To parallel port B pin controlling the magnetYellow wire with 2 prongs:Signal wire to the input capture pins IC1and IC2TA checkmark ________ii) Take the white wire out of the Port B connection (if connected). Check theelectromagnet holding action upon the bolt by applying 5V to the white wire. The boltshould hold. Then, check the release action by applying 0 V. [Note that 0 V is differentfrom “no-voltage” (floating wire). A floating wire may not release the bolt] The boltshould drop.Dr. Victor Giurgiutiu Page 4 1/14/2019EMCH 367 Fundamentals of Microcontrollersiii) Connect O-scope Ch.1 to the signal wire (yellow). Set Trigger Mode to Auto andHorizontal to 0.2 sec/div. You will see a spot traveling across the screen at 5V level. (Ifthe spot is too bright, adjust Brightness Intensity). By hand, introduce the bolt in theemitter-detector zone at the lower end of the tube and watch the signal go to 0V on theO-scope screen. Extract the bolt and watch the signal go back to 5V. Now, let the boltdrop through the tube and watch the fast 5V/0V/5V transition (spot flicker) on thescreen.iv) Connect the white wire to port B. Manually, send a 5V voltage through port B (i.e., store$ff into Port B at memory location $1004) and verify that the electromagnet holds thebolt. Now, send a 0V through port B (store $00 into Port B at memory location $1004)and observe the electromagnet releasing the bolt. Watch the 5V/0V/5V transition on thescreen as the dropping bolt passes the emitter-detector sensor.v) Where are IC1 and IC2 located (port and pin)? Enter your answer here:_____________________ Draw a sketch of the pin assignments in the space belowvi) Connect the signal wire (yellow) to IC1 and IC2 pins.TA checkmark ________TEST PROCEDURE1. Put the bolt into the electromagnet hold position2. Activate the program LASTNAME_Firstname_Drop.asm.3. Press any key. The bolt should drop and the program should stop when the bolt exits thetube.4. Read the memory locations for T0, T1, T2, NOF1, NOF2. Record the readings in the table. 5. Perform all the 6 trials and enter the appropriate values in the table. TA checkmark ________6. Start manual calculations by completing the formulae below:Time of entry: t1 = [T1+NOF1*($__________)-T0] cycles * (_____________ s/cycle)Time of exit: t2 = [T2+NOF2*($__________)-T0] cycles * (_____________ s/cycle) Time for bolt to pass: -t = t2 – t1Velocity: v = L/-t = _____/-t


View Full Document

SC EMCH 367 - Lab 3 Timer Functions - Bolt Drop And Square Wave

Download Lab 3 Timer Functions - Bolt Drop And Square Wave
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lab 3 Timer Functions - Bolt Drop And Square Wave and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lab 3 Timer Functions - Bolt Drop And Square Wave 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?