Dariusz Makowski Department of Microelectronics and Computer Science tel

Similar documents
Serial Communication. Simplex Half-Duplex Duplex

Universität Dortmund. IO and Peripheral Interfaces

Serial Communications

Amarjeet Singh. January 30, 2012

Serial Communication. Spring, 2018 Prof. Jungkeun Park

Serial Communication. Simplex Half-Duplex Duplex

Design and development of embedded systems for the Internet of Things (IoT) Fabio Angeletti Fabrizio Gattuso

Arduino Uno R3 INTRODUCTION

Real-Time Embedded Systems. CpE-450 Spring 06

Hierarchy of I/O Control Devices

Serial Communications

Hello, and welcome to this presentation of the STM32 Universal Synchronous/Asynchronous Receiver/Transmitter Interface. It covers the main features

EECS 373 Design of Microprocessor-Based Systems

EECS 373 Design of Microprocessor-Based Systems

EECS 373 Design of Microprocessor-Based Systems

Raspberry Pi - I/O Interfaces

More on IO: The Universal Serial Bus (USB)

Microcontroller basics

Configurable UART with FIFO ver 2.20

Growing Together Globally Serial Communication Design In Embedded System

Development and research of different architectures of I 2 C bus controller. E. Vasiliev, MIET

Serial Buses in Industrial and Automotive Applications

Introduction to I2C & SPI. Chapter 22

Hello, and welcome to this presentation of the STM32 Low Power Universal Asynchronous Receiver/Transmitter interface. It covers the main features of

18-349: Introduction to Embedded Real-Time Systems

MICROPROCESSOR BASED SYSTEM DESIGN

Dallas Semiconductor DS1307 Real Time Clock. The DS 1307 is a real-time clock with 56 bytes of NV (nonvolatile)

or between microcontrollers)

TKT-3500 Microcontroller systems

ZigBee Compliant Platform 2.4G RF Low Power Transceiver Module for IEEE Standard. DATA SHEET Version B

Lecture 25 March 23, 2012 Introduction to Serial Communications

Serial Peripheral Interface Bus SPI

Serial Communication Prof. James L. Frankel Harvard University. Version of 2:30 PM 6-Oct-2015 Copyright 2015 James L. Frankel. All rights reserved.

Informatics for industrial applications

Sender Receiver Sender

AT-501 Cortex-A5 System On Module Product Brief

ELE492 Embedded System Design

AVR XMEGA Product Line Introduction AVR XMEGA TM. Product Introduction.

Introduction the Serial Communications Parallel Communications Parallel Communications with Handshaking Serial Communications

RL78 Serial interfaces

Infineon C167CR microcontroller, 256 kb external. RAM and 256 kb external (Flash) EEPROM. - Small single-board computer (SBC) with an

Embedded Systems and Software. Serial Interconnect Buses I 2 C (SMB) and SPI

Maxim > Design Support > Technical Documents > Application Notes > Microcontrollers > APP 4465

Module Introduction. PURPOSE: The intent of this module, is to explain several of the important features of Freescale s i.mx1 applications processor.

HZX N03 Bluetooth 4.0 Low Energy Module Datasheet

Microcontrollers and Interfacing

Learn how to communicate

19.1. Unit 19. Serial Communications

ARDUINO MEGA INTRODUCTION

Serial Peripheral Interface. What is it? Basic SPI. Capabilities. Protocol. Pros and Cons. Uses

UNIT IV SERIAL COMMUNICATIONS

Embedded Systems and Software

Embedded Systems Laboratory Manual ARM 9 TDMI

McMaster University Embedded Systems. Computer Engineering 4DS4 Lecture 6 Serial Peripherals Amin Vali Feb. 2016

MIKROPROCESORY PRO VÝKONOVÉ SYSTÉMY. Serial Data Transmission (Stručný přehled) České vysoké učení technické Fakulta elektrotechnická

Product Specification

Intelop. *As new IP blocks become available, please contact the factory for the latest updated info.

USER GUIDE EDBG. Description

ET-PIC 24 WEB-V1. o Central Processing Unit (CPU) o System. o nanowatt Power Managed Modes. o Analog Features

Panel-Card. Technical Reference

Embedded Systems and Software. Serial Communication

Chapter 11: Input/Output Organisation. Lesson 05: Asynchronous RS232C Serial Port data transfer

PK2200 Series. Features. C-Programmable Controller. Specifications Board Size Enclosure Size Operating Temp.

EDBG. Description. Programmers and Debuggers USER GUIDE

Course 10: Interfaces Agenda

1 The Attractions of Soft Modems

AK-STM32-ETH Development Board

Typical modules include interfaces to ARINC-429, ARINC-561, ARINC-629 and RS-422. Each module supports up to 8 Rx or 8Tx channels.

Serial Interfaces Part 1. ECE 153B Sensor & Peripheral Interface Design Winter 2016

CM5000 DATASHEET v0.1

Network Embedded Systems Sensor Networks Fall Hardware. Marcus Chang,

UNC20 Module. User's Manual. D Breisach, Germany D Breisach, Germany Fax +49 (7667)

Digital Circuits Part 2 - Communication

Using FlexIO to emulate communications and timing peripherals

DEVBOARD3 DATASHEET. 10Mbits Ethernet & SD card Development Board PIC18F67J60 MICROCHIP

C8051F700 Serial Peripheral Interface (SPI) Overview

INTRODUCTION TO FLEXIO

Universal Asynchronous Receiver Transmitter Communication

NS9210/NS9215. Overview. Block Diagram. NS µ CMOS, 265-pin BGA. Features/Benefits. Platforms and Services.

Ali Karimpour Associate Professor Ferdowsi University of Mashhad

SCB-C08 USB to RS232/422/485 Converter

The Wireless Connectivity Expert

Lecture 13 Serial Interfaces

Microcontroller interfaces

Inter-Integrated Circuit Bus IIC I2C TWI

ECE251: Thursday November 8

The industrial technology is rapidly moving towards ARM based solutions. Keeping this in mind, we are providing a Embedded ARM Training Suite.

NS9750B-0. Use in conjunction with: Errata , Rev G. Release date: May Phone: Web:

Parallel Data Transfer. Suppose you need to transfer data from one HCS12 to another. How can you do this?

8051SERIAL PORT PROGRAMMING

10 Input and output in von Neumann s Computer selected themes

BT-22 Product Specification

Laboratory 5 Communication Interfaces

Interfacing Techniques in Embedded Systems

IV B.Tech. I Sem (R13) ECE : Embedded Systems : UNIT -4 1 UNIT 4

Configurable UART ver 2.10

Serial I/O. 4: Serial I/O. CET360 Microprocessor Engineering. J. Sumey

Serial Interfacing. Asynchronous Frame

Section 16. Basic Sychronous Serial Port (BSSP)

PRODUCT PREVIEW TNETV1050 IP PHONE PROCESSOR. description

Transcription:

Dariusz Makowski Department of Microelectronics and Computer Science tel. 631 2720 dmakow@dmcs.pl http://fiona.dmcs.pl/es 1

Lecture Agenda Microprocessor Systems, ARM Processors Family Peripheral Devices ARM Processor as Platform for Embedded Programs Methodology of Designing Interfaces in 2

Interfaces in 3

Fundamental Definitions Computer Memory Electronic or mechanic device used for storing digital data or computer programs (operating system and applications). Peripheral Device Electronic device connected to processor via system bus or computer interface. External devices are used to realise dedicated functionality of the computer system. Internal devices are mainly used by processor and operating system. Computer Bus Electrical connection or subsystem that transfers data between computer components: processors, memories and peripheral devices. System bus is composed of dozens of multiple connections (Parallel Bus) or a few single serial channels (Serial Bus). Interface Electronic or optical device that allows to connect two or more devices. Interface can be parallel or serial. 4

Connectivity of Processor and Peripheral Devices Interfaces used in : Parallel Interface PIO (usually 8, 16 or 32 bits), Serial interfaces: Universal Serial Asynchronous Receiver-Transmitter (USART), Serial Peripheral Interface (SPI), Synchronous Serial Controller (SSC) I2C, Two-wire Interface (TWI), Controlled Area Network (CAN), Universal Serial Bus (USB), Ethernet 10/100 Mbits (1 Gbit), Debug/programming interface (EIA RS232, JTAG, SPI, DBGU). 5

Interfaces available in AT91SAM9263 Parallel Interface PIO (configurable 32 bits), Serial interfaces: Debug interface (DBGU), Universal Serial Asynchronous Receiver-Transmitter (USART), Serial Peripheral Interface (SPI), Synchronous Serial Controller (SSC), I2C, Two-wire Interface (TWI), Controlled Area Network (CAN), Universal Serial Bus (USB, host, endpoint), Ethernet 10/100 Mbits, Programming interface (JTAG). 6

Universal Asynchronous Receiver/Transmitter Module 7

EIA RS232 Serial Interface 8

UART Transceiver Shift register TxD D0-D7 transmitter Clk D0-D7 Receiver RxD Clk 9

Data Frame of UART (1) Mark Space 10

Data Frame of UART (2) Send data: 0100.1011b = 0x4B 11

Synchronous vs asynchronous transmission Transmitter Receiver Data Clock Transmitter Receiver Internal clock Internal clock Similar reference frequency 12

Electrical specification of EIA RS232c 13

Null-Modem Cabel EIA 232 14

Hardware Flow Control Symbol Circuit Line state Remarks Computer ready Modem ready Request to send Ready to send Start transmission DTE Data Terminal Equipment terminal, PC DCE - Data Circuit-terminating Equipment Modem DSR - Data Set Ready - modem DTR - Data Terminal Ready terminal RTS - Request to Send Data CTS - Clear to Send - ready to send data 15

Null-Modem Cabel EIA 232 with Hardware flow Control 16

Voltage Levels of EIA RS232 Processor output EIA RS 232 17

Voltage Levels Translator MAX 232 (5 V) MAX 3232 (3,3 V) 18

Software for EIA RS232 communication Hyper terminal Minicom ssh Terminal (http://www.elester-pkp.com.pl/index.php?id=92&lang=pl&zoom=0) 19

AT91SAM9263 debug module DBGU (chapter 30) 20

Serial interface as Diagnostic Tool Features of DBGU port (DeBuG Unit): Asynchronous data transmission compatible with RS232 standard (8 bits, single parity bit can be switched off), Single system interrupt, shared with PIT, RTT, WDT,DMA, PMC, RSTC, MC, Frame correctness analysis, RxD buffer overflow signal, Diagnostic modes: external loopback, local loopback and echo, Maximum transmission baudrate 1 Mbit/s, Direct connectivity to debug module buildin ARM core (COMMRx/COMMTx). 21

Block diagram of DBGU transmission module Input-Output ports Serial Transceiver Interrupt signal 22

Transmission speed Reference clock generator is responsible for Baud Rate. Baud rate can be calculated using formula: Baud Rate = MCK / (16 x CD), where CD Clock Divisor can be found in DBGU_BRGR register 23

Transmission errors Receiver Buffer Overflow (BGU_RHR) Parity Error (PE) Frame Error (FE) 24

Configuration of DBGU transceiver static void Open_DBGU (void){ 1. Deactivate DBGU interrupts (register AT91C_BASE_DBGU->DBGU_IDR) 2. Reset and turn off receiver (register AT91C_BASE_DBGU->DBGU_CR) 3. Reset and turn off transmitter (register AT91C_BASE_DBGU->DBGU_CR) 4. Configure RxD i TxD DBGU as input peripheral ports (registers AT91C_BASE_PIOC->PIO_ASR and AT91C_BASE_PIOC->PIO_PDR) 5. Configure throughput (e.g. 115200 kbps, register AT91C_BASE_DBGU->DBGU_BRGR) 6. Configure operation mode (e.g. 8N1, register AT91C_BASE_DBGU->DBGU_MR, flags AT91C_US_CHMODE_NORMAL, AT91C_US_PAR_NONE) 7. Configure interrupts if used, e.g. Open_DBGU_INT() 8. Turn on receiver (register AT91C_BASE_DBGU->DBGU_CR), 9. Turn on transmitter if required (register AT91C_BASE_DBGU->DBGU_CR), } 25

Read and write via DBGU port Interrupts are disabled. void dbgu_print_ascii (const char *Buffer) { while ( data_are_in_buffer ) { while ( TXRDY... ){}; /* wait intil Tx buffer busy check TXRDY flag */ DBGU_THR =... /* write a single char to Transmitter Holding Register */ } } void dbgu_read_ascii (const char *Buffer, unsigned int Size){ do { While (...RXRDY... ){}; /* wait until data available */ Buffer[...] = DBGU_RHR; /* read data from Receiver Holding Register */ } while ( read_enough_data... ) } 26

AT91SAM9263 USART (rozdział 34) 27

Serial port USART Features of Universal Synch. Asynch. Receiver-Transmitter: Asynchronous or synchronous data transfer, Programmable frame length, parity, stop bits, Single system interrupt (shared with: PIT, RTT, WDT,DMA, PMC, RSTC, MC), Analysis of correctness of received frames, Buffer overflow error TxD or RxD, Elastic buffer possibility of receiving frames with different length (uses additional counter), Diagnostic modes: external loopback, local loopback and echo, Maximum transmission speed 1 Mbit/s, Hardware flow control, Support for Multidrop transmission data and address, Available Direct Memory Access channel, Support for RS485 differential transmission mode and infrared systems (build-in IrDA modulator-demodulator). 28

Block diagram of USART transceiver 29

Serial Peripheral Interface 30

Serial Peripheral Interface Features of SPI: Serial synchronous transmission, Full duplex, master-slave or master-multi-slave transfers, High data transmission speed (>12 Mbit/s), Application: External peripheral devices (ADC, DAC, RTC, EEPROM, thermometers, etc...), Auxiliary control, e.g. CCD matrix with high speed parallel interface, SPI used for configuration, Memory cards, e.g. SD/SDHC/MMC. 31

Serial Peripheral Interface Master Output Slave Input Master Input Slave Output CS Master Slave 32

SPI Protocol Clock signal configuration: Clock polarisation: Negative CPOL = 0 (low level, 8 clock signals), Positive CPOL = 1 (high level, 8 clock signals), Clock phase: Zero clock phase (data sampled on first clock slope), Delayed clock phase (data sampled on second clock slope). 33

Thermometer with SPI TMP 121: SOT 23-6 package, Maximum clock speed 15 MHz SPI-Compatible Interface Resolution: 12-Bit + Sign, 0,0625 C Accuracy: ±1.5 C for temp. 25 C - +85 C Current consumption in sleep mode: 50μA (max.) Power supply: 2,7V to 5,5V 3 mm 34

SPI Frame of TMP121 Thermometer 35

SPI Module of ARM AT91SAM9263 processor (1) Features of SPI: Support for Master or Slave mode, Receiver and transmitter buffers, Data transfers: from 8 to 16 bits, Four programmable outputs for SPI devices selection (max. 15 devices), Programmable delay between transfers, Programmable clock phase and polarity. 36

SPI Module of ARM AT91SAM9263 processor (2) 37

SPI Module of ARM AT91SAM9263 processor (3) 38

Exam Dates Exam #1 15.01.2018 8.15-12.15 Exam #2 19.01.2018 8.15-12.15 Exam #3 12.02.2018 8.15-12.15 No lecture 22.01.2018 39

I2C Bus Standard 40

I2C Bus Standard developed by Philips company on early 80s, Two wire synchronous interface (SDA data line, SCL clock line), Bidirectional master-slave (multi-master) transfers, 8-bit frames, Transmission speed: 100 kbps (standard mode), 400 kbps (fast mode), 3,4 Mbps (high-speed mode), 7-bit or 10-bits device address, Synchronisation allows to use devices with different speeds (autonegotiation), Number of devices connected to I2C bus limited by bus capacitance (C=400 pf), Arbitration used for multi-master transmission. 41

Application of I2C Bus I²C standard is applied to various digital and analogue devices: PCF8563/8583 clock, calendar, alarm, timer and NVRAM, PCF8574 8-bit IO expander, PCF8576, PCF8577 LCD controllers, PCF8582 - EEPROM memory, 256 bajts (1, 2, 4 kb,... MB), PCF8591-8-bit, 4-channels ADC/DAC converter. 42

I2C Bus Signals Master device initialize transmission, generates clock signal Slave device analyse signals on bus, read address and data 43

Transmission Start and Stop Transmission start START signal (falling slope on SDA, change from 1 to 0, during valid clock signal, SCL = 1 ). Signal generated by Master. Transmission end STOP (rising edge on SDA bus, change from 0 to 1 during valid clock signal, SCL = 1 ). Signal generated by Master. 44

I2C Protocol A) Transmission initialised by Master, START condition. B) Transmission of 8 bits (7 address bits, 1 R/W bit). C) After 8 bit (clk signals) SDA bus is controlled by Slave (9th clk). Acknowledge is generated to confirm address receive ACK = '0' or not (ACK = 1 ). E) Data read or write phase Master or Slave sends 8 data bits. F) Transmission is finished when ACK signal is generated by data receiver (Master or Slave). Master generates Stop condition. 45

I2C Read or Write Master write n-bytes of data 7-bit Master reads n-bytes of data 7-bit 46

Two-Wire Interface standard compatible with I2C? ARM processors are equipped with TWI interface compatible with developed by Philips I2C (I2C interface was patented by Philips). Features of TWI interface: Compatible with I2C, Master, Multimaster or Slave modes, IO voltage equal to 3,3 V, Maximum transmission speed: 400 khz, Transfers triggered with interrupts, Automatically Slave mode activated when collision detected on I2C bus (Arbitration-lost interrupt), Interrupt triggered when I2C slave address recognised, Automatic bus busy recognition, Support for 7 and 10-bits addresses. 47

Block diagram of TWI module 48

Real Time Clock Features of DS1629: Real Time Clock, Build-in thermometer -55 125 C, Thermometer resolution: 9 bits, Thermometer accuracy +/- 2 C, Thermostat mode, 32 bytes of SRAM, Power Supply 2,2 5,5 V, Interface compatible with I2C (400 khz). 49

Real Time Clock 50

Real Time Clock I2C Transmission 51

Serial Interfaces - comparison 100 m 10 m EIA RS232 1m I2C 10 cm SPI 1 cm 1 kbps 10 kbps 100 kbps 1 Mbps 10 Mbps 100 Mbps 52

Universal Serial Bus 53

Universal Serial Bus 54

Features of USB Asynchronous, serial, differential data transmission, Automatic recognition of connected/disconnected devices, automatic configuration, Single, standardized connector, Up to 127 devices on single bus, Automatic detection and errors correction, Transmission speed: LOW 1.5 Mb/s, specification USB >1.1, FULL 12 Mb/s, specification USB >1.1, HIGH 480 Mb/s, specification USB 2.0, Specification USB 3.0 => 5 Gb/s. 55

Data layers of USB Application Device function Data pipe USB driver Control pipe USB interface Logical device USB interface Signal wires USB is designed as a star bus. USB model is composed of three layers: Physial layer, Logical layer, Functional layer. 56

Data flow in USB Virtual channels (Pipes) Control channel (EP0) Data channels EP1 EP30 (End Points) 57

Physical Layer Differential transmission, half-duplex. Included power supply bus 5 V/500 ma Mini USB USB A and B type 58

USB Frame 59

Available Transfer Modes 60

Bulk and Interrupt Transfer 61

Isochronous Transfer 62

Control Transfer 63

Configuration Enumeration configuration of devices connected to USB bus after connection to disconnection of devices from bus. Enumeration is performed by Master node (address 0). Master assigned individual address to devices connected to USB and configures basic parameters: Device address in USB area, Transfer mode, Transfer direction (read, write, read-write), Size of data packet, Transmission speed, Allocates buffers for virtual channels, Allocated power for connected devices. 64

USB Hubs 65

USB to I2C converter 66

Universal converter RS 232, parallel, SPI, CAN to USB 67

USB and ColdFire processors Low\Full speed: MCF 527X (72-75) MCF 5221X (72-75) MCF 5222X (72-75) MCF 527X (72-73) 66 166 MHz 80 MHz 80 MHz 240 MHz 68HCS08JW32 8 MHz High Speed: MCF 547X (72-75) MCF 548X (82-85) MCF 537X (77-79) MCF 5253 200 266 MHz 166 200 MHz 240 Mhz 140 MHz 68

Motorola 68HC908JW32 Features of USB module of HC908: Interface compatible with USB 2.0 full speed, 12 Mbps data rate, Build-in 3.3 V regulator, Endpoint 0 with 8-bytes Tx/Rx buffers 64 bytes buffer for endpoints 1-4. 69

Cypress Processor with USB CY7C68013A Features of CY7C68013: Compatible with USB 2.0 USB-IF high speed, Based on 8051 core, Integrated 16 kb RAM (SRAM) Memory can be loaded from USB, Memory can be loaded from external EEPROM. Four programmable endpoints (BULK/INTERRUPT/ISOCHRONOUS) Additional 64 bytes endpoint (BULK/INTERRUPT), Parallel 8- or 16-bits external interface, DMA channel, GPIF (General Programmable Interface) 70

Cypress CY7C68013A processor 71

72

USB 3.0 Serial high speed, full-duplex interface Data transmission speed: 5 Gb/s (10 more than USB 2.0) Compatible with USB 2.0 (drivers and connector), however significantly differ from USB 2.0 Two channels for full-duplex, power supply Intelligent power supply control, lower power consumption Physical and data layers similar to PCI express 2.0 73

Physical Layer of USB 3.0 74