Logic Families.

Slides:



Advertisements
Similar presentations
INPUT-OUTPUT ORGANIZATION
Advertisements

Anurag Dwivedi Rudra Pratap Suman. Scope of Communica tion Telephones and Cell Phones.
EXTERNAL COMMUNICATIONS DESIGNING AN EXTERNAL 3 BYTE INTERFACE Mark Neil - Microprocessor Course 1 External Memory & I/O.
82C55 82C55 Programmable Peripheral Interface Interfacing Part III.
The 8085 Microprocessor Architecture
SHIFT REGISTERS: CONVERTING BETWEEN SERIAL AND PARALLEL DATA Mark Neil - Microprocessor Course 1 Serial versus Parallel Data Transfers.
Serial Interfaces, Part Deux -I 2 C and SPI December 4, 2002 Presented by Eugene Ho.
SPI Serial Peripheral Interface. SPI Serial Peripheral Interface is communication between two devices, one bit at a time sequential one bit at time over.
Lecture 8: Serial Interfaces
PH4705 ET4305 Interface Standards A number of standard digital data interfaces are used in measurement systems to connect instruments and computers for.
HD44780 LCD programming From the Hardware Side Design and implementation details on the way to a valid SPI-LCD interface driver.
Serial Peripheral Interface (SPI)
7-1 Digital Serial Input/Output Two basic approaches  Synchronous shared common clock signal all devices synchronised with the shared clock signal data.
Haptic Belt team Informational Presentation.  I 2 C is a form of control bus (multi-master) which allows communication between multiple integrated circuits.
INPUT-OUTPUT ORGANIZATION
Interfaces A practical approach. Lesson 2 I2C and SPI
1 EECS 373 Design of Microprocessor-Based Systems Prabal Dutta University of Michigan Lecture 10: Serial buses Oct 6, 2011.
Microprocessor Block Diagram
Computer Architecture Lecture 08 Fasih ur Rehman.
Serial Peripheral Interface (SPI) Bus. SPI Bus There is no official specification for the SPI bus. It is necessary to consult the data sheets of the devices.
Serial Peripheral Interface Module MTT M SERIAL PERIPHERAL INTERFACE (SPI)
HD44780 LCD programming From the Hardware Side
Logic Families. A bit of history The first transistors were fabricated in 1947 at Bell Laboratories (Bell Labs) by Brattain with Bardeen providing the.
Khaled A. Al-Utaibi  Intel Peripheral Controller Chips  Basic Description of the 8255  Pin Configuration of the 8255  Block Diagram.
LSU 10/22/2004Serial I/O1 Programming Unit, Lecture 5.
CRKit RF Control WINLAB – Rutgers University Date : June Authors : Prasanthi Maddala, Khanh Le,
CRKit RF Control WINLAB – Rutgers University Date : June Authors : Prasanthi Maddala, Khanh Le,
4.0 rtos implementation part II
CRKit RF Control WINLAB – Rutgers University Date : June Authors : Prasanthi Maddala, Khanh Le,
CRKit RF Control WINLAB – Rutgers University Date : June Authors : Prasanthi Maddala, Khanh Le,
The 8253 Programmable Interval Timer
Microcontroller based system design Asst. Prof. Dr. Alper ŞİŞMAN.
Lecture 20: Communications Lecturers: Professor John Devlin Mr Robert Ross.
DEVICES AND COMMUNICATION BUSES FOR DEVICES NETWORK
Eng.Samra Essalaimeh Philadelphia University 2013/ nd Semester PIC Microcontrollers.
12/16/  List the elements of 8255A Programmable Peripheral Interface (PPI)  Explain its various operating modes  Develop a simple program to.
OCRP RF Control WINLAB – Rutgers University Date : June Authors : Prasanthi Maddala, Khanh Le,
©2008 R. Gupta, UCSD COSMOS Summer 2008 Peripheral Interfaces Rajesh K. Gupta Computer Science and Engineering University of California, San Diego.
OCRP RF Control WINLAB – Rutgers University Date : June Authors : Prasanthi Maddala, Khanh Le,
Essentials of Communication This simple model requires many guarantees. Sender Receiver Communication Link Data.
Introduction to Microprocessors - chapter3 1 Chapter 3 The 8085 Microprocessor Architecture.
Unit 1 Lecture 4.
Department of Electronic & Electrical Engineering Serial interfaces Serial Interfaces allow communication between devices sending one bit at a time. In.
Serial Peripheral Interface SPI I2C (i-squared cee)
Chapter 3 Parallel Ports, Power Supply and the Clock Oscillator The aims of this chapter are to introduce: Why we need parallel input/output; How simple.
SHIFT REGISTERS: CONVERTING BETWEEN SERIAL AND PARALLEL DATA Mark Neil - Microprocessor Course 1 Serial versus Parallel Data Transfers.
The World Leader in High Performance Signal Processing Solutions SD/SDIO Introduction Cliff Cai.
Networked Embedded Systems Sachin Katti & Pengyu Zhang EE107 Spring 2016 Lecture 9 Serial Buses – SPI, I2C.
BIRLA VISHVAKARMA MAHAVIDYALAY SUBJECT: SPI PROTOCOL & MAX7221 DISPLAY INTERFACING SUBMITTED BY: KISHAN AVASTHI( ) MANSI CHANDEGARA( )
میکرو کنترلرهای AVR Serial Interfaces, I2C and SPI
MICROCONTROLLER AND INTERFACING Presented by: Shefali Jethva ( ) Shivali Panchal ( ) Komal Soni ( ) Roll no. :- 14EC308.
1 Serial Peripheral Interface What is it? Basic SPI Capabilities Protocol Pros and Cons Uses Serial Peripheral Interface
©F.M. Rietti Communication Lines Fundamentals. ©F.M. Rietti LM-18 Computer Science SSI Embedded Systems I 2 Communication Lines Generally used to connect.
Serial Communications
Chapter 6 Input/Output Organization
EE 107 Fall 2017 Lecture 5 Serial Buses – UART & SPI
Chapter 11: Inter-Integrated Circuit (I2C) Interface
The 8085 Microprocessor Architecture
I2C PROTOCOL SPECIFICATION
Communication Lines Fundamentals.
An Introduction to Microprocessor Architecture using intel 8085 as a classic processor
Pulse Width Modulation (PWM)
8255.
Parallel communication interface 8255
HD44780 LCD programming From the Hardware Side
HD44780 LCD programming From the Hardware Side
The 8085 Microprocessor Architecture
Logic Families Rayat Shikshan Sanstha’s
The Programmable Peripheral Interface (8255A)
Serial Communications
Presentation transcript:

Logic Families

Logic Families Logic families are sets of chips that may implement different logical functions, but use the same type of transistors and voltage levels for logical levels and for the power supplies.

Logic Families TTL: Transistor-Transistor Logic BJTs are used. Introduced commercially in 1963 and still in production, though phasing out. High energy consumption, but relatively insensitive to electrostatic discharge (ESD) ECL: Emitter-Coupled Logic BJTs are used. Invented in 1956. High energy consumption, but can be designed for extremely high speeds. CMOS: Complementary Metal-Oxide-Semiconductor FETs are used. Invented in 1963. First large volume application is in 1974. Considerably lower energy consumption than TTL and ECL, which has made portable electronics possible. BIMOS or BICMOS Combination of BJTs and FETs in the same circuit.

Naming Convention Logic gates that start with a “54” meet a much more stringent specification on temperature operation than logic gates that start with “74”. Most consumer electronics are build with “74” type of logic gates. “74 __ XX” where: the __ are one to three letters from the English alphabet that indicate the type of transistors that are used to fabricate the logic gate the XX are a set of two-to-four Arabic numbers that indicate the type of logic gate (e.g., AND gate)

Interface Circuits If you use multiple logic families in a system design: You will likely need to use a voltage translator to insure that a logical “0” and logical “1” are recognized as the signal moves from one logic family to another. You may also need a current source to provide enough current into or out of the BJT-based logic. Something to keep in mind when designing your microprocessor project.

Electronic Design Project The logical output voltages from the mbed are 0V and 3.3V. From the datasheet of the Maxum LED driver MAX7219CNG Thus, the logical high of the mbed will be interpreted as an undefined logical level by the LED driver.

Solutions Voltage comparator Simple Transistor Inverter or Buffer Is it fast enough for the data rate on the SPI output of the mbed? What is the power consumption of the operational amplifier compared to other alternatives? Simple Transistor Inverter or Buffer Lowest power consumption if you select the correct transistor and resistor. IC Inverter or Buffer

MAX7219CNG LED Driver Note that the LED driver is compatible with SPI, QSPI, and MICROWIRE inputs. There are SPI (Serial Peripheral Interface) pins on the mbed to send data to the LED driver. Chapter 7 of Fast and Effective Embedded System Design by R. Toulson and T. Wilmshurst

Serial Peripheral Interface SPI for short Toulson, R. & Wilmshurst, T. (2012). Fast and Effective Embedded Systems Design - Applying the ARM mbed, Newnes, Oxford, ISBN: 9780080977683

Serial Communication The mbed has many serial communications capabilities for communicating externally and to control other hardware SPI; I2C, CAN, USB Lets take a tour around SPI to get a feel for how these types of protocol work. Further details can be found on the mbed website. Serial Peripheral Interface (SPI) bus operates with a master/slave configuration SPI is a synchronous serial data communication protocol

Introducing Serial Data Communication In serial data transfer, one bit of the data is transmitted at a time, along a single interconnection, accompanied by as many other interconnections as are needed to define bit timing, word framing, and other control data. While slower than parallel data communication, the small number of wires needed is a huge advantage in terms of PCB tracks, interconnecting wires, and IC pins.

The Basics of a Serial Port: the Shift Register An essential feature of most serial links is a shift register. This is made up of a string of D flip-flops, connected so that the output of one is connected to the input of the next. Each flip-flop holds one bit of information. Every time the shift register is pulsed by the clock signal, each flip-flop passes its bit on to its neighbour on one side, and receives a new bit from its other neighbour. The one at the input end clocks in data received from the outside world, and the one of the output end outputs its bit. An 8-Bit Shift Register – a Possible Receiver and/or Transmitter of Serial Data

Introducing Synchronous Serial Communication Once we start applying the serial concept, a number of challenges arise. How does the receiver know when each bit begins and ends, and how does it know when each word begins and ends? A straightforward approach is to send a clock signal alongside the data, with one clock pulse per data bit. The data is synchronised to the clock. This idea, called synchronous serial communication, is shown here. Synchronous serial data

Serial link A simple serial data link is shown. Node 1 is designated Master; it controls what’s going on, as it controls the clock. The Slave (Node 2) is similar to the Master, but receives the clock signal from the Master.

Serial Peripheral Interface (SPI) In the early days of microcontrollers, both National Semiconductors and Motorola started introducing simple serial communication, based on the previous Figure. Each formulated a set of rules which governed how their microcontrollers worked, and allowed others to develop devices which could interface correctly. These became de facto standards. Motorola called its standard Serial Peripheral Interface (SPI), and National Semiconductors called theirs Microwire. They’re very similar to each other. An SPI network with one Master and multiple slaves can be constructed as shown.

SPI on the mbed: Master The mbed has two SPI ports, each can be configured as Master or Slave. The application programming interface (API) summary for SPI Master is shown. On the mbed, as with many SPI devices, the same pin is used for SDI if in Master mode, or SDO if Slave. Hence this pin gets to be called MISO, Master in, Slave out. Its partner pin is MOSI. Functions Usage SPI Create a SPI master connected to the specified pins format Configure the data transmission mode and data length frequency Set the SPI bus clock frequency write Write to the SPI Slave and return the response

SPI on the mbed: Mode Mode Polarity Phase 1 2 3 The mode is a feature of SPI that allows choice of which clock edge is used to clock data into the shift register (indicated as “Data strobe” in the diagram), and whether the clock idles high or low. For most applications the default mode, i.e. Mode 0, is acceptable.

Clock Polarity and Phase Mode Polarity Phase 1 2 3 The SPI protocol uses 4 signals clock (SCLK) http://dlnware.com/theory/SPI-Transfer-Modes

Clock Bit 0 Bit 1 Bit 2 Bit 3 Bit 4 Bit 5 Bit 6 Bit 7 Serial data Data is synchronised to the clock When there is no data being sent, there is no signal on the clock line Every time the clock pulses, one bit is output by the transmitter and should be read by the receiver The receiver synchronises its reading of the data with an edge of the clock. Parallel Read/write Parallel Read/write SDO SDI SDO – serial data out SDI – serial data in SCLK – serial clock Shift Register Shift Register SDI SDO msb lsb msb lsb SCLK SCLK Clock Master Slave

SPI Master Program This program shows a setup for a SPI Master. It initialises the SPI port, choosing for it the name ser_port, with the pins of one of the possible ports being selected. The format( ) function requires two variables, the first is the number of bits, and the second is the mode. This program simply applies default values, i.e. 8 bits of data, and Mode 0 format. /* Program Example 7.1: Sets up the mbed as SPI master, and continuously sends a single byte */ #include "mbed.h“ SPI ser_port(p11, p12, p13); // mosi, miso, sclk char switch_word ; //word we will send int main() { ser_port.format(8,0); // Setup the SPI for 8 bit data, Mode 0 operation ser_port.frequency(1000000); // Clock frequency is 1MHz while (1){ switch_word=0xA1; //set up word to be transmitted ser_port.write(switch_word); //send switch_word wait_us(50); }

Creating an SPI data link: Master 1 This program is written for the circuit shown. It declares a variable switch_word, the word that will be sent to the Slave, and the variable recd_val, which is the value received from the Slave. /*Program Example 7.2. Sets the mbed up as Master, and exchanges data with a slave, sending its own switch positions, and displaying those of the slave. */ #include "mbed.h" SPI ser_port(p11, p12, p13); // mosi, miso, sclk DigitalOut red_led(p25); //red led DigitalOut green_led(p26); //green led DigitalOut cs(p14); //this acts as “slave select” DigitalIn switch_ip1(p5); DigitalIn switch_ip2(p6); char switch_word ; //word we will send char recd_val; //value return from slave //continued over

Creating an SPI data link: Master 2 int main() { while (1){ //Default settings for SPI Master chosen, no need for further configuration //Set up the word to be sent, by testing switch inputs switch_word=0xa0; //set up a recognisable output pattern if (switch_ip1==1) switch_word=switch_word|0x01; //OR in lsb if (switch_ip2==1) switch_word=switch_word|0x02; //OR in next lsb cs = 0; //select slave recd_val=ser_port.write(switch_word); //send switch_word and receive data cs = 1; wait(0.01); //set leds according to incoming word from slave red_led=0; //preset both to 0 green_led=0; recd_val=recd_val&0x03; //AND out unwanted bits if (recd_val==1) red_led=1; if (recd_val==2) green_led=1; if (recd_val==3){ }

SPI on the mbed: Slave The Slave program (next slide) uses the mbed functions shown in the Table. It is almost the mirror image of the Master program, with small but key differences. It also declares variables switch_word and recd_val. The Slave program configures its switch_word just like the Master. While the Master initiates a transmission when it wishes, the Slave must wait. The mbed library does this with the receive( ) function. This returns 1 if data has been received, and 0 otherwise. If data has been received from the Master, then data has also been sent from Slave to Master. Functions Usage SPISlave Create a SPI slave connected to the specified pins format Configure the data transmission format frequency Set the SPI bus clock frequency receive Polls the SPI to see if data has been received read Retrieve data from receive buffer as slave reply Fill the transmission buffer with the value to be written out as slave on the next received message from the master.

Creating an SPI data link: Slave /*Program Example 7.3: Sets the mbed up as Slave, and exchanges data with a Master, sending its own switch positions, and displaying those of the Master. as SPI slave. */ #include "mbed.h" SPISlave ser_port(p11,p12,p13,p14); // mosi, miso, sclk, ssel DigitalOut red_led(p25); //red led DigitalOut green_led(p26); //green led DigitalIn switch_ip1(p5); DigitalIn switch_ip2(p6); char switch_word ; //word we will send char recd_val; //value received from master int main() { //default formatting applied while(1) { //set up switch_word from switches that are pressed switch_word=0xa0; //set up a recognisable output pattern if (switch_ip1==1) switch_word=switch_word|0x01; if (switch_ip2==1) switch_word=switch_word|0x02; if(ser_port.receive()) { //test if data transfer has occurred recd_val = ser_port.read(); // Read byte from master ser_port.reply(switch_word); // Make this the next reply } //now set leds according to received word ... (continues as in Program Example 7.2)

Evaluating SPI The SPI standard is extremely effective. The electronic hardware is simple and therefore cheap, and data can be transferred rapidly. There are disadvantages. There is no acknowledgement from the receiver, so in a simple system the Master cannot be sure that data has been received. There is no addressing. In a system where there are multiple slaves, a separate |SS line must be run to each Slave, as seen earlier. Therefore we begin to lose the advantage that serial communications should give us, i.e. a limited number of interconnect lines. There is no error-checking. Suppose some electromagnetic interference was experienced in a long data link, data or clock would be corrupted, but the system would have no way of detecting this, or correcting for it. Overall SPI could be graded as: simple, convenient and low-cost, but not appropriate for complex or high reliability systems.

Each SDO is connected to the lsb of the other shift register (SDI) Parallel Read/write Parallel Read/write SDO SDI SDO – serial data out SDI – serial data in SCLK – serial clock Shift Register Shift Register SDI SDO msb lsb msb lsb SCLK SCLK Clock Master Slave Assume the shift registers in the Master and Slave are 8-bit – each has 8 D-type flip-flops Each register is loaded with a new word via the parallel I/O lines The Master then produces 8 clock pulses. For each clock pulse, data is output from the msb of each register (SDO) Each SDO is connected to the lsb of the other shift register (SDI) As each bit is clocked out of one register, it is clocked into the other. After 8 clock cycles, the word that was in the master shift register as been transferred to the slave shift register, and vice versa.

SPI: Master-Slave Configuration master data output/slave data input (MOSI) master data input/slave data output (MISO) slave chip select (CS) – usually active low When multiple slave devices exist, the master must output a unique CS signal for each slave, but data lines can be shared. The programmer must know how data is timed between peripherals when shared.

SPI The master device starts an SPI data transfer by doing the following : Configures to SPI clock (SCLK) to be a frequency that the recipient slave device can handle (max is 70 MHz) Sets the chip select line (CS) of the intended recipient to 0 V Starts the clock pulses on SCLK to indicate that that data is to be transferred Simultaneously sends data as consecutive bits on MOSI Number of bits in each data frame can be configured, but is usually between 4 and 16 bits. The slave returns data in the same manner on MISO.

SPI /* Sets up the mbed as SPI master, and continuously sends a single byte of data */ # include “mbed.h” SPI ser_part(p11, p12, p13); //mosi, miso, sclk char switch_word ; // word we will send int main() { ser_port.format(8,0); // Setup for 8 bit data, Mode 0 operation ser_port.frequency(1000000); // clock frequency is 1 MHz while (1){ switch_word=0xA1; //set up word to be transmitted ser_port.write(switch_word); //send switch_word wait_us(50); }

CLK DATA 1 1 1 A 1

Disadvantages of Synchronous Serial Data Communication Synchronous serial communication protocols are extremely useful ways of moving data around. But taking a clock signal to every node does have these disadvantages: An extra (clock) line needs to go to every data node. The bandwidth needed for the clock is always twice the bandwidth needed for the data; therefore, it is the demands of the clock which limit the overall data rate. Over long distances, clock and data themselves could lose synchronisation.

Electronic Design Project The LED driver should be configured as the slave as it will only act on data sent from the microcontroller. You need to configure the data to be sent to the LED driver using the information provided in the LED driver datasheet.

Can You Answer These Questions? An SPI link is running with a 500 kHz clock. How long does it take for a single message containing one data byte to be transmitted? An mbed is to be set up as SPI Master, using pins 11, 12, and 13, running at a frequency of 4MHz, with 12-bit word length. The clock should idle at Logic 1, and data should be latched on its negative edge. Write the necessary code to set this up. You need to set up a serial network, which will have one Master and four Slaves. Every second, data has to be distributed, such that one byte is sent to Slave 1, four bytes are sent to Slave 2, three bytes are sent to Slave 3, and four bytes are sent to Slave 4. If the complete data transfer must take not more than 200 us, estimate the minimum clock frequency which is allowable for SPI. Assume there are no other timing overheads.