Lab 9 - Introduction In this lab, we write a program that...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Introduction In this lab, we write a program that takes in analog data in the range of 0–5V, and then it converts that data into two different forms to be displayed when you press an appropriate button on the terminal’s keyboard. Equipment • 68HC12 evaluation board • MiniIDE and its respective requirements • 5V Power Source • 2 Potentiometers Procedure 1. Create source data for the Temperature and Pressure functions. 2. Create a main program that takes in a key from the keyboard and checks to see if it was a P or a T, take an ADC sample, and jump to the respective subroutine. 3. Create a P and a T subroutine that converts the sample into raw data using the source data (#1 above) that can be displayed on the 7-segment displays and LEDs. (I used several subroutines so accomplish this.) 4. Display this data for several refreshes and at the end of the refresh, leave the LEDs in their current state. 5. Go to step #2 (above). This allows for a smooth display if you hold down the button. Results When the user enters appropriate keys, the 68HC12 outputs the appropriate digits on the 7- segment display and the LEDs. When the user lets go of the button, the status of the LEDs is retained. I wrote this program to take advantage of the Rev. E Dragon12 EVB’s ability to turn off the LEDs using Port J. This is not possible on Rev. D EVBs. This program should theoretically function fine on a Rev D board, but if you run it on a Rev. E board, the LEDs will actually display the correct data during the time that you’re holding down a key on the keyboard.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Disp7Seg Subroutine Load data from mem into digit 0 Load data from mem into digit 1 Load data from mem into digit 2 Load data from mem into digit 3 Delay Delay Delay Delay Load data from memory into LEDs Delay Decrement Y (Refresh count) B = [esc]? no yes Return from Subroutine Calc7Seg Subroutine B = 0? Load B 7-segment value for 0 Return from Subroutine yes no B = 1? Load B 7-segment value for 1 Return from Subroutine yes no B = 2? Load B 7-segment value for 2 Return from Subroutine yes no Repeat for all possible characters
Background image of page 2
Repeat for all possible characters Divide A (actual sample) by 32 A = 0? Load B with LED value for 0 Return from Subroutine yes no A = 1? Load B with LED value for 1 Return from Subroutine yes no A = 2? Load B with LED value for 2 Return from Subroutine yes no A = 3? Load B with LED value for 3 Return from Subroutine yes no CalcP Subroutine Load X with digit 0 data location Load B w/ X offset by ADC sample Jump to Calc7Seg Store B into Seg0 mem location Load X with digit 1 data location Load B w/ X offset by ADC sample Jump to Calc7Seg Load X with digit 2 data location Load B w/ X offset by ADC sample Jump to Calc7Seg Load B with 7- segment data that produces a 0 Store B into Seg1 mem location Store B into Seg2 mem location Store B into Seg3 mem location Return from subroutine
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This lab report was uploaded on 04/11/2008 for the course ECE 2325 taught by Professor Fernandorios-guiterrez during the Fall '06 term at University of Minnesota Duluth.

Page1 / 9

Lab 9 - Introduction In this lab, we write a program that...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online