Standard C51 - Port P1, P2.. Podstawy techniki mikroprocesorowej ETEW006 Struktura portów Szeregowa transmisja danych C154 (Intel)



Podobne dokumenty
Interfejsy szeregowe. Dariusz Chaberski

Urządzenia peryferyjne RS-232. Wykład 2

OPBOX ver USB 2.0 Mini Ultrasonic Box with Integrated Pulser and Receiver

Systemy wbudowane - wykład 8. Dla zabicia czasu Notes. I 2 C aka IIC aka TWI. Notes. Notes. Notes. Przemek Błaśkiewicz.

Komunikacja w mikrokontrolerach. Magistrala szeregowa I2C / TWI Inter-Integrated Circuit Two Wire Interface

USB - Universal Serial Bus

Strona główna > Produkty > Systemy regulacji > System regulacji EASYLAB - LABCONTROL > Program konfiguracyjny > Typ EasyConnect.

Zaliczenie Termin zaliczenia: Sala IE 415 Termin poprawkowy: > (informacja na stronie:

MIKROKONTROLERY - MAGISTRALE SZEREGOWE

Rev Źródło:

MAGISTRALE MIKROKONTROLERÓW (BSS) Zygmunt Kubiak Instytut Informatyki Politechnika Poznańska

Współpraca procesora ColdFire z urządzeniami peryferyjnymi

Zarządzanie sieciami telekomunikacyjnymi

Magistrala LIN

Wykład 3. Interfejsy CAN, USB

Architektura Systemów Komputerowych. Transmisja szeregowa danych Standardy magistral szeregowych

OSI Physical Layer. Network Fundamentals Chapter 8. Version Cisco Systems, Inc. All rights reserved. Cisco Public 1

Rev Źródło:

Załącznik nr 1 część IX - sprzęt pomiarowy. Formularz cenowy. Opis przedmiotu zamówienia. Wartość brutto. Wartość netto.

LCD (Liquid Crystal Display)

USB firmware changing guide. Zmiana oprogramowania za przy użyciu połączenia USB. Changelog / Lista Zmian

Współpraca procesora z urządzeniami peryferyjnymi

Współpraca procesora z urządzeniami peryferyjnymi

Współpraca procesora z urządzeniami peryferyjnymi

USB firmware changing guide. Zmiana oprogramowania za przy użyciu połączenia USB. Changelog / Lista Zmian

Installation of EuroCert software for qualified electronic signature

USB firmware changing guide. Zmiana oprogramowania za przy użyciu połączenia USB. Changelog / Lista Zmian

Mikroprocesory i Mikrosterowniki Magistrala szeregowa I2C / TWI Inter-Integrated Circuit Two Wire Interface

Zygmunt Kubiak Instytut Informatyki Politechnika Poznańska

TACHOGRAPH SIMULATOR DTCOSIM

Zastosowania mikrokontrolerów w przemyśle

OSI Data Link Layer. Network Fundamentals Chapter 7. Version Cisco Systems, Inc. All rights reserved. Cisco Public 1

Systemy wbudowane - wykład 7

OSI Network Layer. Network Fundamentals Chapter 5. ITE PC v4.0 Chapter Cisco Systems, Inc. All rights reserved.

Wbudowane układy komunikacyjne cz. 1 Wykład 10

Komunikacja z urzadzeniami zewnętrznymi

Debugger/programator z interfejsem JTAG oraz SWD dla mikrokontrolerów ARM zgodny z KEIL ULINK 2. Gotronik

Interfejsy szeregowe TEO 2009/2010

Techniki mikroprocesorowe i systemy wbudowane

Realizacja systemów wbudowanych (embeded systems) w strukturach PSoC (Programmable System on Chip)

Aktualizacja Oprogramowania Firmowego (Fleszowanie) Microprocessor Firmware Upgrade (Firmware downloading)

Pomoc do programu konfiguracyjnego RFID-CS27-Reader User Guide of setup software RFID-CS27-Reader

Zygmunt Kubiak Instytut Informatyki Politechnika Poznańska

PRZEDSTAWIENIE WYNIKÓW ANALIZY STRUKTURY NAGŁÓWKA RAMKI CAN POD KĄTEM WPŁYWU POSZCZEGÓLNYCH PÓL NA LICZBĘ WSTAWEK BITOWYCH

MIKROPROCESORY architektura i programowanie

IEEE Centronics

Planning and Cabling Networks

DM-ML, DM-FL. Auxiliary Equipment and Accessories. Damper Drives. Dimensions. Descritpion

Rev Źródło:

(przykład uogólniony)

MIKROKONTROLERY - MAGISTRALE SZEREGOWE

TECHNIKA MIKROPROCESOROWA

Configuring and Testing Your Network

Integracja istniejącej infrastruktury do nowego systemu konwersja protokołów

Stacja sieciowa BL compact dla CANopen 4 Analog Pt and Ni Sensor Inputs BLCCO-4M12LT-2AI-PT-2AI-PT

architektura komputerów w 1 1

Katedra Metrologii i Systemów Elektronicznych. Interfejs USB

Systemy wbudowane. Poziomy abstrakcji projektowania systemów HW/SW. Wykład 9: SystemC modelowanie na różnych poziomach abstrakcji

RS868v3 module configuration

Uniwersalny asynchroniczny. UART Universal Asynchronous Receier- Transmiter

I 2 C BUS (1) 1 L.Łukasiak: Podstawy Techniki Mikroprocesorowej (materiały pomocnicze)

Programowanie Mikrokontrolerów. Magistrala I2C (Inter-Integrated Circuit).

Tychy, plan miasta: Skala 1: (Polish Edition)

Systemy pomiarowe z interfejsem RS-232. KSP w2

Interfejsy szeregowe cz. 2

Technika Mikroprocesorowa

Stargard Szczecinski i okolice (Polish Edition)

Politechnika Białostocka Wydział Elektryczny Katedra Automatyki i Elektroniki

Programowanie Układów Logicznych kod kursu: ETD6203. Komunikacja z układami cyfrowymi W dr inż. Daniel Kopiec

DUAL SIMILARITY OF VOLTAGE TO CURRENT AND CURRENT TO VOLTAGE TRANSFER FUNCTION OF HYBRID ACTIVE TWO- PORTS WITH CONVERSION

Wykład 3. Interfejsy CAN, LIN, USB

Programowanie mikrokontrolerów. 15 stycznia 2008

DATA-S MONITORING ROZPROSZONY OŚWIETLENIA AWARYJNEGO DIVERSIFIED MONITORING OF EMERGENCY LIGHTING

Stacja sieciowa BL compact dla DeviceNet Interface for Connection of 2 BL ident Read/Write Heads (HF/UHF) BLCDN-2M12S-2RFID-S

Programowalne układy logiczne kod kursu: ETD Układy sekwencyjne W

DATA-S EASY MONITORING ROZPROSZONY OŚWIETLENIA AWARYJNEGO DIVERSIFIED MONITORING OF EMERGENCY LIGHTING

KA-LOGO!-IO-Simulator

Stacja sieciowa BL compact dla CANopen 4 Digital PNP Outputs BLCCO-4M12MT-4DO-0.5A-P

Układy transmisji przewodowej. na przykładzie USB

Problematyka sieci miejscowej LIN

OSI Network Layer. Network Fundamentals Chapter 5. Version Cisco Systems, Inc. All rights reserved. Cisco Public 1

Programowanie Mikrokontrolerów. USB Universal Serial Bus

UNIWERSALNY ELEKTRONICZNY PULPIT NASTAWCZY

Kamera internetowa TRACER Prospect Cam. Instrukcja obsługi. TRACER Prospect Cam Webcam User Manual

Wykład 4. Interfejsy USB, FireWire

Główne pytania. Sieci komputerowe Router sprzętowy WAN, LAN - CISCO Co to jest? Po co nam routing? Jak go zrealizować? Czy można lepiej?

Projektowanie i Organizacja Systemów Elektronicznych. Protokół MODBUS. Marek Niedostatkiewicz

Zestaw w IP20 dla PROFINET IO TI-BL20-E-PN-4

MDK-Plus. Licencja Node-Locked 8260 EUR 5740 EUR 3340 EUR gratis 3300 EUR 2300 EUR 1330 EUR 650 EUR 3970 EUR 2760 EUR 1600 EUR

Stacja sieciowa BL compact dla CANopen 8 Analog Current or Voltage Inputs BLCCO-8M12L-4AI-VI-4AI-VI

TECHNIKA MIKROPROCESOROWA


Owner s manual. English

Machine Learning for Data Science (CS4786) Lecture11. Random Projections & Canonical Correlation Analysis

Aby w pełni przetestować układ o trzech wejściach IN_0, IN_1 i IN_2 chcemy wygenerować wszystkie możliwe kombinacje sygnałów wejściowych.

Standardy odmiany

Akademickie Centrum Informatyki PS. Wydział Informatyki PS

OSI Transport Layer. Network Fundamentals Chapter 4. Version Cisco Systems, Inc. All rights reserved. Cisco Public 1

KOMPUTEROWE SYSTEMY POMIAROWE

Transkrypt:

Podstawy techniki mikroprocesorowej ETEW006 Struktura portów Szeregowa transmisja danych Standard C5 - Port P, P2.. Output Driver Circuit of Ports to 5 and 7 Delay = State (X2 Mode) 2 State (Standard) I pull-up P 00 I pull-up P2 I pull-up P3 0 I pull-up P2 Andrzej Stępień Katedra Metrologii Elektronicznej i Fotonicznej C54 (Intel) Low impedance: P3 ON ( 0kΩ), 3 TTL LS High impedance: P2 ON ( 00kΩ), TTL LS Three states: P, P2, P3, N OFF Standard C5 - Port P - funkcje linia danych w standardzie I2C Bus alternatywne (C552) P.7/SDA P.7/T2 P.6/SCL P.5/RT2 P.5/T2EX wejście lub bramkowanie licznika T2 (C57) linia sygnału taktującego w standardzie I2C Bus zewnętrzne zerowanie licznika T2 wejście przepisujące stan początkowy licznika T2 P.4/T2 wejście licznika T2 P.4/INT2#/CC4 zewnętrzne wejście kontrolera przerwań (numer 2) lub wyjście rejestru porównania CC4 lub wejście przepisujące stan licznika T2 do rejestru CC4... Standard C5 - Port P0 C55C 8-Bit CMOS Microcontroller User s Manual. Infineon, Nov. 2000 P.0/CT0I wejście przepisujące stan licznika T2 do rejestru CT0 P.0/INT3#/CC0 zewnętrzne wejście kontrolera przerwań (numer 3) lub wyjście rejestru porównania CC0 lub wejście przepisujące stan licznika T2 do rejestru CC0 C805F52x-53x (Silicon Laboratories - www.silabs.com) Crossbar Decoder µpsd323x digital and analog resources are available through up to 6 I/O pins Crossbar assigns the selected internal digital resources to the I/O pins Priority Crossbar Decoder assigns a priority to each I/O function Lowest Priority R pull-up = V CC - V IN I IL = 9.. 455 kω (V IN = 0,45V) (I IL = 0.. 50µA) STMicroelectronics = 60 kω.. 4,6 MΩ (V IN = 0,4V) (I IL =.. 75µA) P89C60X2/6X2 Philips Semiconductors Data Out Data In Vcc = 5V R pull-up GND Port Pin

C5 - Instrukcje Read - Modify - Write Data Write Port Read - Modify - Write D CLK Q Read Port Driver odczyt wyjścia przerzutnika sterującego portem, nie linii portu: ANL Px, arg JBC Px.y, addr ; w instrukcjach bitowych: ORL Px, arg CPL Px.y ; - odczyt całego bajtu XRL Px, arg MOV Px.y, C ; - modyfikacja wskazanego bitu DEC Px CLR Px.y ; - zapis całego bajtu DJNZ Px, addr SETB Px.y Px.y ST7 - I/O ports - registers I/O ports for all pins transfer of data through digital inputs and outputs I/O ports for specific pins: analog signal input (ADC) alternate signal input/output for the on-chip peripherals external interrupt generation each I/O pin can be programmed independently as: digital input (with or without interrupt generation) digital output each port is associated to 2 or 3 main registers: Data Register (DR=0 after Reset), PADR for port A Data Direction Register (DDR=0 after Reset), PBDDR for port B Option Register (OR=0 after Reset) (specific chip), PCOR for port C ST7 - I/O ports - alternate function ST6 - I/O Ports - Input Vcc each I/O pin may be programmed using the corresponding register bits in DDR and OR registers: bit X corresponding to pin X of the port when an on-chip peripheral is configured to use a pin, the alternate function is automatically selected - this alternate function takes priority over standard I/O programming when the signal is coming from an on-chip peripheral, the I/O pin is automatically configured in output mode (push-pull or open drain according to the peripheral) when the signal is going to an on-chip peripheral, the I/O pin has to be configured in input mode - in this case, the pin s state is also digitally readable by addressing the DR register Input Pull-up, no Interrupt Input no Pull-up, no Interrupt Input Pull-up, Interrupt Input Analog Input Output Open Drain (20mA) Output Push-pull (20mA) Data In Interrupt Data In Interrupt Vcc ST6 - I/O Ports - Output ST625C STMicroelectronics General I/O PORT CHARACTERISTICS Data Out GND Vcc Input Pull-up, no Interrupt Input no Pull-up, no Interrupt Input Pull-up, Interrupt Input Analog Input Output Open Drain (20mA) Output Push-pull (20mA) Data Out GND Typical Applications with unused I/O Pin 2

ST7 I/O ports analog input when the pin is used as an ADC input the I/O must be configured as input, floating analog multiplexer (controlled by the ADC registers) switches the analog voltage present on the selected pin to the common analog rail which is connected to the ADC input it is recommended not to change the voltage level or loading on any port pin while conversion is in progress it is recommended not to have clocking pins located close to a selected analog pin Pojęcia podstawowe ANSI (American National Standard Institution) - Amerykański Narodowy Urząd Normalizacyjny Tranceiver / Driver - nadajnik, urządzenie/układ nadający/wysyłający dane Receiver - odbiornik, urządzenie/układ odbierający dane Master - w systemach wieloprocesorowych urządzenie/układ nadrzędny, inicjalizujący i kończący transmisję Slave - w systemach wieloprocesorowych urządzenie/układ podporządkowany, obsługiwany przez urządzenie nadrzędne Data Rate. Baud Rate - szybkość transmisji, liczba bitów przesyłanych znaków w jednostce czasu (bps - baud per second) Half Duplex - czasowe rozdzielenie, naprzemienne nadawanie i odbiór; możliwość różnej szybkości pracy nadajnika i Full Duplex - równoczesne niezależne nadawanie i odbiór znaków z tą samą szybkością nadajnika i Typy transmisji Kodowanie danych ze składową stałą Unbalanced Data Transmission - szeregowa transmisja danych przy wykorzystaniu jednego przewodu dla nadajnika i dla, np. RS-232, I 2 C, CAN Balanced Data Transmission - szeregowa transmisja danych przy wykorzystaniu dwóch przewodów, przeważnie różnicowo, dla nadajnika i dla, np. RS-485, CAN, USB RS-232 - Recommended Standard 232 (rok 969) EIA/TIA-232 - Electronic Industries Association / Telecommunication Industries Association I2C Bus - Inter Integrated Circuit Bus; Philips CAN - Controller Area Network; Bosch USB - Universal Serial Bus; Intel Binary Data NRZ (Non Return to Zero) 0 0 0 0 bezpośrednia zamiana stanów logicznych na sygnały znaków (np. RS232) NRZI (Non Return to Zero Inverted) zmiana sygnału dokonywana w połowie transmitowanego znaku - stanu 0 ; brak zmiany sygnału dla stanu (np. USB) Kodowanie danych bez składowej stałej Binary Data FM (Biphase Space) 0 0 0 0 zamiana stanu logicznego na początku transmitowanego bitu: dodatkowa zmiana w połowie transmitowanego bitu dla stanu 0 Manchester (Biphase) zmiana sygnału dokonywana w połowie transmitowanego znaku (UNI/O Bus): zbocze opadające dla stanu 0 zbocze narastające dla stanu Transmisja asynchroniczna Brak linii sygnału taktującego UART (Universal Asynchronous Receiver - Transmitter) ACE (Asynchronous Communication Elements) SCI (Serial Communication Interface) uniwersalny układ do 2-przewodowej, asynchronicznej transmisji szeregowej: ramka danych: bit startu, 5-8 bitów danych, -2 bity kontrolne, -2 bity stopu dane kodowane w standardzie NRZ oddzielne linie nadajnika i transmisja full duplex 3

RS-232 TIA/EIA-232-F (/2) Jose M. Soltero, Jing Zhang, and Ernest Cox Linear Products Low-Voltage, Single-Supply 232-Standard Interface Solutions Application Report, SLLA083A - SEPTEMBER 2000 wprowadzony w 962 w celu standaryzacji szeregowej wymiany danych między: DTE (Data Terminal Equipment) - początkowo PC DCE (Data Circuit-Terminating Equipment) - początkowo modem najtańszy, niskonapięciowy, najpowszechniejszy standard szeregowej wymiany danych: myszka, ploter, drukarka, skaner, zewnętrzny modem itp. obecnie standard TIA/EIA-232-F określający relację między: szybkością transmitowanych danych czasami transmisji szybkością narostu i opadania zboczy sygnału RS-232 TIA/EIA-232-F (2/2) Transition Time [ms] TIA/EIA-232-E and -F, EIA-232-D, RS-232-C 4% Limit 30 V/µs Limit ograniczony do ms czas zmian jeśli szybkość transmitowanych danych < 40bps 4% limit czasu zmian dla szybkości 40 bps.. 200 kbps ograniczenie szybkości narostu/opadania sygnału nadajnika do 30 V/µs ograniczenie szybkości transmitowanych danych do 20 kbps (obecnie do 250 kbps) 20k 250k TIA/EIA-232-F poziomy napięć Motorola MC68HC708MP6 (/2) transmisja 8- lub 9-bitowa podział czasu trwania bitu na 6 części rozpoczęcie odbioru znaku po sprzętowym wykryciu zbocza opadającego i bitu startu eliminacja szumów i zakłóceń poprzez 3-krotne próbkowanie linii odbiorczej RT RT RT2 RT3 RT4 RT5 RT6 RT7 RT8 RT9 RT0 RT RT2 RT3 RT4 RT5 RT6 RT Clock RxD Start Bit Data Bit Motorola MC68HC708MP6 (2/2) Motorola MC68HC708MP6 Standard C5 RT Clock RxD RT RT RT2 RT3 RT4 RT5 RT6 Start Bit RT7 RT8 RT9 Data Bit stan RxD dla: RT3, RT5, RT7 weryfikacja NF (Noise Flag) RT7, RT8, RT9 bitu startu/bitu danych bitu startu/bitu danych 0 0 0 tak 0 0 0 0 0 0 tak 0 0 0 0 tak 0 0 0 nie 0 0 0 tak 0 0 0 nie 0 0 nie 0 nie 0 0 RT0 RT RT2 RT3 RT4 RT5 RT6 MC68HC708MP6 Shift Clock RxD C5 Shift Clock RxD 2 2 3 3 4 4 5 6 Start Bit 5 6 7 7 8 8 9 0 Data Bit 9 0 Start / Data Bit 2 2 3 3 4 4 5 5 6 6 4

Standard C5 Stabilność generatora taktującego RxD TxD Start LSB MSB Stop T maksymalna zmiana czasu wewnętrznego testu odebranego bitu: δt = Stabilność wewnętrznego generatora mikrokontroleraδt=2,5% jest wystarczająca dla typowych zastosowań UARTu. 2 6 N 7-8-9 dodatkowe założenia: N = 0 lub, liczba przesyłanych bitów znaków taka sama tolerancja częstotliwości f OSC nadajnika i dodatkowe opóźnienia w wewnętrznej strukturze stany nieustalone w liniach transmisyjnych T 2 Bit K 7 8 9 δt < 3% dla 8 bitów danych (teoret. < 4,3%) δt < 2,8% dla 9 bitów danych (teoret. < 4,0%) T 6 Standard C5 Rezonator kwarcowy.059.200 MHz f OSC =.059.200 Hz, BD = 0 Baud Rate SMOD TH TH Baud Rate δbd (ideal) (real) (real) [%].200 0 232 232.200 0 208 208.200 0 2.400 0 244 244 2.400 0 232 232 2.400 0 4.800 0 250 250 4.800 0 244 244 4.800 0 9.600 0 253 253 9.600 0 250 250 9.600 0 9.200 0 254,5 254 4.400-25 255 28.800 +50 253 253 9.200 0 Standard C5 Rezonator kwarcowy 2.000.000 MHz f OSC = 2.000.000 Hz, BD = 0 Baud Rate SMOD TH TH Baud Rate δbd (ideal) (real) (real) [%].200 0 229,96 230.20,9 0,6 203,92 204.20,9 0,6 2.400 0 242,98 243 2.403,8 0,32 229,96 230 2.403,8 0,32 4.800 0 249,49 249 4.464,3 6,99 242,98 243 4.807,7 0,6 9.600 0 252,74 253 0.46,7 8,5 249,49 249 8.928,6-7,0 9.200 0 254,47 254 5.625-9 252,74 253 3.250 63 Historia 985 - Robert Bosch GmbH proponuje interfejs szeregowy w celu ujednolicenia wymiany danych w przemyśle samochodowym (lotniczym), jako odpowiedź na wymagania stawiane przez dwóch niemieckich producentów samochodów: Daimler-Benz i BMW (obecnie także: VW, Renault, PSA, Volvo, Saab i inni) podstawowe wymagania: niskie koszty linii transmisyjnych, duża szybkość przesyłanych danych, duża niezawodność i wiarygodność transmitowanych informacji, odporność na zakłócenia elektryczne, automatyczna (sprzętowa) detekcja możliwie wszystkich błędów występujących w trakcie transmisji danych protokół szeregowej wymiany danych między węzłami nadawczymi i odbiorczymi, między warstwami fizycznymi i logicznymi obecnie standard CAN 2.0A z -bitowym identyfikatorem węzłów, (praktycznie 2032 węzłów) lub CAN 2.0B z 29-bitowym identyfikatorem węzłów Cechy identyfikator węzła nie jest jego adresem ten sam węzeł może mieć wiele różnych identyfikatorów w zależności od pełnionej funkcji elastyczność systemu - dołączanie kolejnych węzłów bez konieczności zmian sprzętowych i programowych konfiguracja sieci typu Multi-Master, zorientowana obiektowo niezawodność magistrali - detekcja i sygnalizacja przez każdy węzeł błędów transmisji: wszystkich błędów globalnych, wszystkich błędów lokalnych nadajników, do 5 przypadkowych błędów w ramce, do 5 błędów w ramce powodujących zmianę długości poszczególnych części ramki, dowolnego błędu nieparzystości w ramce, grupowanie danych w ramki, od 0 do 8 bajtów w ramce, prawdopodobieństwo niewykrycia błędu w ramce mniejsze niż: stopa_błędów 4,7 0 - Transmisja ramek automatyczna detekcja błędów transmisji: grupowanie danych w ramki (Frame), kontrola nadawanych danych i stanu magistrali, cykliczna kontrola nadmiarowa (CRC), bity separacji i potwierdzenia (), dodatkowe bity synchronizacji (Stuff bits), 2-przewodowa-różnicowa lub -przewodowa magistrala, prowadzona za pośrednictwem kabla koncentrycznego, skrętki lub światłowodu, szybkość transmisji danych od 5 Kbitów/s.. do Mbita/s (40 m), maksymalna odległość węzłów ograniczona do 0 km (5 Kbitów/s). 5

Ramka 2.0B Extended Format Arbitraż S bitowy S I O identyfikator R D F ID R E ID28.. ID8 R r T R Bity kontrolne DLC 4 bity Dane Bajty danych 0.. 8 Suma Koniec kontrolna Potw. ramki 5 - bitów CRC Przerwa Oczekiwanie Arbitration Field Control Field Data Field CRC Field EOF I T Bus Idle 8 bitowy identyfikator ID ID7.. ID0 r 0 7 bitów min 3 bity Kodowanie ze względu na brak sygnału zegarowego w magistrali i problemy synchronizacji układów peryferyjnych (np. SLIO/CAN P82C50 - Philips) ma wewnętrzny generator synchronizowany stanem magistrali, wprowadzono kodowanie bitów metodą dostawiania bitu (Bit Stuffing): po 5 bitach aktywnych (dominant) wstawiany jest bit pasywny (recessive), po 5 bitach pasywny (recessive) wstawiany jest bit aktywnych (dominant) wejściowy strumień danych 2 3 4 5 6 7 8 9 0 2 3 4 5 6 SOF - Start Of Header ID - IDentifier RTR -Remote Transmit Request SRR - Substitute Remote Request IDE - IDentifier Extension bit r, r0 - reserved bits DLC - Data Length Code CRC - Cyclic Redundancy Code - nowledge EOF - End Of Frame INT - INTerframe space strumień bitów wyjściowy strumień danych 2 3 4 5 6 7 8 9 0 2 3 4 5 6 2 3 4 5 6 7 8 9 0 Stuff Bit 2 3 4 5 6 magistrala CA Sygnały napięciowe (tryb szybki) Standardy 20 Ω Węzeł Węzeł 30 Magistrala CA CA _H CA _L 5V 3,5V 2,5V,5V 0V apięcie stan pasywny (recessive) 20 Ω CA _H CA _L stan aktywny (dominant) stan pasywny (recessive) t CANaerospace CANary CANopen CAN Kingdom DeviceNet NMEA2000 PeliCAN SAE J939 www.mstock.com (Michael Stock Flight Systems) www.atmel.com www. can-cia.de www.cankingdom.org www.odva.org communication protocol based upon the J939 Controller Area Network standard from the National Marine Electronics Association (NMEA) to interconnect various electronic units onboard ships and smaller recreational and commercial vessels. www.semiconductors.philips.com www.sae.org (The Society of Automotive Engineers) Wybrane aplikacje Sterowanie transportera opancerzonego Rosomak CANaerospace (CAN-based avionics system network): the -Mbit/s CAN bus is used as a backbone network for flight state sensors, navigation systems and several research PCs driving high resolution flat panel displays installed in the cockpit. They will be running the SuSE 8.0 Linux operating system and use nvidia graphics accelerators. The automotive industry uses CAN as the in-vehicle network (IVN) for the engine management (CAN high-speed networks (e.g. 500 kbit/s), the body electronics like door and roof control, air conditioning, and lightning, as well as for the entertainment control (lower data-rates, e.g. 25 kbit/s). Lifts and escalators have always used embedded CAN networks - all applicable devices in a lift, such as panels, controller, doors, drives, light barriers, etc. are linked to each other and controlled via CAN. CAN is used as embedded network in medial devices such as in X-ray machines. Complete operating rooms are equipped with a CAN network that manages all functions. CAN is also used as embedded network in patient beds. In addition, complete hospital control systems with voltage control, indication and control units, multi cube power meters and digital I/O, and visualization software are networked via CAN Data Flow Types The USB supports functional data and control exchange between the USB host and a USB device as a set of either uni-directional or bidirectional pipes. USB data transfers take place between host software and a particular endpoint on a USB device. Such associations between the host software and a USB device endpoint are called pipes. In general, data movement though one pipe is independent from the data flow in any other pipe. A given USB device may have many pipes. As an example, a given USB device could have an endpoint that supports a pipe for transporting data to the USB device and another endpoint that supports a pipe for transporting data from the USB device. 6

Data Flow Types - basic types of data transfers Data Speed - Lines (D+ and D-) Control Transfers: Used to configure a device at attach time and can be used for other device-specific purposes, including control of other pipes on the device. Bulk Data Transfers: Generated or consumed in relatively large and bursty quantities and have wide dynamic latitude in transmission constraints. Interrupt Data Transfers: Used for characters or coordinates with human-perceptible echo or feedback response characteristics. Isochronous Data Transfers: Occupy a prenegotiated amount of USB bandwidth with a prenegotiated delivery latency. (Also called streaming real time transfers). A pipe supports only one of the types of transfers described above for any given device configuration. Low Speed:,5 Mbit/s ±.5% (5,000ppm) Full Speed: 2 Mbit/s ±0.25% (2,500ppm) / host ±0.05% (500ppm) High Speed: 480 Mbit/s ±0.05% (500 ppm) USB Cable Example Full-speed CMOS Driver Circuit Device Speed Identification Data Encoding/Decoding Low-speed The USB employs NRZI data encoding when transmitting packets. In NRZI encoding, a is represented by no change in level and a 0 is represented by a change in level. Full-speed The high-speed device leaves the D+ pull-up resistor connected, leaves the high-speed terminations disabled, and drives the highspeed signaling current into the D- line. The high level represents the J state on the data lines in this and subsequent figures showing NRZI encoding. A string of zeros causes the NRZI data to toggle each bit time. DATA NRZI Idle Idle 0 0 0 0 0 0 J K Bit Stuffing / Synchronization (SYNC) Bit stuffing is enabled beginning with the Sync Pattern (0x80) and throughout the entire transmission. The data one that ends the Sync Pattern is counted as the first one in a sequence. Bit stuffing by the transmitter is always enforced, without exception. LSB First Sync Pattern (Synchronization) Packed Data Packet Formats Sync PID Addr ENDP CRC5 EOP Idle Token Packet 8 bits 8 bits 7 bits 4 bits 5 bits 2 T PERIOD Sync PID Frame# CRC5 EOP Idle SOF Packet 8 bits 8 bits bits 5 bits 2 T PERIOD DATA Bit Stuffed DATA NRZI Idle 0 0 0 0 0 0 0 0 6 x HIGH Stuffed Bit Sync PID Data CRC6 EOP Idle Data Packet 8 bits 8 bits 0..023 6 bits 2 T PERIOD bytes Sync PID EOP Idle Handshake Packet PID Packet Format Sync Pattern PID 0 PID PID 2 PID 3 PID 0 PID PID 2 PID 3 0 0 0 0 0 0 0 7

Pocket Type PID Packet Formats PID Name PID 0 PID PID 2 PID 3 PID 0 PID PID 2 PID 3 Token OUT 0 0 0 Token IN 0 0 SOF SOF 0 0 SOF marker, frame number Token SETUP 0 Data Data0 0 0 Data packet PID even Data 0 Data packet PID odd Handshake 0 0 0 Error-free data packet NAK 0 0 Device cannot accept or send data STALL 0 Endpoint halted Special PRE 0 0 Enables low-speed What is USB Enumeration? Enumeration is the process by which a USB device is attached to a system and is assigned a specific numerical address that will be used to access that particular device. It is also the time at which the USB host controller queries the device in order to decide what type of device it is in order to attempt to assign an appropriate driver for it. Some of the basic commands issued by the host to the device are: Get Device Descriptor Overall information about the device (manufacture, firmware version ) Set Address Instructs the device change it s current address settings Get Configuration Descriptor How the endpoints will be used Get Interface Descriptor Various different interface that the device may use Get String Descriptor Unicode strings for Manufacture and Product This process is a fundamental step for every USB device, fore without it, the device would never be able to be used by the OS. Standard Device Descriptor The device descriptor is sent by the device when the Host sends a GET_DESCRIPTOR request with a DEVICE Descriptor type. struct usb_device_descriptor { Uchar blength; /* Size of this descriptor in bytes */ Uchar bdescriptortype; /* DEVICE descriptor type */ Uint6 bcdusb; /* Binay Coded Decimal Spec. release */ Uchar bdeviceclass; /* Class code assigned by the USB */ Uchar bdevicesubclass; /* Sub-class code assigned by the USB */ Uchar bdeviceprotocol; /* Protocol code assigned by the USB */ Uchar bmaxpacketsize0; /* Max packet size for EP0 (8, 6, 32, 64) */ Uint6 idvendor; /* Vendor ID */ Uint6 idproduct; /* Product ID assigned by the manufacturer */ Uint6 bcddevice; /* Device release number */ Uchar imanufacturer; /* Index of manu. string descriptor */ Uchar iproduct; /* Index of prod. string descriptor */ Uchar iserialnumber; /* Index of S.N. string descriptor */ Uchar bnumconfigurations; /* Number of possible configurations */ }; Device Descriptor - example DEVICE Descriptor: code struct usb_st_device_descriptor usb_device_descriptor = { 0x2, /* Size of this descriptor in bytes */ 0x0, /* DEVICE descriptor type */ 0x00, /* Binay Coded Decimal Spec. release */ 0x00, /* Class code assigned by the USB */ 0x00, /* Sub-class code assigned by the USB */ 0x00, /* Protocol code assigned by the USB */ 0x08, /* Max packet size for EP0 (8, 6, 32, 64) */ 0xEB03, /* Vendor ID (0x03EB - Atmel) */ 0x0320, /* Product ID assigned by the manufacturer (0x2003 - HID Keyboard) */ 0x000, /* Device release number */ 0x0, /* Index of manu. string descriptor */ 0x02, /* Index of prod. string descriptor */ 0x03, /* Index of S.N. string descriptor */ 0x0 /* Number of possible configurations */ }; USB Class Codes Base Descriptor Description Class Usage 00h Device Use class information in the Interface Descriptors 0h Interface Audio 02h Both Communications and CDC Control 03h Interface HID (Human Interface Device) 05h Interface Physical 06h Interface Image 07h Interface Printer 08h Interface Mass Storage 09h Device Hub 0Ah Interface CDC-Data 0Bh Interface Smart Card 0Dh Interface Content Security 0Eh Interface Video 0Fh Interface Personal Healthcare DCh Both Diagnostic Device E0h Interface Wireless Controller EFh Both Miscellaneous FEh Interface Application Specific FFh Both Vendor Specific M37530M4 - Mitsubishi S DATA at Serial I/O2 Output / Input Transfer Clock SIO2CON Register Transmit/Receive Shift Stop Flag: 0 - shift in progress - shift completed 0 0 0 0 Transfer Direction Selection Bit: 0 - LSB first - MSB first S DATA pin selection bit: 0 - I/O port - S DATA I/O Internal Synchronous Clock Selection Bit: 000 - f XIN /8 00 - f XIN /6 00 - f XIN /32 0 - f XIN /64 0 - f XIN /28 - f XIN /256 8

FireWire initiated by Apple, developed by the Working Group (IEEE 394) and engineers from Texas Instruments, Sony, Digital Equipment Corporation, IBM, STMicroelectronics i.link - Sony's implementation uses only the 4 signal pins (omitting the two pins which provide power to the device - separate power connector) used for connection of data storage devices and DV (digital video) cameras, but is also popular in industrial systems for machine vision and professional audio systems integrated into: Power Macs, imacs, emacs, MacBooks, MacBook Pros, ipod preferred over the more common USB for its greater effective speed (higher sustained data transfer rates) and power distribution capabilities, and because it does not need a computer host Technical specifications FireWire bus appears as a large, 64-bit memory-mapped address space with each device, represented by a node, occupying a specific address range (high-order 6 bits identify the node and the remaining 48 bits are for device-specific use) connect up to 63 peripherals in a tree topology allows peer-to-peer (P2P or PtP) device communication - such as communication between a scanner and a printer (without using system memory or the CPU) supports multiple hosts per bus bit transfer rates: S00 (00Mbit/s), S200, S400, S800 (800Mbit/s) designed to support Plug-and-play and hot swapping P2P six-wire cable, can supply up to 45 watts of power per port at up to 30 V, allowing moderate-consumption devices to operate without a separate power supply Operating System Support Data Transfer full support for IEEE 394a/b for FreeBSD, Linux, Apple Mac OS 8.6 - Mac OS 9, Mac OS X, NetBSD, OpenBSD and Haiku Microsoft Windows XP (Service Pack 2) supports FireWire S00 (00 Mbit/second) speed device download is available from Microsoft which enables devices rated at S400 or S800 speeds Microsoft Windows Vista currently supports only 394a, with 394b support coming later in a service pack some FireWire hardware manufacturers also provide custom device drivers which replace the Microsoft OHCI host adapter driver stack, enabling S800-capable devices to run at full 800 Mbit/s transfer rates. Asynchronous Transfer Mode allows for periodic data transfer with guaranteed delivery, error-checking and retransmission mechanisms to take place (for example simply copying the data from a CD-ROM to a hard drive - don t want to lose any information during the copy) Minimum data block size for an asynchronous packet: 00Mbps (52 bytes), 200Mbps (.024 bytes), 400Mbps (2.048 bytes) In Isochronous Transfer Mode best-effort delivery is used to deliver data across the bus at a constant rate, no error correction nor retransmission is available (for example stream video from a digital camera to the Internet - necessary bandwidth is known a priori and the data needs to be sent at constant intervals) Standards & Versions FireWire 400 (IEEE 394a, 2000): 6-Pin FireWire 400 data transfer: 00 (actual transfer connector rates 98.304Mbit/s), 200 (96.608), or 400 (393.26) Mbit/s 6-Pin connector - power output to support external devices: typically a device can pull about 7 to 8 watts from the port voltage is specified as unregulated and should nominally be about 25 Volts (range 24 to 30V) - Apple's implementation on laptops is typically related to battery power and can be RJ45 as low as 9V and more likely about 2V cable length is limited to 4,5 metres (4.8 ft) 9-pin FireWire 800 (IEEE 394b, 2002): connector data ransfer rate: 800 Mbit/s (actual transfer rates 786.432 Mbit/s) backwards compatibility with FireWire 400 optical connections: length up to 00 m, data rates up to 3,2 Gbit/s FireWire S800T (IEEE 394c, June 8, 2007) new port specification - RJ45 connectors with Category 5 cable no bridging between 394 and Ethernet FireWire 800 connector FireWire - Signals two twisted pairs TPA and TPB used for signaling, bidirectional and tri-state TPA+/ is used to transmit strobe signal and receive data TPB+/ is used to receive strobe signal and transmit data signaling mechanism uses data strobe encoding, a rather clever technique that allows easy extraction of a clock signal with much better jitter tolerance than a standard clock/data mechanism drivers on each port (TPA and TPB) are designed to work with an external 2-Ω termination-resistor network (this is to match the 0-Ω cable impedance one network must be provided at each end of the twisted-pair cable) 9

USB 2.0 versus FireWire High-Speed USB 2.0 runs at a higher signalling rate (480 Mbit/s) than FireWire 400 (400 Mbit/s) FireWire 800 is now substantially faster than Hi-Speed USB typical PC-hosts rarely exceed sustained transfers of 35 MB/s, with 30 MB/s being more typical (the theoretical limit for a USB 2 high-speed bulk transfer is 53.25 MB/s). This is likely due to USB's reliance on the host-processor to manage low-level USB protocol, whereas FireWire automates the same tasks in the interface hardware - for example, the FireWire host interface supports memory-mapped devices, which allows high-level protocols to run without loading the host CPU with interrupts and buffer-copy operations royalty which Apple Inc. and other patent holders have initially demanded from users of FireWire (US $ 0.25 per end-user system) and the more expensive hardware needed to implement it (US $ $ 2) has prevented FireWire from displacing USB in low-end mass-market computer peripherals, where cost of product is a major constraint FireWire in camcorders (In-Stat): 85% (2005), 77% (2006) USB SPI or Microwire SPI (Serial Peripheral Interface Bus or SPI bus) developed by Motorola Microwire developed by National Semiconductor Synchronous interfaces are characterized by the presence of a dedicated receive/transmit clock signal A "Master" device usually outputs a clock signal that is received by all "Slave" devices to receive and transmit data in synch The advantage: Each device works with the transmit/receive clock of the master independent of any oscillator variations of each individual device; so these interfaces are very suitable for use with cheap oscillators that have large frequency variations In addition I 2 C is level sensitive - in contrast to Microwire and SPI, which are edge sensitive. SPI & Microwire Signals SPI / Microwire - signal SPI: MISO - Master Input Slave Output MOSI - Master Output Slave Input SCK - Serial CloCK /SS - Slave Select A Microwire multiple slave configuration looks similar, with the difference that the master's SO pin is connected to the slaves' SI pins and the slaves' SO pins are connected to the master's SI pin: SPI Signals Microwire Signals MISO SI MOSI SO MISO SO MOSI SI SCLK Serial Shift Clock MOSI Master Out Slave In MISO Master In Slave Out /SS Slave Select SK Serial Shift Clock SO Serial Out (both master & slave) SI Serial In (both master & slave) /CS Chip Select SCK SK SCK SK /SS or /CS GND Microwire: SI Serial In (both master & slave) SO Serial Out (both master & slave) SK Serial Shift Clock /CS Chip Select UM0204. I2C-bus specification and user manual. NXP Rev. 03 9 June 2007 Właściwości (/2) dołączanie lub odłączanie układów bez zmiany konfiguracji magistrali 2-przewodowa, 2-kierunkowa magistrala: SDA (Serial DAta) - linia danych SCL (Serial CLock) - linia zegara (taktująca) obie linie magistrali typu: Open-Drain lub Open-Collector każdy układ ma własny, indywidualny adres: 7 bitowy w trybie standardowym (Standard Mode) 0 bitowy w trybie szybkim (Fast Mode) brak zewnętrznych układów dekodujących adresy urządzeń szeregowa, 8-bitowa, 2-kierunkowa wymiana danych wbudowane protokoły wymiany danych i testowania stanu magistrali ograniczenie szybkości transmisji danych: 00 kbit/s (Standard ) 400 kbit/s (Fast) 3,4 Mbit/s (High-Speed, Hs) Właściwości (2/2) każdy układ może pełnić rolę nadajnika danych (Transmitter) lub danych (Receiver), wyjątkiem są sterowniki wyświetlaczy, które mogą być jedynie mi każdy układ może być układem zarządzającym (Master) lub podporządkowanym (Slave) układem nadrzędnym (Master) jest układ inicjalizujący transmisję, pozostałe układy stają się automatycznie podporządkowanymi (Slave) magistralą może zarządzać wiele kontrolerów (Multi-Master) wbudowane procedury arbitrażu w przypadku dostępu do magistrali więcej niż jednego układu zarządzającego (połączenie typu AND na linii SCL) procedury synchronizacji sygnału taktującego (SCL) w przypadku równoczesnego dostępu do magistrali kilku układów 0

Układy we/wy Transmisja bitów - dane, Start, Stop V DD V DD SDA SDA SCL R PD R PC SCL dane stabilne zmiana danych Takt wy Takt we Dane wy Dane we Takt wy Takt we Dane wy Dane we Sekwencje: start stop SDA SCL układ układ n S Start P Koniec Start SDA dane_ Transmisja bitów ArbitraŜ dane_ dane_2 SDA SCL Start S nadajnik MSB odbiornik Adres 2-7 8 9-7 8 9 R/W do odbiornik niegotowy dane LSB Stop P arbitraż dla linii SDA w czasie SCL = HIGH SDA SCL przegrany arbitraż przez dane_ arbitraż dla kolejnych bitów adresu, bitu kierunku R/W# oraz bitów danych pozostaje nadajnik, który jako pierwszy wygenerował stan niski (LOW) na linii SDA, podczas gdy inne utrzymywały stan wysoki (HIGH) S 7-bitowy R/W# start adres 8-bitowe dane 8-bitowe dane 8-bitowe dane No P stop układ przegrywający arbitraż zwalnia linie SDA i SCL jeśli nadrzędny nadajnik (master) przegrywa arbitraż, to generuje sygnał taktujący (linia SCL) do zakończenia bieżącego bajtu arbitraż zabroniony w trakcie powtarzanej sekwencji startu i stopu 7-bitowa transmisja danych - wpis 7-bitowa transmisja danych - odczyt dane z nadrzędnego nadajnika (Master) do podporządkowanego (Slave) z podaniem wewnętrznego adresu bez zmiany kierunku transmisji danych (nadawanie) S 7-bitowy adres R/W 0 8-bitowy adres wewnętrzny generuje Slave dane z podporządkowanego (Slave) do nadrzędnego nadajnika (Master) z podaniem wewnętrznego adresu ze zmianą kierunku transmisji danych (odbiór) S 7-bitowy adres Sr R/W 0 7-bitowy adres R/W 8-bitowy adres wewnętrzny generuje Slave generuje Master 8-bitowe dane do Slave 8-bitowe dane do Slave P 8-bitowe dane do Master 8-bitowe dane do Master NO P