INFORMATICA INDUSTRIALE



Similar documents
INFORMATICA INDUSTRIALE

Parallel IO. Serial IO. Parallel vs. Serial IO. simplex vs half-duplex vs full-duplex. Wires: Full Duplex. Wires: Simplex, Half-duplex.

Using Xbee in Serial Communication

AVR317: Using the Master SPI Mode of the USART module. 8-bit Microcontrollers. Application Note. Features. Introduction

Serial Communications

Section 17. UART HIGHLIGHTS UART. This section of the manual contains the following major topics:

Objectives. Basics of Serial Communication. Simplex vs Duplex. CMPE328 Microprocessors (Spring ) Serial Interfacing. By Dr.

Elettronica dei Sistemi Digitali Costantino Giaconia SERIAL I/O COMMON PROTOCOLS

Serial Communications

CBC (EUROPE) Srl NOTA APPLICATIVA

USART and Asynchronous Communication

8051 Serial Port. Crystal TXD. I/O Device RXD. Embedded Systems Peripherals

USB TO SERIAL ADAPTER

Wireless Security Camera

RS-232 COMMUNICATIONS

TURBO PROGRAMMER USB, MMC, SIM DEVELOPMENT KIT

The I2C Bus. NXP Semiconductors: UM10204 I2C-bus specification and user manual HAW - Arduino 1

Microcomputer Protocol Implementation at Local Interconnect Network Georgi Krastev

Develop a Dallas 1-Wire Master Using the Z8F1680 Series of MCUs

What is Easy-Radio? Devices Covered. Frequency Hopping Transceiver. Where x00 denotes frequency of operation. E.g. 400 = 433MHz

Introduction the Serial Communications Huang Sections 9.2, 10.2 SCI Block User Guide SPI Block User Guide

Software User Guide UG-461

a8251 Features General Description Programmable Communications Interface

Señal RS232. d. codevilla v1.0

GMB HR84 GMM F346 TECHNICL MANUAL. grifo ITALIAN TECHNOLOGY. grifo Mini BLOCK Housing, 8 Opto Input, 4 Relay Outputs

The Secrets of RS-485 Half-duplex Communication

Wireless Home Security System

Implementing MOD bus and CAN bus Protocol Conversion Interface

Implementing SPI Master and Slave Functionality Using the Z8 Encore! F083A

Manual Serial PCI Cards

DS1621 Digital Thermometer and Thermostat

PCAN-MicroMod Universal I/O Module with CAN Interface. User Manual. Document version ( )

Microcontrollers in Practice

DS1621 Digital Thermometer and Thermostat

DS Wire Digital Thermometer and Thermostat

Tutorial for MPLAB Starter Kit for PIC18F

DECT Module UM-9802 Datasheet

ALL-USB-RS422/485. User Manual. USB to Serial Converter RS422/485. ALLNET GmbH Computersysteme Alle Rechte vorbehalten

Bluetooth to Serial Adapter

Chapter 13. PIC Family Microcontroller

ARM Thumb Microcontrollers. Application Note. Software ISO 7816 I/O Line Implementation. Features. Introduction

COMPUTER HARDWARE. Input- Output and Communication Memory Systems

International Journal of Research in Advent Technology Available Online at:

Single channel data transceiver module WIZ2-434

Bluetooth UART/RS232 Module

L16. Quectel GNSS Engine. EVB User Guide L16_EVB_UGD_V1.0

Serial port interface for microcontroller embedded into integrated power meter

DS1307ZN. 64 x 8 Serial Real-Time Clock

USER GUIDE EDBG. Description

CENTRONICS interface and Parallel Printer Port LPT

Display Message on Notice Board using GSM

Using the HT46R46 I/O Ports to Implement Half-Duplex SPI Communication

USB2.0 <=> I2C V4.4. Konverter Kabel und Box mit Galvanischetrennung

RS-232 Communications Using BobCAD-CAM. RS-232 Introduction

I2C PRESSURE MONITORING THROUGH USB PROTOCOL.

Serial Communications (Chapter 10) RS232, SPI, I2C

Application Note 83 Fundamentals of RS 232 Serial Communications

SC16IS740/750/760. Single UART with I 2 C-bus/SPI interface, 64 bytes of transmit and receive FIFOs, IrDA SIR built-in support

AND8336. Design Examples of On Board Dual Supply Voltage Logic Translators. Prepared by: Jim Lepkowski ON Semiconductor.

User Manual IC-485AI

Web Site: Forums: forums.parallax.com Sales: Technical:

2.8.3 / (Z80 Serial I/O)

RS-422/485 Multiport Serial PCI Card. RS-422/485 Multiport Serial PCI Card Installation Guide

Real-Time Vehicle Data Logging System Using GPS And GSM

Part Number Description Packages available

Modbus Communications for PanelView Terminals

Why you need to monitor serial communication?

EZmoto V2. Product description Rev. 6 10/01/2014. EZmoto V2 Product description Rev.6 10/01/2014

FPGA INTEGRATION MANUAL SATURN-SIL 2 MODULES. Dictionary Code. Edition 01. Revision 00. Number of pages 18

Date Rev. Details Author

Freescale Semiconductor, Inc. Product Brief Integrated Portable System Processor DragonBall ΤΜ

The Programming Interface

By4750. USB Serial Converter (RS232 RS485)

Below is a diagram explaining the data packet and the timing related to the mouse clock while receiving a byte from the PS-2 mouse:

1-Port R422/485 Serial PCIe Card

Technical Data Sheet UM-005. UM005-doc In reference to UM005-c-01.04

ENET-710. ENET Ethernet Module ENET-710 JAN / 06 FOUNDATION

Aalborg University. Institute of Electronic Systems. Fredrik Bajers Vej 7 DK-9220 Aalborg Øst Telephone

PROPRIETARY INFORMATION NOTICE

AN736. An I 2 C TM Network Protocol for Environmental Monitoring THE I 2 C BUS SPECIFICATION INTRODUCTION

LOW COST GSM MODEM. Description. Part Number

I 2 C Master Mode Overview and Use of the PICmicro MSSP I 2 C Interface with a 24xx01x EEPROM

GSM Click - Cross-Platform Development Quick Start Guide

UM I 2 C-bus specification and user manual. Document information

RS232 Board datasheet

AVR151: Setup and Use of the SPI. Introduction. Features. Atmel AVR 8-bit Microcontroller APPLICATION NOTE

Design and Implementation of Home Monitoring System Using RF Technology

Design and Verification of Nine port Network Router

L10. Quectel GPS Engine. EVB User Guide L10_EVB_UGD_V1.00

Block 3 Size 0 KB 0 KB 16KB 32KB. Start Address N/A N/A F4000H F0000H. Start Address FA000H F8000H F8000H F8000H. Block 2 Size 8KB 16KB 16KB 16KB

Data sheet Wireless UART firmware version 4.02

Eliminate Risk of Contention and Data Corruption in RS-485 Communications

LINDY ELECTRONICS LIMITED & LINDY-ELEKTRONIK GMBH - SECOND EDITION

The Analyst RS422/RS232 Tester. With. VTR, Monitor, and Data Logging Option (LOG2) User Manual

The Secrets of Flow Control in Serial Communication

UART IP Core Specification. Author: Jacob Gorban

UNIVERSITY OF CALIFORNIA. Los Angeles. Software for A Fault Tolerant. Microcontroller Network. A thesis submitted in partial satisfaction

Pmod peripheral modules are powered by the host via the interface s power and ground pins.

SPI. Overview and Use of the PICmicro Serial Peripheral Interface. Getting Started: SPI

GSM Interfacing Board

Transcription:

INFORMATICA INDUSTRIALE Lezione 6 Prof. Christian Forlani forlani@disco.unimib.it Tutor: Stefano Brusamolino brusamolino@ira.disco.unimib.it

Device Structure: Peripherals» I/O» Parallel Slave Port (PSP)» Timer» Capture/Compare/PWM (CCP)» Serial Slave Port (SSP)» Master Synchronous Serial Port (MSSP)» Addressable USART» CAN» Comparator Voltage Reference» 10-bit A/D Converter Lezione 5 2

PIC-USART MODULE (Universal Synchronous Asynchronous Receiver Transmitter) Full-duplex Asynchronous Or Half-duplex Synchronous 9-bit Addressable mode Double-buffered transmit and receive buffers Separate transmit and receive interrupts Dedicated baud rate generator Lezione 5 3

RS232 (http://www.tanzilli.com) Cos'e' e a cosa serve l'rs232 Lo standard RS232 definisce una serie di specifiche per la trasmissione seriale di dati tra due dispositivi denominati DTE (Data Terminal Equipment) e DCE (Data Communication Equipment). Come si può vagamente intuire dal nome, il Data Communication Equipment e' un dispositivo che si occupa di gestire una comunicazione dati mentre il Data Terminal Equipment e' un dispositivo che si occupa di generare o ricevere dati. RS232 RS232 La comunicazione seriale asincrona Per consentire la trasmissione di dati tra il PC ed il modem, lo standard RS232 definisce una serie di specifiche elettriche e meccaniche. Una di queste riguarda il tipo di comunicazione seriale che si vuole implementare che può essere sincrona o asincrona. Nel nostro caso analizzeremo solo la comunicazione seriale asincrona. Lezione 5 4

Standard RS232 TTL Voltage levels RS232 Voltage levels 5V Logic 1 0V Logic 0 stop Codifica seriale del numero 48 = 0b00110000 a 9600 bps (RS-232 8n2) Lezione 5 5

USART Block Diagram Lezione 5 6

UART Tx Setup CSRC Clock Source Selection (synch mode only) 1 = Master mode, clock generated by internal BRG 0 = Slave mode, clock derived from external TX9 9-bit / 8-bit Mode Transmission Selection 1 = 9-bit Transmission Format 0 = 8-bit Transmission Format TXEN Transmit Enable (overridden by SREN/CREN in SYNC mode) 1 = Transmitter Enabled 0 = Transmitter Disabled SYNC Synchronous / Asynchronous Selection 1 = Synchronous Mode 0 = Asynchronous Mode BRGH High / Low Baud Rate Selection 1 = High Speed Baud Rate, FOSC / 16 0 = Low Speed Baud Rate, FOSC / 64 TRMT Transmit Shift Register Status 1 = Transmit Shift Register Empty 0 = Transmit Shift Register Full TX9D 9th Bit of Transmit Data (valid only in 9-bit mode) Written before TXREG, used for parity or address/data Lezione 5 7

UART Rx Setup SPEN Serial Port Enable 1 = Serial Port Enabled, Uses RX and TX as serial port pins 0 = Serial Pore Disabled, RX and TX general purpose I/Os RX9 9-bit / 8-bit Mode Reception Selection 1 = 9-bit Reception Format 0 = 8-bit Reception Format SREN Single Receive Enable (Synchronous Mode Only) 1 = Enable a Single Receive 0 = Disable Single Receive, cleared when reception completed CREN Continuous Receive Enable 1 = Enables Receiver; Continuous Reception in Synch mode, overriding SREN 0 = Disables Receiver in Asynchronous Mode, SREN controls Synch mode ADDEN Address Detect Enable 1 = Enables 9-bit Address Detection, Interrupt and load RCREG when bit 9 is 1 0 = Disables Address Detection, all bytes received FERR Framing Error 1 = Framing Error Occurred in this byte, clear by read RCREG + receive next byte 0 = No Framing Error OERR Overrun Error 1 = Overrun Error, cleared by clearing CREN 0 = No Overrun Error RX9D 9th Bit of Received Data (valid only in 9-bit mode) Read before TXREG, used for parity or address/data Lezione 5 8

Baud Rate Generator Lezione 5 9

Esempio Usart TX void putchar(value) { while (PIR1bits.TXIF == 0);// Wait for empty FIFO TXREG = value; } Lezione 5 10

MCC18 USART Lezione 5 11

PIC MSSP MODULE (MASTER SYNCHRONOUS SERIAL PORT) SPI Lezione 5 12

SPI Lezione 5 13

SPI Lezione 5 14

MCC18 SPI Lezione 5 15

PIC MSSP MODULE (MASTER SYNCHRONOUS SERIAL PORT) I 2 C BUS Cos è: sistema di comunicazione che utilizza solo 2 linee bidirezionali (SDA, SCL): BUS permette il collegamento di molti dispositivi sulla stessa linea sia master che slave a differenza del protocollo RS232 (point 2 point) l aggiunta/rimozione di dispositivi non pregiudica il funzionamento del sistema già esistente Lezione 5 16

I 2 C BUS Lezione 5 17

I 2 C BUS 5.0 BIT TRANSFER Due to the variety of different technology devices (CMOS, NMOS,bipolar) which can be connected to the I2C-bus, the levels of the logical 0 (LOW) and 1 (HIGH) are not fixed and depend on the associated level of VDD (see Section 15.0 for Electrical Specifications). One clock pulse is generated for each data bit transferred. 5.1 Data validity The data on the SDA line must be stable during the HIGH period of the clock. The HIGH or LOW state of the data line can only change when the clock signal on the SCL line is LOW (see Figure 5). Lezione 5 18

I 2 C BUS 5.2 START and STOP conditions Within the procedure of the I 2 C-bus, unique situations arise which are defined as START and STOP conditions (see Figure 6). A HIGH to LOW transition on the SDA line while SCL is HIGH is one such unique case. This situation indicates a START condition. A LOW to HIGH transition on the SDA line while SCL is HIGH defines a STOP condition. START and STOP conditions are always generated by the master. The bus is considered to be busy after the START condition. The bus is considered to be free again a certain time after the STOP condition. This bus free situation is specified in Section 15.0. Detection of START and STOP conditions by devices connected to the bus is easy if they incorporate the necessary interfacing hardware. However, microcontrollers with no such interface have to sample the SDA line at least twice per clock period in order to sense the transition. Lezione 5 19

I 2 C BUS 6.2 Acknowledge Data transfer with acknowledge is obligatory. The acknowledge-related clock pulse is generated by the master. The transmitter releases the SDA line (HIGH) during the acknowledge clock pulse. The receiver must pull down the SDA line during the acknowledge clock pulse so that it remains stable LOW during the HIGH period of this clock pulse. Lezione 5 20

PIC I 2 C BUS Lezione 5 21

PIC I 2 C BUS Lezione 5 22

MCC18 I 2 C BUS I 2 C EEPROM Lezione 5 23