



















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
A lab manual for cs140 - lab03 in the computer organization course, which covers programming the pic microcontroller using assembly instructions and configuring it to support additional hardware. The lab manual includes information about the demo board, ttl logic, wiring the board, and driving logic on various chips. Additionally, it provides an evaluation sheet for the lab.
Typology: Slides
1 / 27
This page cannot be seen from the preview
Don't miss anything!
CS140 - Lab03 (^) 1
CS140 - Lab03 (^) 2
In the last labs, you learned how to program the PIC Microcontroller running on the Demo Board. You could write a bit of new code, and you could explain what various Assembly instructions do. You also had a general idea of how to read the hardware specification.
In this lab, you will have two very specific tasks.
But first, we’re going on a major detour introducing you to some new concepts.
These concepts include:
a. A new demo board.
b. A new PIC Processor.
c. TTL Logic.
d. Wiring up the Chip.
e. Code to drive and test this logic.
CS140 - Lab03 (^) 4
The Demo Board
This connector was already on the board. The important thing to note is the signals coming out of each location. So if you want to find a particular pin, this is how to do it.
RB6, RB MCLR Don’t mess with these three pins.
This connector was added to the board. The important thing to note is the signals coming out of each location. So if you want to find a particular pin, this is how to do it.
CS140 - Lab03 (^) 5
Here are changes made to this board.
+5 V Pins
DIP Socket
Socket Connector
Ground Pins
Switch Connector
Socket Connector
Docsity.com
CS140 - Lab03 (^) 7
A Input B Input Output 0 0 1 0 1 0 1 0 0 1 1 0 Apply to Pin 2
Apply to Pin 3
Result on Pin 1
This is an real photo of a TTL Chip taken by space aliens.
Note especially that the NOTCH indicates the orientation of the chip. It shows that THIS is Pin 1.
There is a similarity between the picture and the diagram!!
The 74LS02 is a Quad Nor gate. It contains 4 separate independent gates – you can use one or all of them. The “LS” indicates this is a low power device.
The 74LS02 is a 14 pin chip. We’ll also be using 16 pin chips. Docsity.com
CS140 - Lab03 (^) 8
This shows the steps involved in wiring this whole thing together.
Pin 14 Ground
Pin 7 Please note VERY CAREFULLY the orientation of the 74LS02 in the socket. a) The notch is at the left side in this picture. (This is not a requirement, but please do so – it will make debugging easier. b) The 14-pin chip is oriented/pushed to the left side of the socket as seen in this photo.
CS140 - Lab03 (^) 10
You can find starter-code Here. The program is called ChipDriver.asm.
You will be expected to understand this code. It’s highly parameterized and filled with comments. Hope you find it useful.
Note that for each of the devices (Chip driver/reader), Switch, LED; there’s a routine to configure and one to read/write as appropriate.
The Code
CS140 - Lab03 (^) 11
You will be amazed how useful your book is for this part. Of particular interest is the book’s description of three kinds of chips. I’ve provided an overview of the chip-type, examples of that type I will give you, and examples of chips I might ask you to wire up for show and tell.
Chip Type Provided For Practice For Show and Tell?
Logic Gates (3.3 in book)
74LS02, 74LS10, 74LS21 74LS00, 74LS02, 74LS08, 74LS10, 74LS20, 74LS21, 74LS27, 74LS30, 74LS Combinational Circuits (3.5 in book)
74LS42, 74LS138 74LS85, 74LS138, 74LS139, 74LS153, 74LS
Sequential Circuits (3.6 in book)
74LS194, 74LS174 74LS93, 74LS112, 74LS164, 74LS174, 74LS
Finding out more: The appendix of this document contains some information about these chips. Otherwise, Google can be your friend. (Search on “TTL” + Chip number) These chips were made originally by Motorola, Fairchild, Texas Instruments, and now by many vendors.
The Logic Chips
CS140 - Lab03 (^) 13
Task 2: Drive logic on various chips.
Your Task is to be able to use the Microcontroller to produce the states in the truth table for a selection of chips. As described, the provided code gives you an example of how to do this for the 74LS02.
You will have a set of others chips to practice on; and then at show and tell time, you will demonstrate your prowess with chip testing.
You will have a choice of what type of chip to test, and you will then wire up that chip on the board and produce code that can run that chip. The chip you will get will be one of those listed on a previous page labeled “For Show and Tell”. By all means, practice on the six chips provided in order to understand how they work. Get together with your buddies if you wish. Learn all you want about the Show and Tell chips though you won’t be able to practice on them beforehand.
CS140 - Lab03 (^) 14
Task 2: Drive logic on various chips.
What type chip should you choose? Logic Chips are fairly low risk; you could even look at the specs for all those chips and have them programmed beforehand. But low risk means a somewhat lower grade. Combinational Chips are medium difficulty. They aren’t hard conceptually, but they require more connection wires. Also, how you display the results on the LEDs will take a bit of thinking. I have no preconceived notion of how that should be done, so you would have considerable latitude here. Sequential Chips are also medium difficulty. In general, their challenge is not in the number of wires, but in the requirement of timing – an input needs to go lowhigh ten times for instance in order to see the desired effect.
By The Way: Task 1 and Task 2 are independent of each other – you can wire the switch wherever you want for Task 2.
CS140 - Lab03 (^) 16
74LS Quad 2-input AND
74LS Quad 2-input NAND
74LS Quad 2-input NOR
74LS Dual 4-input NAND
74LS Triple 3-input NAND
74LS Dual 4-input AND
CS140 - Lab03 (^) 17
74LS Triple 3-input NOR
74LS Quad 2-input OR
74LS 8-input NAND
CS140 - Lab03 (^) 19
74LS 3 to 8 line decoder (multiplexer)
CS140 - Lab03 (^) 20