TKT-3500 Microcontroller systems
|
|
- Paul Robertson
- 5 years ago
- Views:
Transcription
1 TKT-3500 Microcontroller systems Lec 5 IO part2: synchr. USART, SPI, I2C, GPIO Teemu Laukkarinen Department of Computer Systems Tampere University of Technology Fall 2011
2 Sources Original slides by Erno Salminen Robert Reese, Microprocessors: From Assembly to C with the PIC18Fxx2, Charles River Media, 2005 Tim Wilmshurst, Designing Embedded Systems with PIC Microcontrollers Principles and applications, Elsevier, Wikipedia TotalPhase Knowledge Base - Article #2/62
3 Contents Synchronous serial bus protocols USART in synchronous mode Separate data line and clock NOTE: not really a bus, since does not have built in support for master multiple slaves SPI - Serial peripheral interface Separate data lines and clock, chip select lines I2C - Inter integrated chip Only data line and clock CAN - controller area network One line synchronization (4 physical lines) USB universal serial bus One line synchronization (4 physical lines) #3/62
4 Update/reminder: Clocking: synchronous vs. asynchronous Luennoija selitti ekalla kerralla asian hivenen huonosti, joten lyhyt nopea ja (toivottavasti) selventävä kertaus! #4/62 a) Synchronous a common timing signal is established that dictates when individual bits can be read from the serial line i. Separate clock signal (two lines, obvious) ii. Clocking is encoded into data (so that receiver can synchronize to the senders clock, see iii) iii. Receiver s clock is synchronized to the data stream (one line) b) Asynchronous uses none of the above methods i-iii) sender and receiver agree on a common data rate Receiver reads bits when it thinks it should be ok Errors are a case of propability Simple HW, but lower bandwidth
5 Reminder: Synchronous serial IO ii) ii) Data strobe encoding Two lines: data line and strobe line Data line always contains the serial data, nothing special here Strobe encodes the clock, it has a pulse if data does not change -> Either Data or Strobe changes its logical value in one clock cycle, but never both Clock can be extracted with XOR from data and strobe line Better tolerance for wire delays compared to data+clk IEEE 1394 or FireWire uses this #5/62 Fig. 9.5 Data strobe encoding
6 Reminder: Synchronous serial IO iii) iii) Synchronization with one line Independently generated clocks of the same frequency might be out of phase PLL modifies receiver s clock to macth the sender s the data line must have enough changes within a particular time interval (transition density) so that PLL can synchronize itself continuously Thus, the line must be encoded to have enough transitions if the data does not have them Otherwise, PLL does not work Often, a start sequence is needed a b #6/62
7 Asynchronous serial IO Does not transmit the clock on any way Sender and receiver trust that other reads line at correct moments Does not guarantee a particular transition density the data line could remain in the same state, either 1 or 0 for the duration of the transmission after the initial state change indicating start of transmission READ: does not transmit any synchronization over the serial line, which could be used to remove out of phase problems Separate start and stop bits are sent to synchronize start and end of the transmission and to catch possible timing errors or trying to catch them as many have found out on the exercises by setting wrong baudrate #7/62
8 USART synchronous mode
9 USART synchronous mode Usage is pretty much the same to asynchronous mode Example shows a write operation where PIC is the master #9/62
10 USART synchronous mode (2) Single Receive Enable (SREN) initiates the transfer One may use also Continuous Receive (CREN) External device drives DT on each clk pulse #10/62
11 USART synchronous mode (3) There is no pre-defined baud rate because separate clk signal is used Just ensure that receiver is fast enough Any lower baud rate may be opted f Baud rate R baud = (11.1) (4 * (SPBRG+1)) where f is the clk frequency clk divisor is constant 4 unlike in asynch. mode SPBRG is counter s period (num of cycles) #11/62
12 SPI and I2C
13 SPI and I2C Possibly two most common serial buses SPI Serial Peripheral Interface requires at least 3 wires and usually 4 technically duplex but most transfers are half-duplex higher top speed than I2C I2C Inter IC two wires regardless of the number of communicating devices half-duplex lower top speed than SPI Non-licensed I2C implementations reffered often as two-wire or I2C compliant #13/62
14 SPI and I2C (2) Both are synchronous serial interface standards Clock provided as separate signal Both are rather common in industry Master Synchronous Serial Port (MSSP) subsystem implements these protocols in PIC18 They share IO pins One can use also GPIO pins and implement the protocol with SW Subsystem Protocol Classification Pins USART N/A Half-duplex RC6/TX/CK (clock), RC7/DT (data) MSSP SPI Duplex RC3/SCK/SCL (clock), RC4/SDI/SDA (data in), RC5/SDO (data out) MSSP I2C Half-Duplex RC3/SCK/SCL (clock), RC4/SDI/SDA (data) #14/62
15 SPI
16 SPI - Serial peripheral interface Originally developed by Motorola Frequencies are commonly in the range of 1-70 MHz Very simple protocol Data is sent MSb first (unlike in USART) Sometimes called a "four wire" serial bus Clock, data in both directions, and slave select Note that there is one select signal for each slave Num of signals grows with larger systems Actually it is 3+n wire bus, where n 1 Three other signals are shared by all slaves SPI can mean also System Packet Interface, family of interfaces from the Optical Internetworking Forum, but that does not interest us #16/62
17 Full-duplex in SPI Special full-duplex operation: Master and slave exchange data Data is shifted out from SDO while shifting other data in from SDI 1. Write the data to send here first 2. Read slave s data from here at the end ctrl bits will be explained later interrupt flag #17/62
18 SPI signals The SPI bus specifies four logic IO signals 1. SCK Serial Clock (output from master) 2. SDI Serial Data In 3. SDO Serial Data Out 4+. CS, CS# Chip Select (active low) Alternative naming conventions are also used: SCLK, CLK Serial clk MOSI/SIMO, DO Master Output-Slave Input, data out MISO/SOMI, DI Master Input, Slave Output, data in SS, STE Slave Select, Slave Transmit Enable #18/62
19 Connecting slaves Slave select is driven low prior to transfer and must remain low for the whole duration 1. Independent slaves: one-hot SS, tri-state MISO, more common 2. Co-operative slaves: chained together, single SS, rare 1. Typical SPI bus: master and three independent slaves 2. Daisy-chained SPI bus: master and cooperative slaves #19/62
20 SPI configuration possibilities 1. CKE bit = clock edge selection 2. CKP bit = clock polarity selection 3. SMP bit = input sample point selection 4. SSPM = synchr. serial port mode controls the SCK freq. TX on idle to active TX on active to idle Sample at middle Sample at end idle = low idle = high idle = low idle = high #20/62 CPU can read the from SSPBUF after interrupt flag is set
21 SPI usage Simple protocol No addressing nor commands defined in the standard Low overhead Handled by SPI HW Control data is device-specific Dig. potentiometer, serial EEPROM, AD- and DA-converter How many bits for commands, address, data etc. Basically, this means that one of the communicating devices is programmable It can adapt to the protocol assumed by the other SW running on PIC takes care of sending correct data words #21/62
22 SPI usage: MCP41xxx digital potentiometer Potentiometer provides variable resistance Controlled via parallel or serial interface Analog potentiometer is wiped mechanically Three terminals full resistance between PA0 and PB0 variable resistance from wiper, PW0-PA0 and PW0-PB0 #22/62 PIC is the master
23 SPI usage: MCP41xxx (2) Output s theoretical value range [1, 1/256] * Vdd Each transaction has exactly 2 bytes 1. Command does not need all 8 bits 2. Data value of variable resistance R Note that bits are sent MSb first #23/ xx01xxx xx10xxx1
24 SPI usage 2: serial EEPROM Another example shows how to use an external EEPROM for non-volatile storage Slaves EEPROM and potentiometer are independent separate slave select for each #24/62 Mem s HOLD and WP# inputs are deactivated by pull-up in the example RB4 or RB7 used as slave select pins 8
25 SPI usage: serial EEPROM (2) Mem transaction has 1 command byte 2 address bytes, uppermost bits are ignored 1-32 data bytes, mem updates internal address automatically EEPROM samples data on rising edge and writes output at falling edge (CKP=0, CKE=1, SMP=1) #25/62 1. read operation To continue reading or writing from/to sequential 2. write operation addresses provide more clock pulses
26 SPI usage: serial EEPROM (3) Mem is internally divided into 32-byte pages A multibyte write operation will wrap if addresses grow beyond page border All data goes into the same page Example of wrapping in fig b next 32-byte page string does not go here #26/62
27 SPI usage: serial EEPROM (4) Q: How long does it take to write one page of data to EEPROM? PIC s frequency f= 40 MHz SPI control SW overhead 20 instr/byte EEPROM s f max = 3 5V A: SPI frequency f SCK = 2.5 MHz < 3 MHz comes from 40MHz / 16 -> Closest frequency to 3 MHz but not over bit time t bit = 1/2.5 MHz = 0.4 us t instr = 4 cycles * (1/40 MHz) = 0.1 us #bytes = = 35 bytes (cmd,addr,data) = 35 bytes * 8 bit/byte = 280 bits t page write = (35 bytes * 20 instr/byte * t instr ) + (280 bits * t bit ) = (35 * 20 * 0.1us) + (280*0.4 us) = 182 us #27/62
28 Inter IC bus, aka I2C aka I 2 C (or two-wire)
29 Inter Integrated Circuit (I2C) bus Developed by Philips Semiconductor in the early 1980s Widely used in industry Term bus differs from the its usage with SPI In SPI, bus denotes only a group of wires the most basic definition of a bus With I2C, bus refers to a shared bus topology One master and multiple slaves Slaves decode the address on the bus to see if they are being accessed Only one slave responds #29/62
30 Addressing in bus Transmitter (master) first addresses one of the receivers (slaves) All slaves monitor the bus traffic to see if there is a new address Many buses allow broadcast operation where the same data go to all reveivers #30/62
31 I2C signals Two-level addressing: 1. select the device 2. select the location/register inside the device Device address is always the first byte Actually, the first 7 bits (max 128 devices on same bus) The 8th bit denotes the direction read/write Typically, address can be selected with HW (soldering resistors, or connecting pins etc.) Only 7 bits for addresses can cause trouble, especially since some devices actually allow less possible different addresses (e.g. 3bits or 8 different addresses, even devices with one possible address do exist..) Usage of address removes the separate slave select signals Number of wires does not depend on #slaves! Great. As long as slaves have unique addresses, otherwise parallel buses required #31/62
32 I2C signals (2) Just two wires, both with open-drain (i.e. open collector) drivers 1. clock SCL 2. data SDA Bidirectional, multimaster operation possible Half-duplex communication Example I 2 C devices and addressing #32/62
33 I2C timing: start When both SDA and SCL are high, bus is idle SDA s hi-to-low transition is the start condition Multiple bytes can be sent in one transaction Each byte is sent MSb first Address + R/W bit is the first byte #33/62
34 I2C timing: acknowledge The 9th bit is always a mandatory acknowledge bit Transmitter does not drive the bus Receiver tells the success of byte transfer 0 = ok = acknowledge = ACK 1 = not ok = negative ack = NACK If receiver does not respond, pull-up R gives automatic NACK Note that in read operation, the master gives ACK/NACK #34/62
35 I2C timing: data + stop SDA is allowed to change only when SCL==0 Preferably, equally far away from either SCL edge After ack bit, the slave can hold SCL line low Master has to wait unitl SCL is released This allows flow control Stop condition is SDA lo-to-hi and SCL=1 #35/62
36 Controlling I2C in PIC SFR SSPCON provides control and status bits for the I2C, e.g. enable, master/slave, send start/stop, send ack/nack received ack/nack SSPSTAT shows if tx is in progress or if rx buffer is full SSPIF (=PIR[3]) denotes that transfer of byte + ack completed (interrupt flag) SFR TRISC allows settings the IO pins to open-drain RC3/SCK/SCL RC3/SDI/SDA #36/62
37 Possible actions in I2C master mode Perform start Perform repeated start aborts currents tx Perform stop Perform ACK/NACK Transmit data Receive data #37/62
38 C code examples for I2C This shows the fucntion that was last called. If watchdog expires, we know post-mortem in which function that happened. This is a persistent variable - it is not overwritten by init function. Watchdog expires if do-while seems to take forever #38/62 Master mode: R/W# = low -> Transmit is not in progress SEN = low -> Start condition Idle RSEN = low -> Repeated Start condition Idle PEN = low -> Stop condition Idle RCEN = low -> Receive Idle ACKEN = low -> Acknowledge sequence Idle
39 C code examples for I2C (2) MSSP HW will clear SEN when start condition has been completed #39/62
40 C code examples for I2C (3) #40/62 In real code, always use braces with ifelse!
41 I2C transaction examples i.e. WR op SDA i.e. RD op SDA #41/62
42 Example usage of I2C 24LC515 is 512 Kbit serial EEPROM internally 64K x 8 bits hence 16-bit addresses 0x0 0xffff 16-bit address space split into two 32K blocks Address bits A0 and A1 allow 4 memory banks to exist in the same I2C bus #42/62
43 I2C address of EEPROM Upper addr bits are fixed B selects the upper/lower block A1 and A0 select one out of 4 EEPROMs LSb select Rd/Wr Once the EEPROM bank is selected like this, PIC provides the memory address #43/62
44 I2C EEPROM operations Write 1 byte I2C address selects the device, hi/lo block inside that, and the R/W bit 2 bytes provide the 15-bit memory address 1-64 bytes of data can be written in one transaction (wrapping occurs when crossing 64- byte boundary) #44/62
45 I2C EEPROM operations (2) Worst-case completion of write is 5 ms End-of-write condition can be polled by sending new write command More efficient than always waiting 5ms NACK means that there is a write in progress New operation cannot be started Once ACK is returned, the previous operations has completed #45/62
46 I2C EEPROM operations (3) Sequential read returns the contents of multiple consecutive memory locations Address given only once May read upto 32Kbytes PIC ends the operation with NACK #46/62
47 I2C arbitration Previous examples assumed that PIC is the only master However, I2C supports multi-master operation Note that only one master owns the bus at a time Arbitration decides which is the current master Many policies in buses: fixed priority, rotating priority (round-robin), TDMA, lottery, combination, collision detection #47/62
48 Bus arbitration
49 Basic arbitration schemes Centralized All master request the bus from a centralized arbiter Arbiter grants one Num of req/grant lines increases with system size Distributed No centralized arbiter or point-to-point signals a) TDM time division multiplexing b) Collision detection #49/62
50 Arbitration with collision detection Distributed arbitration is favored due to fewer signals Better scalability, easier layout TDM requires synchronization, all master must be aware of correct time when to send Collision detection is used in I2C, CAN and Ethernet 1. Master waits that bus is idle 2. It starts sending 3. It monitors if incoming data is the same as it sent itself a) If it is, continue b) If not, back-off and retry a bit later #50/62
51 Arbitration with collision detection When collision occurs, master waits random time berore retrying If another collision occurs, wait time is increseased Collisions cause unnecessary waits and hence lower the performance However, in I2C open-drain IO allows one master to continue despite the collision Bit 0 overrides the weak pull-up It does not notice any problem, no performance loss there #51/62
52 CAN
53 Controller area network (CAN) Half-duplex, multi-master, serial two-wire bus Arbitration is priorized, a message with a lower ID (more zeroes) will get the bus in a competitive situation lower ID (MSb first) will draw line down and wins (higher ID sender realizes that it cannot draw line up) Used for example in cars or in home-automation Distances of few meters, lots of noise, reliability requirements, 10 Kb/s 1Mb/s data rates Differential signaling Better noise immunity, especially for common-mode noise Each transaction starts with 11-bit identifier Must be unique, lower ID means higher priority Any node can initiate transfers Arbitration with collision detection similarly to I2C All can receive and they filter the incoming data according to identifier Devices must agree on baud rate #53/62
54 CAN (2) External transceiver used with PIC Differential signaling requires no common ground potential If fig, noise Vn sums to both lines but does not affect the voltage difference! All bits are clean #54/62
55 CAN (3) All data frames have error detection code with CRC (cyclic redundancy check) Bit stuffing ensures a signal edge at least once in 6 cycles Allows the PLL to generate reference clock at the receivers side #55/62 After 5 cycles with same signal level, additional stuff bit forces edge Removed by rx (it counts..) RX sees 5 ones and then expects 0, if after 0 is 1 == 6 ones, if after 0 is 0 == 5 ones, two zeroes
56 USB
57 Universal Serial Bus (USB) High-speed serial protocol 1.5 Mb/s,12 Mb/s, 480 Mb/s Replacing RS-232 in PCs Single master host- usually PC Multiple functions, such keyboards, mice, printers, speakers... Hubs grow the physical topology but logically it is a star #57/62
58 USB (2) Differential data signaling (two wires) and Vdd and ground Functions may be powered via USB, no need for external power source Hot swap - devices can added and removed while USB is operational Host provides address (bus enumeration) for each function D+ D- D- D+ Votlage levels for full- and low-bandwidth modes #58/62
59 USB (3) Each packet starts with a synchronization sequence High density of signal transitions to synchronize the receiver, b (or as NRZI line goes ) Data sent using Non Return to Zero Invert (NRZI) data encoding with bit stuffing Bit unfortunate name... (not inverse of NRZ encoding!) Changes signal level when 0 is transmitted whereas 1 keeps the level Maximum of 6 consecutive 1 #59/62 Each transmitted 0 bit causes level change
60 USB (4) Packet-based communication token, handshake, data packets packets protected with CRC Four transaction types bulk, control, interrupt, isochronouss Quite complicated protocol compared to SPI or I2C Thus, not very common in small MCUs, typically external UART-to-USB chips are used #60/62
61 Conclusions Synchronous serial protocols are more common than acynchronous Multi-master buses need arbitration Address decoding at slaves keeps the number of wires fixed Be careful which is transmitted first: MSb or LSb when data is allowed to change whether pos or neg- clk edge is used for sampling with signals voltage levels with multiple drivers for the same signal #61/62
62 General-purpose IO
63 General-purpose IO The simplest type of I/O via the PIC µc external pins are parallel I/O (PIO) ports PIC can have multiple PIO ports named PORTA, PORTB, PORTC etc. generically referred to as PORTx. number of PIO pins depends on the particular PIC µc and package Each pin on these ports can either be an input or output direction is controlled by the corresponding bit in the TRISx registers ( 1 = input, 0 = output). The LATx register holds the last value written to PORTx #63/62
64 IO port structure Accessed via microcontroller s internal data bus Three-state buffers allows bi-directional operation Controlled with TRISx reg Written output data is latched Read operation returns either a) latched value (reading LATx) b) value fo the IO pin (reading PORTx) #64/62
65 #65/62!= )
66 #66/62 While (_RB3);
67 #67/62
68 #68/62
69 #69/62
70 #70/62
71 External memory interface GPIO could be used for interfacing external memories Addr, data and ctrl signals are written separately to corresponding LATx reg Very slow #71/62
72 External memory interface (2) Some PIC devices support external memories directly Ports D, E, H form 20-bit multiplexed address/data bus Port J implements control signals Enabled and controlled with SFR MEMCON Supports both 8-bit and 16-bit data #72/62
or between microcontrollers)
: Communication Interfaces in Embedded Systems (e.g., to interface with sensors and actuators or between microcontrollers) Spring 2016 : Communication Interfaces in Embedded Systems Spring (e.g., 2016
More information11.4 THE SERIAL PERIPHERAL INTERFACE (SPI)
Synchronous Serial IO 331 TRISC6 TRISC[6] Must be 0 so that RC6/TX/CK pin is an output. TRISC7 TRISC[7] Must be 1 so that RC7/RX/DT pin is an input. 11.4 THE SERIAL PERIPHERAL INTERFACE (SPI) The Serial
More informationDesign and development of embedded systems for the Internet of Things (IoT) Fabio Angeletti Fabrizio Gattuso
Design and development of embedded systems for the Internet of Things (IoT) Fabio Angeletti Fabrizio Gattuso Microcontroller It is essentially a small computer on a chip Like any computer, it has memory,
More informationPIC16C7X 11.0 SYNCHRONOUS SERIAL PORT (SSP) MODULE SSP Module Overview. Applicable Devices
Applicable Devices PIC16C7X 11.0 SYNCHRONOUS SERIAL PORT (SSP) MODULE 11.1 SSP Module Overview The Synchronous Serial Port (SSP) module is a serial interface useful for communicating with other peripheral
More informationSection 16. Basic Sychronous Serial Port (BSSP)
M 16 Section 16. Basic Sychronous Serial Port (BSSP) BSSP HIGHLIGHTS This section of the manual contains the following major topics: 16.1 Introduction...16-2 16.2 Control Registers...16-3 16.3 SPI Mode...16-6
More informationIntroduction to I2C & SPI. Chapter 22
Introduction to I2C & SPI Chapter 22 Issues with Asynch. Communication Protocols Asynchronous Communications Devices must agree ahead of time on a data rate The two devices must also have clocks that are
More informationTKT-3500 Microcontroller systems
TKT-3500 Microcontroller systems Lec 3a Serial Input/output Ville Kaseva Department of Computer Systems Tampere University of Technology Fall 2010 Sources Original slides by Erno Salminen Robert Reese,
More informationPart 1 Using Serial EEPROMs
Part 1 Using Serial EEPROMs copyright 1997, 1999 by Jan Axelson If you have a project that needs a modest amount of nonvolatile, read/write memory, serial EEPROM may be the answer. These tiny and inexpensive
More informationUniversität Dortmund. IO and Peripheral Interfaces
IO and Peripheral Interfaces Microcontroller System Architecture Each MCU (micro-controller unit) is characterized by: Microprocessor 8,16,32 bit architecture Usually simple in-order microarchitecture,
More informationSerial Communication. Spring, 2018 Prof. Jungkeun Park
Serial Communication Spring, 2018 Prof. Jungkeun Park Serial Communication Serial communication Transfer of data over a single wire for each direction (send / receive) Process of sending data one bit at
More informationParallel Data Transfer. Suppose you need to transfer data from one HCS12 to another. How can you do this?
Introduction the Serial Communications Huang Sections 9.2, 10.2, 11.2 SCI Block User Guide SPI Block User Guide IIC Block User Guide o Parallel vs Serial Communication o Synchronous and Asynchronous Serial
More informationRaspberry Pi - I/O Interfaces
ECE 1160/2160 Embedded Systems Design Raspberry Pi - I/O Interfaces Wei Gao ECE 1160/2160 Embedded Systems Design 1 I/O Interfaces Parallel I/O and Serial I/O Parallel I/O: multiple input/output simultaneously
More informationLecture 25 March 23, 2012 Introduction to Serial Communications
Lecture 25 March 23, 2012 Introduction to Serial Communications Parallel Communications Parallel Communications with Handshaking Serial Communications Asynchronous Serial (e.g., SCI, RS-232) Synchronous
More informationMIKROPROCESORY PRO VÝKONOVÉ SYSTÉMY. Serial Data Transmission (Stručný přehled) České vysoké učení technické Fakulta elektrotechnická
MIKROPROCESORY PRO VÝKONOVÉ SYSTÉMY Serial Data Transmission (Stručný přehled) České vysoké učení technické Fakulta elektrotechnická Ver.1.10 J. Zděnek, 2017 Serial data transfer - principle Serial data
More informationSerial Peripheral Interface. What is it? Basic SPI. Capabilities. Protocol. Pros and Cons. Uses
Serial Peripheral Interface What is it? Basic SPI Capabilities Protocol Serial Peripheral Interface http://upload.wikimedia.org/wikipedia/commons/thumb/e/ed/ SPI_single_slave.svg/350px-SPI_single_slave.svg.png
More informationIntroduction the Serial Communications Parallel Communications Parallel Communications with Handshaking Serial Communications
Introduction the Serial Communications Parallel Communications Parallel Communications with Handshaking Serial Communications o Asynchronous Serial (SCI, RS-232) o Synchronous Serial (SPI, IIC) The MC9S12
More informationInterfacing Techniques in Embedded Systems
Interfacing Techniques in Embedded Systems Hassan M. Bayram Training & Development Department training@uruktech.com www.uruktech.com Introduction Serial and Parallel Communication Serial Vs. Parallel Asynchronous
More information< W3150A+ / W5100 Application Note for SPI >
< W3150A+ / W5100 Application Note for SPI > Introduction This application note describes how to set up the SPI in W3150A+ or W5100. Both the W3150A+ and W5100 have same architecture. W5100 is operated
More informationCprE 488 Embedded Systems Design. Lecture 4 Interfacing Technologies
CprE 488 Embedded Systems Design Lecture 4 Interfacing Technologies Joseph Zambreno Electrical and Computer Engineering Iowa State University www.ece.iastate.edu/~zambreno rcl.ece.iastate.edu Never trust
More informationSerial Communication. Simplex Half-Duplex Duplex
1.5. I/O 135 Serial Communication Simplex Half-Duplex Duplex 136 Serial Communication Master-Slave Master Master-Multi-Slave Master Slave Slave Slave (Multi-)Master Multi-Slave Master Slave Slave Slave
More informationEmbedded Systems and Software. Serial Interconnect Buses I 2 C (SMB) and SPI
Embedded Systems and Software Serial Interconnect Buses I 2 C (SMB) and SPI I2C, SPI, etc. Slide 1 Provide low-cost i.e., low wire/pin count connection between IC devices There are many of serial bus standards
More informationSerial Buses in Industrial and Automotive Applications
Serial Buses in Industrial and Automotive Applications Presented by Neelima Chaurasia Class: #368 1 Overview As consumer electronics, computer peripherals, vehicles and industrial applications add embedded
More informationI2C a learn.sparkfun.com tutorial
I2C a learn.sparkfun.com tutorial Available online at: http://sfe.io/t82 Contents Introduction Why Use I2C? I2C at the Hardware Level Protocol Resources and Going Further Introduction In this tutorial,
More informationHello, and welcome to this presentation of the STM32 Universal Synchronous/Asynchronous Receiver/Transmitter Interface. It covers the main features
Hello, and welcome to this presentation of the STM32 Universal Synchronous/Asynchronous Receiver/Transmitter Interface. It covers the main features of this USART interface, which is widely used for serial
More informationINTERFACING THE ISCC TO THE AND 8086
APPLICATION NOTE INTERFACING THE ISCC TO THE 68 AND 886 INTRODUCTION The ISCC uses its flexible bus to interface with a variety of microprocessors and microcontrollers; included are the 68 and 886. The
More informationPIC Serial Peripheral Interface (SPI) to Digital Pot
Name Lab Section PIC Serial Peripheral Interface (SPI) to Digital Pot Lab 7 Introduction: SPI is a popular synchronous serial communication protocol that allows ICs to communicate over short distances
More informationGrowing Together Globally Serial Communication Design In Embedded System
Growing Together Globally Serial Communication Design In Embedded System Contents Serial communication introduction......... 01 The advantages of serial design......... 02 RS232 interface......... 04 RS422
More informationInfineon C167CR microcontroller, 256 kb external. RAM and 256 kb external (Flash) EEPROM. - Small single-board computer (SBC) with an
Microcontroller Basics MP2-1 week lecture topics 2 Microcontroller basics - Clock generation, PLL - Address space, addressing modes - Central Processing Unit (CPU) - General Purpose Input/Output (GPIO)
More informationMicrocontroller basics
FYS3240 PC-based instrumentation and microcontrollers Microcontroller basics Spring 2017 Lecture #4 Bekkeng, 30.01.2017 Lab: AVR Studio Microcontrollers can be programmed using Assembly or C language In
More informationIV B.Tech. I Sem (R13) ECE : Embedded Systems : UNIT -4 1 UNIT 4
IV B.Tech. I Sem (R13) ECE : Embedded Systems : UNIT -4 1 UNIT 4 4.1. Serial data communication basics ----------- 1 4.2. UART ------------------------------------------------ 4 4.3. Serial Peripheral
More informationDHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING. EE Microcontroller Based System Design
DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING EE6008 - Microcontroller Based System Design UNIT III PERIPHERALS AND INTERFACING PART A 1. What is an
More informationEECS 373 Design of Microprocessor-Based Systems
EECS 7 Design of Microprocessor-Based Systems Matt Smith University of Michigan Serial buses, digital design Material taken from Brehob, Dutta, Le, Ramadas, Tikhonov & Mahal 1 Timer Program //Setup Timer
More information4 Multiplexer. Y Fig Keyboard Scan Matrix
- 4 Multiplexer Microcontroller 3 Decoder X Y Fig. - Keyboard Scan Matrix 2 Prentice Hall, Inc. -2 Track Sector Head positioning Fig. -2 Hard Disk Format 2 Prentice Hall, Inc. -3 RGB electron guns R G
More informationInter-Integrated Circuit Bus IIC I2C TWI
Inter-Integrated Circuit Bus IIC TWI Bus Synchronous, multi-master, multi-slave, packet switched, single ended serial bus Developed by Philips in the early 1980 s (prior to SPI) Intended for on-board communications
More informationEECS 373 Design of Microprocessor-Based Systems
EECS 373 Design of Microprocessor-Based Systems Mark Brehob University of Michigan Timers Material taken from Dreslinski, Dutta, Le, Ramadas, Smith, Tikhonov & Mahal 1 Agenda A bit on timers Project overview
More informationMore on IO: The Universal Serial Bus (USB)
ecture 37 Computer Science 61C Spring 2017 April 21st, 2017 More on IO: The Universal Serial Bus (USB) 1 Administrivia Project 5 is: USB Programming (read from a mouse) Optional (helps you to catch up
More informationOutline GPIO SPI UART. Ref. PIC Family Reference Manual:
PIC32&I/O& E155& Outline GPIO SPI UART Ref. PIC Family Reference Manual: http://www.microchip.com/wwwproducts/devices.aspx?ddocname=en545644 2 GPIO PIC32 organizes groups of GPIOs into ports that are read
More informationFM24C Kb FRAM Serial Memory Features
Preliminary FM24C512 512Kb FRAM Serial Memory Features 512Kbit Ferroelectric Nonvolatile RAM Organized as 65,536 x 8 bits High Endurance 10 Billion (10 10 ) Read/Writes 45 year Data Retention NoDelay Writes
More informationThe D igital Digital Logic Level Chapter 3 1
The Digital Logic Level Chapter 3 1 Gates and Boolean Algebra (1) (a) A transistor inverter. (b) A NAND gate. (c) A NOR gate. 2 Gates and Boolean Algebra (2) The symbols and functional behavior for the
More informationEECS 373 Design of Microprocessor-Based Systems
EECS 373 Design of Microprocessor-Based Systems Prabal Dutta University of Michigan Lecture 10: Serial buses October 2, 2014 Some material from: Brehob, Le, Ramadas, Tikhonov & Mahal 1 Announcements Special
More informationMicrocontrollers and Interfacing
Microcontrollers and Interfacing Week 10 Serial communication with devices: Serial Peripheral Interconnect (SPI) and Inter-Integrated Circuit (I 2 C) protocols College of Information Science and Engineering
More informationSerial Communication. Simplex Half-Duplex Duplex
1.5. I/O 128 Serial Communication Simplex Half-Duplex Duplex 129 Serial Communication Master-Slave Master Master-Multi-Slave Master Slave Slave Slave (Multi-)Master Multi-Slave Master Slave Slave Slave
More informationToday. Last Time. Motivation. CAN Bus. More about CAN. What is CAN?
Embedded networks Characteristics Requirements Simple embedded LANs Bit banged SPI I2C LIN Ethernet Last Time CAN Bus Intro Low-level stuff Frame types Arbitration Filtering Higher-level protocols Today
More informationINPUT-OUTPUT ORGANIZATION
INPUT-OUTPUT ORGANIZATION Peripheral Devices: The Input / output organization of computer depends upon the size of computer and the peripherals connected to it. The I/O Subsystem of the computer, provides
More informationSerial Communications
1 Serial Interfaces 2 Embedded systems often use a serial interface to communicate with other devices. Serial Communications Serial implies that it sends or receives one bit at a time. Serial Interfaces
More informationLaboratory 5 Communication Interfaces
Laboratory 5 Communication Interfaces Embedded electronics refers to the interconnection of circuits (micro-processors or other integrated circuits) with the goal of creating a unified system. In order
More informationMicrocontroller systems Lec 2 PIC18LF8722 Microcontroller s s core
TKT-3500 Microcontroller systems Lec 2 PIC18LF8722 Microcontroller s s core Erno Salminen Copyright notice Some figures by Robert Reese, from supplementary CD of the course book from PIC18F8722 Family
More informationELE492 Embedded System Design
Overview ELE9 Embedded System Design Examples of Human I/O Interfaces Types of System Interfaces Use of standards RS Serial Communication Overview of SPI, I C, L, and CAN Class //0 Eugene Chabot Examples
More informationThe Cubesat Internal bus: The I2C
The Cubesat Internal bus: The I2C Description: The purpose of this document is to describe the internal bus on the Cubesat. The internal bus has been chosen to be the I2C bus Interconnected Integrated
More informationĐẠI HỌC QUỐC GIA TP.HỒ CHÍ MINH TRƯỜNG ĐẠI HỌC BÁCH KHOA KHOA ĐIỆN-ĐIỆN TỬ BỘ MÔN KỸ THUẬT ĐIỆN TỬ. Embedded System Design
ĐẠI HỌC QUỐC GIA TP.HỒ CHÍ MINH TRƯỜNG ĐẠI HỌC BÁCH KHOA KHOA ĐIỆN-ĐIỆN TỬ BỘ MÔN KỸ THUẬT ĐIỆN TỬ Embedded System Design Chapter 7: Peripherals for embedded systems 7.1 Digital parallel input / output
More informationIntroduction the Serial Communications Huang Sections 9.2, 10.2 SCI Block User Guide SPI Block User Guide
Introduction the Serial Communications Huang Sections 9.2,.2 SCI Block User Guide SPI Block User Guide Parallel Data Transfer Suppose you need to transfer data from one HCS2 to another. How can you do
More informationLecture 5: Computing Platforms. Asbjørn Djupdal ARM Norway, IDI NTNU 2013 TDT
1 Lecture 5: Computing Platforms Asbjørn Djupdal ARM Norway, IDI NTNU 2013 2 Lecture overview Bus based systems Timing diagrams Bus protocols Various busses Basic I/O devices RAM Custom logic FPGA Debug
More informationTutorial for I 2 C Serial Protocol
Tutorial for I 2 C Serial Protocol (original document written by Jon Valdez, Jared Becker at Texas Instruments) The I 2 C bus is a very popular and powerful bus used for communication between a master
More informationMICROPROCESSOR AND MICROCONTROLLER BASED SYSTEMS
MICROPROCESSOR AND MICROCONTROLLER BASED SYSTEMS UNIT I INTRODUCTION TO 8085 8085 Microprocessor - Architecture and its operation, Concept of instruction execution and timing diagrams, fundamentals of
More informationEE 456 Fall, Table 1 SPI bus signals. Figure 1 SPI Bus exchange of information between a master and a slave.
EE 456 Fall, 2009 Notes on SPI Bus Blandford/Mitchell The Serial Peripheral Interface (SPI) bus was created by Motorola and has become a defacto standard on many microcontrollers. This is a four wire bus
More informationMcMaster University Embedded Systems. Computer Engineering 4DS4 Lecture 6 Serial Peripherals Amin Vali Feb. 2016
McMaster University Embedded Systems Computer Engineering 4DS4 Lecture 6 Serial Peripherals Amin Vali Feb. 2016 Serial Peripherals I2C Inter-IC Bus X/Y Coord. RGB data LCD config controller LCD data controller
More informationDevelopment and research of different architectures of I 2 C bus controller. E. Vasiliev, MIET
Development and research of different architectures of I 2 C bus controller E. Vasiliev, MIET I2C and its alternatives I²C (Inter-Integrated Circuit) is a multi-master serial computer bus invented by Philips
More informationUnderstanding SPI with Precision Data Converters
Understanding SPI with Precision Data Converters By: Tony Calabria Presented by: 1 Communication Comparison SPI - Serial Peripheral Interface Bus I2C - Inter- Integrated Circuit Parallel Bus Advantages
More informationDesign with Microprocessors
Design with Microprocessors Lecture 6 Interfaces for serial communication Year 3 CS Academic year 2017/2018 1 st Semester Lecturer: Radu Dănescu Serial communication modules on AVR MCUs Serial Peripheral
More informationAmarjeet Singh. January 30, 2012
Amarjeet Singh January 30, 2012 Website updated - https://sites.google.com/a/iiitd.ac.in/emsys2012/ Lecture slides, audio from last class Assignment-2 How many of you have already finished it? Final deadline
More informationReal-Time Embedded Systems. CpE-450 Spring 06
Real-Time Embedded Systems CpE-450 Spring 06 Class 5 Bruce McNair bmcnair@stevens.edu 5-1/42 Interfacing to Embedded Systems Distance 100 m 10 m 1 m 100 cm 10 cm "Transmission line" capacitance ( C) Distance
More informationMicrocontroller interfaces
Microcontroller interfaces 1 Microcontroller interfaces Microcontroller interfaces Digital Analog Serial Parallel Binary (on/off) Voltage Current Asynchronous Synchronous 1-wire RS232/485 Ethernet 2-wire
More information1. Define Peripherals. Explain I/O Bus and Interface Modules. Peripherals: Input-output device attached to the computer are also called peripherals.
1. Define Peripherals. Explain I/O Bus and Interface Modules. Peripherals: Input-output device attached to the computer are also called peripherals. A typical communication link between the processor and
More informationSerial Communication
Serial Communication What is serial communication? Basic Serial port operation. Classification of serial communication. (UART,SPI,I2C) Serial port module in PIC16F887 IR Remote Controller Prepared By-
More informationOUTLINE. SPI Theory SPI Implementation STM32F0 SPI Resources System Overview Registers SPI Application Initialization Interface Examples
SERIAL PERIPHERAL INTERFACE (SPI) George E Hadley, Timothy Rogers, and David G Meyer 2018, Images Property of their Respective Owners OUTLINE SPI Theory SPI Implementation STM32F0 SPI Resources System
More informationECE 1160/2160 Embedded Systems Design. Midterm Review. Wei Gao. ECE 1160/2160 Embedded Systems Design
ECE 1160/2160 Embedded Systems Design Midterm Review Wei Gao ECE 1160/2160 Embedded Systems Design 1 Midterm Exam When: next Monday (10/16) 4:30-5:45pm Where: Benedum G26 15% of your final grade What about:
More informationVORAGO VA108x0 I 2 C programming application note
AN1208 VORAGO VA108x0 I 2 C programming application note MARCH 14, 2017 Version 1.1 VA10800/VA10820 Abstract There are hundreds of peripheral devices utilizing the I 2 C protocol. Most of these require
More informationEmbedded Systems: Hardware Components (part II) Todor Stefanov
Embedded Systems: Hardware Components (part II) Todor Stefanov Leiden Embedded Research Center, Leiden Institute of Advanced Computer Science Leiden University, The Netherlands Outline Generic Embedded
More informationIntroduction. Embedded system functionality aspects. Processing. Storage. Communication. Transformation of data Implemented using processors
Input/Output 1 Introduction Embedded system functionality aspects Processing Transformation of data Implemented using processors Storage Retention of data Implemented using memory Communication Transfer
More informationM68HC08 Microcontroller The MC68HC908GP32. General Description. MCU Block Diagram CPU08 1
M68HC08 Microcontroller The MC68HC908GP32 Babak Kia Adjunct Professor Boston University College of Engineering Email: bkia -at- bu.edu ENG SC757 - Advanced Microprocessor Design General Description The
More informationI2C a learn.sparkfun.com tutorial
I2C a learn.sparkfun.com tutorial Available online at: http://sfe.io/t82 Contents Introduction Why Use I2C? I2C at the Hardware Level Protocol Resources and Going Further Introduction In this tutorial,
More informationApp Note Application Note: Addressing Multiple FPAAs Using a SPI Interface
Rev: 1.0.0 Date: 23 rd Jan 2015 App Note - 310 Application Note: Addressing Multiple FPAAs Using a SPI Interface TABLE OF CONTENTS 1 PURPOSE... 2 2 THE SPI INTERFACE... 3 2.1 OVERVIEW... 3 2.2 DETAILED
More informationBasics of UART Communication
Basics of UART Communication From: Circuit Basics UART stands for Universal Asynchronous Receiver/Transmitter. It s not a communication protocol like SPI and I2C, but a physical circuit in a microcontroller,
More informationAddressing scheme to address a specific devices on a multi device bus Enable unaddressed devices to automatically ignore all frames
23. USART 23.1 Features Full-duplex operation Asynchronous or synchronous operation Synchronous clock rates up to 1/2 of the device clock frequency Asynchronous clock rates up to 1/8 of the device clock
More informationAN-895 APPLICATION NOTE
APPLICATION NOTE One Technology Way P.O. Box 9106 Norwood, MA 02062-9106, U.S.A. Tel: 781.329.4700 Fax: 781.461.3113 www.analog.com ADuC702x MicroConverter I 2 C -Compatible Interface by Michael Looney
More informationAm186ER/Am188ER AMD continues 16-bit innovation
Am186ER/Am188ER AMD continues 16-bit innovation 386-Class Performance, Enhanced System Integration, and Built-in SRAM Am186ER and Am188ER Am186 System Evolution 80C186 Based 3.37 MIP System Am186EM Based
More informationFM24CL04 4Kb FRAM Serial Memory
4Kb FRAM Serial Memory Features 4K bit Ferroelectric Nonvolatile RAM Organized as 512 x 8 bits Unlimited Read/Writes 45 Year Data Retention NoDelay Writes Advanced High-Reliability Ferroelectric Process
More informationINPUT-OUTPUT ORGANIZATION
1 INPUT-OUTPUT ORGANIZATION Peripheral Devices Input-Output Interface Asynchronous Data Transfer Modes of Transfer Priority Interrupt Direct Memory Access Input-Output Processor Serial Communication 2
More informationEET203 MICROCONTROLLER SYSTEMS DESIGN Serial Port Interfacing
EET203 MICROCONTROLLER SYSTEMS DESIGN Serial Port Interfacing Objectives Explain serial communication protocol Describe data transfer rate and bps rate Describe the main registers used by serial communication
More informationIntroduction to Microcontroller Apps for Amateur Radio Projects Using the HamStack Platform.
Introduction to Microcontroller Apps for Amateur Radio Projects Using the HamStack Platform www.sierraradio.net www.hamstack.com Topics Introduction Hardware options Software development HamStack project
More informationModule 3. Embedded Systems I/O. Version 2 EE IIT, Kharagpur 1
Module 3 Embedded Systems I/O Version 2 EE IIT, Kharagpur 1 Lesson 15 Interrupts Version 2 EE IIT, Kharagpur 2 Instructional Objectives After going through this lesson the student would learn Interrupts
More informationFPGA Implementation Of SPI To I2C Bridge
FPGA Implementation Of SPI To I2C Bridge Abhilash S.Warrier Akshay S.Belvadi Dhiraj R.Gawhane Babu Ravi Teja K Abstract Today s electronic system is not a standalone unit instead working in a group, where
More informationGT24C02. 2-Wire. 2Kb Serial EEPROM (Smart Card application)
ADVANCED GT24C02 2-Wire 2Kb Serial EEPROM (Smart Card application) www.giantec-semi.com a0 1/19 Table of Content 1 FEATURES...3 2 DESCRIPTION...4 3 PIN CONFIGURATION...5 4 PIN DESCRIPTIONS...6 5 BLOCK
More informationDigital Storage Oscilloscope
Digital Storage Oscilloscope GDS-3000 Series SERIAL DECODE MANUAL GW INSTEK PART NO. 82DS-SBD00U01 ISO-9001 CERTIFIED MANUFACTURER October 2010 This manual contains proprietary information, which is protected
More informationTB2669. I²C Slave Mode. Introduction. Author: Christopher Best, Microchip Technology Inc.
I²C Slave Mode Introduction Author: Christopher Best, Microchip Technology Inc. Inter-Integrated Circuit, more commonly referred to as I 2 C, is a synchronous, two-wire, bidirectional serial communications
More informationPARALLEL COMMUNICATIONS
Parallel Data Transfer Suppose you need to transfer data from one HCS12 to another. How can you do this? You could connect PORTA of the sending computer (set up as an output port) to PORTA of the receiving
More informationTKT-3500 Microcontroller systems
TKT-3500 Microcontroller systems Lec 2 PIC18LF8722 Microcontroller s core Teemu Laukkarinen Department of Computer Systems Tampere University of Technology Fall 2011 Copyright Tampere University of Technology
More informationMicrocontroller Systems. ELET 3232 Topic 23: The I 2 C Bus
Microcontroller Systems ELET 3232 Topic 23: The I 2 C Bus Objectives To understand the basics of the I 2 C bus To understand the format of a serial transmission between I 2 C devices To understand how
More informationSEMICON Solutions. Bus Structure. Created by: Duong Dang Date: 20 th Oct,2010
SEMICON Solutions Bus Structure Created by: Duong Dang Date: 20 th Oct,2010 Introduction Buses are the simplest and most widely used interconnection networks A number of modules is connected via a single
More informationI2C and SPI Foundation
Revision 30 September 2010 Release I2C and SPI Foundation 17 March 2018 changed ref: command f to x Introduction I2C (I squared C) and SPI (Serial peripheral Interface) are two main ways that microcontrollers
More informationSerial Communications
April 2014 7 Serial Communications Objectives - To be familiar with the USART (RS-232) protocol. - To be able to transfer data from PIC-PC, PC-PIC and PIC-PIC. - To test serial communications with virtual
More informationCPE/EE 421/521 Fall 2004 Chapter 4 The CPU Hardware Model. Dr. Rhonda Kay Gaede UAH. The CPU Hardware Model - Overview
CPE/EE 421/521 Fall 2004 Chapter 4 The 68000 CPU Hardware Model Dr. Rhonda Kay Gaede UAH Fall 2004 1 The 68000 CPU Hardware Model - Overview 68000 interface Timing diagram Minimal configuration using the
More informationThese three counters can be programmed for either binary or BCD count.
S5 KTU 1 PROGRAMMABLE TIMER 8254/8253 The Intel 8253 and 8254 are Programmable Interval Timers (PTIs) designed for microprocessors to perform timing and counting functions using three 16-bit registers.
More informationHow to Implement I 2 C Serial Communication Using Intel MCS-51 Microcontrollers
APPLICATION NOTE How to Implement I 2 C Serial Communication Using Intel MCS-51 Microcontrollers SABRINA D QUARLES APPLICATIONS ENGINEER April 1993 Order Number 272319-001 Information in this document
More information19.1. Unit 19. Serial Communications
9. Unit 9 Serial Communications 9.2 Serial Interfaces Embedded systems often use a serial interface to communicate with other devices. Serial implies that it sends or receives one bit at a time. µc Device
More informationSection 21. Inter-Integrated Circuit (I 2 C )
21 Section 21. Inter-Integrated Circuit (I 2 C ) HIGHLIGHTS Inter-Integrated Circuit (I 2 C ) This section of the manual contains the following major topics: 21.1 Overview... 21-2 21.2 I 2 C Bus Characteristics...
More informationUsing FlexIO to emulate communications and timing peripherals
NXP Semiconductors Document Number: AN12174 Application Note Rev. 0, 06/2018 Using FlexIO to emulate communications and timing peripherals 1. Introduction The FlexIO is a new on-chip peripheral available
More informationUser-configurable Resolution. 9 to 12 bits (0.5 C to C)
AT30TS75A 9- to 12-bit Selectable, ±0.5 C Accurate Digital Temperature Sensor DATASHEET See Errata in Section 12. Features Single 1.7V to 5.5V Supply Measures Temperature -55 C to +125 C Highly Accurate
More informationGT34C02. 2Kb SPD EEPROM
Advanced GT34C02 2Kb SPD EEPROM Copyright 2010 Giantec Semiconductor Inc. (Giantec). All rights reserved. Giantec reserves the right to make changes to this specification and its products at any time without
More informationExercise 2 I 2 C Management 1/7
Exercise 2 I 2 C Management I²C uses only two bidirectional open-drain lines, Serial Data Line (SDA) and Serial Clock Line (SCL), pulled up with resistors. Typical voltages used are 5 V or 3.3 V. The I²C
More information