Presentation is loading. Please wait.

Presentation is loading. Please wait.

Dr. Hoganson CSIS 4381 Input from Port D In this project, we will use port D as input and port A as output, by connecting three input bits of port D to.

Similar presentations


Presentation on theme: "Dr. Hoganson CSIS 4381 Input from Port D In this project, we will use port D as input and port A as output, by connecting three input bits of port D to."— Presentation transcript:

1 Dr. Hoganson CSIS 4381 Input from Port D In this project, we will use port D as input and port A as output, by connecting three input bits of port D to logic switches, and connecting three output bits of port A to LEDs. Your assignment will be to extend the program we worked on in the last lab. Port_a bits 4,5,6 for output, will be wired to LEDs (as before). Port_d bits 2,3,4 for input, will be wired to three of the 0-1 logic switches on the IDL-800.

2 Dr. Hoganson CSIS 4381 MicroStamp Pin Functions Note: Port D bits 0 & 1 are used by the serial cable to download our programs. Do not use.

3 Dr. Hoganson CSIS 4381 Exclusive OR A useful function for complementing bits is the Exclusive-OR operation, often abbreviated as XOR. Our assembly language has EORA and EORB. 1100 XOR0110 ------ 1010 The XOR puts in 1 in the output if either inputs are 1, BUT NOT BOTH!

4 Dr. Hoganson CSIS 4381 Complementing with XOR XOR can be used to complement bits: Say we want to complement bit 2, but we don’t know (and don’t care) what bit two currently is: (bits) 3,2,1,0 Original1101 XOR with0100 ------ Result1001 (bits) 3,2,1,0 changed1001 XOR with0100 ------ Result1101 Only the bit desired is flipped, all other bits, regardless of whether they are 0 or 1, are unchanged.

5 You may choose to use SW0-2

6 Dr. Hoganson CSIS 4381 Example: inputtst.asm This is the same example program as before. It is NOT the solution to the last lab!

7 Dr. Hoganson CSIS 4381 Example cont.

8 Dr. Hoganson CSIS 4381 Example cont.

9 Dr. Hoganson CSIS 4381 Your Assignment for Next Monday Lab Preparation: 1.If your program from the last lab, did not work correctly, continue to work with and debug that program using the wookie. In either case, revise your program to use the XOR operation (EORA or EORB). 2.Next, modify your WORKING program, so that the input PD_2 controls PA_4 output determining how fast PA_4 flashes. 0-slow, 1-fast. The other inputs/outputs work to echo the state of the switches without flashing. PD3  PA5 PD4  PA6 3.Test your program on the wookie. 4.Modify your program to work on the 68HC11/Microstamp. Hands-On portion next Monday: 5.Wire your input switches, assembly, download, and test/debug your program from step 4 on the MicroStamp. 6.Demonstrate your working program to your instructor.


Download ppt "Dr. Hoganson CSIS 4381 Input from Port D In this project, we will use port D as input and port A as output, by connecting three input bits of port D to."

Similar presentations


Ads by Google