1 Homework Reading –7400 TTL Logic Data Sheets Machine Projects –MP3 due at start of class today –Start looking at MP4 now Labs –Continue labs with your.

Slides:



Advertisements
Similar presentations
Lecture 15 Finite State Machine Implementation
Advertisements

Microprocessors Typical microprocessor controlled devices: Camera, mobile phone, stereo, mp3 player, electronic toys… High-level microprocessor controlled.
1 Homework Reading –Intel 8254 Programmable Interval Timer (PIT) Data Sheet Machine Projects –Continue on MP3 Labs –Continue in labs with your assigned.
EXTERNAL COMMUNICATIONS DESIGNING AN EXTERNAL 3 BYTE INTERFACE Mark Neil - Microprocessor Course 1 External Memory & I/O.
Programmable Interval Timer
The 8051 Microcontroller Chapter 5 SERIAL PORT OPERATION.
8253/54 Timer Section /54 Timer Description and Initialization
1 Homework Reading –Tokheim, Section 13-6 Continue mp1 –Questions? Labs –Continue labs with your assigned section.
Chapter 3 Basic Logic Gates 1.
HD44780 LCD programming From the Hardware Side Design and implementation details on the way to a valid SPI-LCD interface driver.
Interrupts What is an interrupt? What does an interrupt do to the “flow of control” Interrupts used to overlap computation & I/O – Examples would be console.
Asynchronous Communication Hardware  Data within a DTE is usually stored and moved in a parallel fashion.  Data sent across the channel is generally.
Homework Reading Machine Projects Labs Tokheim Chapter 9.1 – 9.6
Spring EE 316 Computer Engineering Junior Lab LCD modules, PROMs, Serial Ports.
CS150 Project Checkpoint 1. Controller Interface Dreamkatz Controller Interface 1. The N64 Controller 2. Physical interface 3. Communication protocol.
7-1 Digital Serial Input/Output Two basic approaches  Synchronous shared common clock signal all devices synchronised with the shared clock signal data.
ECE 371- Unit 11 Introduction to Serial I/O. TWO MAJOR CLASSES OF SERIAL DATA INTERFACES ASYNCHRONOUS SERIAL I/O - USES “FRAMING BITS” (START BIT AND.
SEQUENTIAL CIRCUITS USING TTL 74XX ICS
Network and Systems Laboratory nslab.ee.ntu.edu.tw.
Embedded Systems Design
The 8051 Microcontroller architecture
Objectives How Microcontroller works
Serial Port I/O Serial port sends and receives data one bit at a time. Serial communication devices are divided into: Data Communications Equipment (DCE),
8254 Programmable Interval Timer
The 8051 Microcontroller and Embedded Systems
The 8253 Programmable Interval Timer
MICROPROCESSOR INPUT/OUTPUT
Universal Synchronous/Asynchronous Receiver/Transmitter (USART)
Universal Asynchronous Receiver/Transmitter (UART)
Introduction to Chapter 7
Advanced Microprocessor1 I/O Interface Programmable Interval Timer: 8254 Three independent 16-bit programmable counters (timers). Each capable in counting.
SEQUENTIAL CIRCUITS Component Design and Use. Register with Parallel Load  Register: Group of Flip-Flops  Ex: D Flip-Flops  Holds a Word of Data 
 8251A is a USART (Universal Synchronous Asynchronous Receiver Transmitter) for serial data communication.  Programmable peripheral designed for synchronous.
8279 KEYBOARD AND DISPLAY INTERFACING
EE 316 Computer Engineering Junior Lab Serial Ports, LCD Displays & PROMs.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd.
Universal Asynchronous Receiver/Transmitter (UART)
8279 KEYBOARD AND DISPLAY INTERFACING
Chapter 3 Digital Logic Structures. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 3-2 Transistor: Building.
Chapter Microcontroller
Lab Environment and Miniproject Assignment Spring 2009 ECE554 Digital Engineering Laboratory.
CE-2810 Dr. Mark L. Hornick 1 Serial Communications Sending and receiving data between devices.
Submitted by:.  Project overview  Block diagram  Power supply  Microcontroller  MAX232 & DB9 Connector  Relay  Relay driver  Software requirements.
Chapter 3. Advanced Hardware Fundamentals The various parts you will commonly find in an embedded-system circuit 발표일시 : 발표자 : 채화영.
HJD Institute of Technical Education & Research- Kera(Kutch) The 8051 Microcontroller architecture PREPARED BY: RAYMA SOHIL( )
DEPARTMENT OF ELECTRONICS ENGINEERING V-SEMESTER MICROPROCESSOR & MICROCONTROLLER 1 CHAPTER NO microcontroller & programming.
1 Homework Reading –Tokheim Chapter 9.1 – 9.6 Machine Projects –Continue on mp3 Labs –Continue in labs with your assigned section.
The HCS12 SCI Subsystem A HCS12 device may have one or two serial communication interface. These two SCI interfaces are referred to as SCI0 and SCI1. The.
EET 1131 Unit 12 Shift Registers
Serial mode of data transfer
Homework Reading Continue mp1 Labs Tokheim, Section 13-6 Questions?
Homework Reading Machine Projects Labs Tokheim Chapter 9.1 – 9.6
EET 1131 Unit 11 Counter Circuits
Homework Reading Machine Projects Labs
UNIT – Microcontroller.
Homework Reading (linked from my web page) Machine Projects Labs
Basic Digital Logic.
The 8085 Microprocessor Architecture
EKT 221 – Counters.
Programmable Interval Timer
SERIAL PORT PROGRAMMING
Digital Fundamentals with PLD Programming Floyd Chapter 10
Interfacing Memory Interfacing.
EET 1131 Unit 12 Shift Registers
Serial Communication Interface
Chapter 8 Counters Changjiang Zhang
8253 – PROGRAMMABLE INTERVAL TIMER (PIT). What is a Timer? Timer is a specialized type of device that is used to measure timing intervals. Timers can.
CHAPTER SERIAL PORT PROGRAMMING. Basics of Serial Communication Computers transfer data in two ways: ◦ Parallel  Often 8 or more lines (wire.
Registers and Counters
Costas Foudas, Imperial College, Rm: 508, x47590
Presentation transcript:

1 Homework Reading –7400 TTL Logic Data Sheets Machine Projects –MP3 due at start of class today –Start looking at MP4 now Labs –Continue labs with your assigned section

2 MP3 Discussion What did you learn in MP3?

3 Some Notes on Machine Problem 4 Two parts: –Chip tester –Digital oscilloscope Both use the parallel port to acquire digital data –Chip tester uses parallel port as the source of bits –Digital oscilloscope uses the serial port as the source of bits Most of the code is written! –The number of new lines of code is small –But effort to understand other code is substantial 

4 Chip Tester Hardware Special device attached to parallel port Example shown is one fourth of 74LS00 SAPC 5 or 6 LPT1: Pins 74LS00

5 Chip Tester Software Chip data structures central to the testing code

6 Chip Tester Software Chip data structures central to the testing code typedef struct { char *chipname; /* "LS00" or whatever */ char *chipdesc; /* description string */ int n_highpins; /* no. of logic-1 pins */ int *highpins; /* array of logic-1 pin nos. */ int n_lowpins; /* no. of logic-0 pins */ int *lowpins; /* array of logic-0 pin nos. */ int n_inpins; /* no. of input pins */ int *inpins; /* array of input pin nos. */ int n_outpins; /* no. of output pins */ int *outpins; /* array of output pin nos. */ PFI_I_IPTR softchip; /* does chip logic in software */ } Chip;

7 Chip Tester Configuration SAPC boards 5 & 6 have the parallel port wired to test an LS00 (quad NAND gate chip) SAPC boards 7 & 8 have the parallel port wired to test an LS138 (3-to-8 decoder chip) The given code makes a correspondence between: –Data register bits for the parallel port (0:7) –The DB25 connector (pins 2-9 and 10-13, 15) –The chip pins (1-14 or 1-16) –The direction of the chip pins (input or output) (Input or output is defined from the chip point of view) Note that the LS00 is symmetric in that the pins on the left side of the chip are functionally equivalent to the pins on the right side

8 ls00_chip.c Builds external (global) Chip struct for ls00 static int high_pindata[] = {14}; /* VCC and active high inputs */ static int low_pindata[] = {7}; /* GND and active low inputs */ static int input_pindata[] = { 1, 2, 4, 5, 9, 10, 12, 13 }; static int output_pindata[] = { 3, 6, 8, 11 }; Chip ls00 = {"LS00","quad NAND gate", sizeof(high_pindata)/sizeof(high_pindata[0]),high_pindata, sizeof(low_pindata)/sizeof(low_pindata[0]),low_pindata, sizeof(input_pindata)/sizeof(input_pindata[0]),input_pindata, sizeof(output_pindata)/sizeof(output_pindata[0]),output_pindata, ls00_softchip}

9 ls00_chip.c The truth table holds the testing information: /* truth table: in pin out pin 6 3 */ static int TT[] = { 0x03, /* */ 0x03, /* */ 0x03, /* */ 0x02, /* */ 0x03, /* */ 0x03, /* */ 0x03, /* */ 0x02, /* */ 0x03, /* */ 0x03, /* */ 0x03, /* */ 0x02, /* */ 0x01, /* */ 0x01, /* */ 0x01, /* */ 0x00, /* */ };

10 ls138_softchip Have three bits of input data (A 0, A 1, and A 2 ) Have three bits of enable (E 1 #, E 2 #, and E 3 ) –Where # means an inverted signal or active low Can support only five bits of output data (O 0 #, O 1 #, …O 7 #) Since softchip function has two arguments, the input data and the output results one solution would be a 32 entry table – but there are other ways of doing this

11 Changes to chiptest.c 1.Finish writing code in chiptest function Generate the possible input bit patterns to chip Read back the output pins from the chip Compare output bit patterns to softchip results to see if chip is functioning correctly 2.Test with provided ls00 tables – good and bad 3.Write new tables for LS138 4.Test with your tables – good and bad 5.Write discussion.txt

12 Digital Oscilloscope Hook back the COM1 port to LPT1 but use a level converter (called a line receiver) to make sure voltage conversion is done (We don’t want a “Was” Gate) As project description explains, sampling rate is about 100 times faster than bit times (at 9600 baud) Using | for high and _ for low, plus ||nn|| or __nn__ for a sequence of highs and lows, the displayed results might be: ||88||__67__|__||___||82|| –or “88 highs”, “67 lows”, “1 high”, “2 lows”, “2 highs”, “3 lows”, and “82 highs”

13 Digital Oscilloscope Hardware Connection between serial and parallel port Through voltage converter (+/- 12  0 – 5V) SAPC 9 or 10 LPT1: BUSY Voltage Converter COM1: TXD

14 UART Receiver Sampling Characters are sent/received asynchronously –Clocks of receiver and transmitter are independent and only nominally at the same rate (+/- 0.01%) –Furthermore, the phases of the clocks relative to each other are completely arbitrary Receiver strategy: –Synch on initial edge then “center sample” bits –Sample 16 times the baud rate, starting with the eighth clock period after leading edge of start bit

15 UART Receiver Sampling “Ideal” Serial Data Waveform What the Receiver “sees” Therefore receiver “center samples” data bits to get accurate indication of one or zero state Mark Idle Start BitLSB Data... LateEarlyWho knows?Wow!

16 UART Receiver Sampling Receiver runs its clock to check for one or zero state of input RXD signal at 16 times bit rate: Detect Edge of Start Bit Count 8 clock times to get to center of start bit Count 16 clock times to sample at center of each data bit interval Avoids “seeing” any glitches between the bit intervals

17 Setting the Baud Rate UART over samples incoming bit –Sample rate is 16X baudrate –UART has an input clock at MHz –Must calculate baudrate divisor: Divisor = UART_BAUD_CLOCKHZ/(baudrate * 16) –Look at serial.h where UART baud rate is set through the Line Control Register (LCR) and DLM/DLL registers Turn on Divisor latch access bit (UART_LCR_DLAB) Load MSB of divide down counter value into UART_DLM Load LSB of divide down counter value into UART_DLL Turn off Divisor latch access bit (UART_LCR_DLAB)

18 Baudrate Generator Set DLAB bit in “Line Control” UART register to use UART registers 0 and 1 for 16-bit divisor value outpt(baseport + UART_LCR, (inpt(baseport + UART_LCR)) | UART_LCR_DLAB); Then put out two bytes containing divisor –9600 bps => divisor of 12 –19,000 bps => divisor of 6 Address 0 Address 1 Receive/Transmit Holding Register(s) Interupt Enable Register DLAB Bit DLM/DLL RegistersBaud Rate Generator (16 times baud rate) = 1 = 0

19 Remaining Steps in scope.c After setting up baud rate –Output a character to the serial port (COM1) –Collect the data collect.c inputs from the LP_STATUS bit and saves into an array of data points up to a MAXDATA times You are asked to re-implement collect.c as an assembly language routine ascollect.s –Code is similar to collect.c in that it loops MAXDATA times moving the LP_STATUS bit into the data array –Display the results This code is written for you