DOC PREVIEW
SJSU ME 106 - Digital Signal Input and Output

This preview shows page 1-2 out of 5 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 5 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 5 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 5 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Digital I/O Laboratory DIO-1 San José State University Department of Mechanical and Aerospace Engineering Fall 2000 26SEP00 Digital Signal Input and Output Purpose • To introduce the digital input and output functions of the Basic Stamp microcontroller • To practice reading logic level signals from an input port • To practice sending logic level signals to an output port Components Qty. Item 1 OEM Basic Stamp II microcontroller and serial port cable 1 470 Ω DIP resistor pack 1 7-segment LED (common anode (CA)) 2 tact switches 2 10 k resistors Introduction In this lab you will explore the input/output capability of the Basic Stamp microcontroller. Microcontrollers are inherently digital devices, meaning they operate with discrete values. The discrete values that all digital devices use are the binary values 0 and 1. The voltages 0 V and 5 V respectively usually represent these discrete values. The Basic Stamp has 16 pins (P0 through P15) that can either serve as digital outputs, or as digital inputs. A digital output means that a program running on the Stamp can change the pin voltage to be either at common potential (0) or 5 V by writing a 0 or 1 to that pin. A digital input means that the world outside the microcontroller can change the voltage on the pin to either 0 V or 5 V, and the microcontroller can record the value as a 0 or 1 respectively. 7-segment LED display You will use a 7-segment LED display as a digital output device and push-button switches as digital input devices. A 7-segment LED is nothing more than 7 LED’s arranged in a pattern that can form a character when the appropriate segments are lit. These displays come in two basic types: common anode (CA) and common cathode (CC). CA types have all of the anodes of the 7 LED’s connected together, and each of the 7 cathodes independent. Power is applied to the common anode, and a segment will be lit when its cathode is grounded. (Don’t forget to use a current limiting resistor between the cathode and ground!) The reverse is true for the CC types. Figure 1 below shows a schematic diagram of a CA 7-segment LED. The letters as shown denote the particular segment. Two of the physical pins on the display are tied together (made ‘common’). For the CA-type of display, the two pins connect to the common anode. For the CC-type of display, the two pins connect to the common cathode. The easiest way to figure out which pins correspond to which connections is to look at the data sheet for the device. Without a data sheet, you will need to “buzz” out the two common pins using the diode check function on a multimeter.Digital I/O Laboratory DIO-2 San José State University Department of Mechanical and Aerospace Engineering Fall 2000 26SEP00 Figure 1 7-segment LED Display (Common Anode (CA) type. Two of the physical pins are tied together at the common anode of the display segments. The last LED is for the decimal point. Power is applied to the either of the common anode pins. A segment is lit when its cathode is then grounded through a current limiting resistor. Pin positions are numbered from 1 to 14, however some pins are not physically present on the actual device. See the data sheet for the particular device to find out which pin corresponds with which segment. 7447 BCD-to-7-segment (CA) display driver The most common way 7-segment displays are implemented is with a BCD-to-7-segment decoder/driver chip. This chip takes a 4-bit binary number (like 0101, which corresponds to decimal 5) as an input, and when connected to a 7-segment display, it causes the proper LED segments to turn on and display the corresponding decimal number. The chip used with CA displays is the 7447. For CC displays it is the 7448. Figure 2 shows the pinout diagram for the 7447 and describes its operation. (The actual lettering on the chip may include other letters and numbers like, SN74LS47). By standard convention, pin 1 on any IC package is always the lower leftmost pin when the IC is oriented as shown with the U-shaped notch, or dot toward the left. Pin numbers procede to the right and loop around the right end of the chip as shown. Some IC’s will only have the notch or dot; some have both Figure 2 7447 BCD-to-7-segment decoder driver chip. This chip takes a 4-bit binary number applied to DCBA, where A is the least significant bit (LSB), and grounds the appropriate pin 9-15, so that when these pins are connected to a 7-segment LED display through current limiting resistor, the corresponding decimal number will appear on the display. The 7447 is used to drive common anode (CA) displays. Switch input You will use some switches to provide digital inputs. A switch is either on or off, hence it makes for a very simple digital sensor. You will use two momentary, normally open (NO) b c d e f g a dp decimal point b c d e f g Face View a Internal connection for Common Anode (CA) display 1 7 8 14 3 14 1 13 10 8 7 2 11 9 b c d e g a f 7447 8 1 7 4 5 2 3 6 9 16 10 13 12 15 14 11 B C D A +5 V LT BI/RBO RBIDigital I/O Laboratory DIO-3 San José State University Department of Mechanical and Aerospace Engineering Fall 2000 26SEP00 single pole, single throw pushbutton switches called ‘tact’ switches. These are intended for soldering to PC boards, but by bending the leads properly, they can be inserted into a solderless breadboard. Looking on the underside of the switch, you can see a small dot molded into the plastic body. The two leads on the same side as the dot are tied together internally, and the two leads on the opposite side are tied together internally. When the button is pressed, electrical connection is made between the two sides. BE CAREFUL inserting the switch into the holes in the solderless breadboard. Make sure that each pair of legs that are tied together internally plug into the same row of 5 holes on the breadboard. The legs have already been twisted for you to make correct insertion into the breadboard easy. If you try to insert the switch rotated by 90°, you may damage the breadboard, so pay attention. Procedure Switch-Controlled Display Circuit Figure 3 shows the circuit you will use in this lab. 1. Build the section of the circuit shown in the dashed rectangle (A) first. Do not connect the 7447 to the Stamp yet! (As we have emphasized in previous lab, you will save yourself lots of time, effort, and frustration by building and testing pieces of a complicated circuit rather than trying


View Full Document

SJSU ME 106 - Digital Signal Input and Output

Download Digital Signal Input and Output
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 Digital Signal Input and Output 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 Digital Signal Input and Output 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?