ECE-2325-Lab-5 - Main Program Set Stack Pointer Set Data...

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

View Full Document Right Arrow Icon
Introduction This lab shows us how to write subroutines in 68HC12 assembly language, and it also shows us how to use port B in output mode and port H in input mode. It also shows us how to calculate and write delay loops. Equipment • 68HC12 evaluation board • MiniIDE and its respective requirements Procedure 1. Read data from port H. 2. Depending on what data is in port H, flash the lights with port B in predefined patterns given in the lab for switches 0-6. 3. Use a delay while flashing the lights, configurable through accumulator X, to slow down the pattern to 2 frames per second. (0.5 second period) 4. Create your own pattern for switch 7. 5. If more than one switch is pressed, all lights should be turned off. Results Each of the patterns given in the lab will show up on the LEDs if the appropriate switch is flipped. If no switches are on, or if more than one switch is on, the LEDs will all turn off. If only switch 7 is pressed, my own pattern will show up on the LEDs. This is the pattern I used:
Background image of page 1

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

View Full DocumentRight Arrow Icon
Background image of page 2
Background image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Main Program Set Stack Pointer Set Data Direction of Ports B & H Load Port H into A Compare to #%10000000 Not Equal To Zero? Point Y to Sequence 0 Load B with length (#$04) Branch Always To Display Compare to #%01000000 Not Equal To Zero? Point Y to Sequence 1 Load B with length (#$04) Branch Always To Display Compare to #%00100000 Not Equal To Zero? Point Y to Sequence 2 Load B with length (#$04) Branch Always To Display no yes no yes no yes etc. INIT Compare to #%00000001 Not Equal To Zero? Point Y to Sequence 7 Load B with length (#$0C) Branch Always To INIT no yes Clear Port B Branch Always To Display Display Load data at Y into A Store A into Port B Load X with speed constant Jump to Delay subroutine Increment Y Decrement B B = 0? Branch Always To INIT no yes Delay Subroutine Load A with $2E (constant for 10X ms delay) Decrement A A = 0? no Do 2 NOPs to even out overhead Decrement X X = 0? no Return yes yes...
View Full Document

This note 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 / 3

ECE-2325-Lab-5 - Main Program Set Stack Pointer Set Data...

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

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