Presentation is loading. Please wait.

Presentation is loading. Please wait.

Interfacing to peripherals - Seven Segment display (1)

Similar presentations


Presentation on theme: "Interfacing to peripherals - Seven Segment display (1)"— Presentation transcript:

1 Interfacing to peripherals - Seven Segment display (1)
The seven-segment display is a common display format. Each set of 7 LEDs is arranged so that it can display any Alpha-Numeric digit. Technical features and usage of Seven-segment display units: Some devices, such as the one shown in the image, need external power supply, TAKE CARE when setting (In this case 9 volts 0.3 Amp) Can be connected to any of the 8-bit ports This particular unit multiplexes the two display digits onto a single port so can actually only display one character at a time (need to alternate at high speed to have 2-character appearance) 1 Richard Anthony

2 Segment addressed, or control function
Interfacing to peripherals - Seven Segment display (2) Each element of the seven-segment display is separately accessible. Any character can be displayed by choosing the appropriate LED pattern. Ports have 8 bits: 7 bits directly address one segment each 1 bit selects which digit to map the pattern onto The device shown multiplexes TWO digit displays. The value of this bit allows the two 7-bit data values to be multiplexed onto a single 8-bit port MSD LSD 1 2 3 4 5 6 Port bit 7 (MSB) 6 5 4 3 2 1 0 (LSB) Segment addressed, or control function Select Digit 1=LSD 0=MSD Centre Upper Left Lower Left Bottom Lower Right Upper Right Top 1 control bit bit data pattern 2 Richard Anthony

3 Data pattern (lower 7 bits)
Interfacing to peripherals - Seven Segment display (3) To display a single character on the most significant digit (MSD), place the required pattern on the lower seven bits of the port. The MSB should be ‘0’ For example to display ‘O’ (or ø) on the MSD, use the pattern To display a single character on the least significant digit (LSD), place the required pattern on the lower seven bits of the port. The MSB should be ‘1’ For example to display ‘O’ (or ø) on the LSD, use the pattern Some other examples are shown in the table right: Character to display Data pattern (lower 7 bits) ‘O’ or ‘ø’ ‘L’ ‘I’ or ‘1’ ‘A’ ‘E’ ‘S’ or ‘5’ ‘3’ ‘9’ 3 Richard Anthony

4 Interfacing to peripherals - Seven Segment display (4)
Writing code to achieve multiplexing for the specific display shown The seven-segment display does not latch the values sent to it. This means that only one digit can be displayed at a time. Luckily the computer operates at much higher speeds than human visual perception, so to make it appear that both digits are displayed at the same time we can alternately display each digit at a suitably high rate. For example, to display the value ‘35’ you need to alternate the following bit patterns on the port: (to display ‘5’ on the LSD) (to display ‘3’ on the MSD) If the alternation is two slow, the display will appear to flicker and is annoying to look at. An appropriate interlace rate is about 50Hz or greater (Florescent tubes flicker at 50Hz). 4 Richard Anthony


Download ppt "Interfacing to peripherals - Seven Segment display (1)"

Similar presentations


Ads by Google