Application Note One Wire Digital Output. 1 Introduction. 2 Electrical Parameters for One Wire Interface. 3 Start and Data Transmission

Similar documents
FM24C16B-GTR. 16Kb Serial 5V F-RAM Memory. Features. Pin Configuration. Description. Ordering Information NC NC NC VSS VDD WP SCL SDA.

DIGITAL HUMIDITY SENSOR HYT-131

FM24C16C-GTR. 16Kb Serial 5V F-RAM Memory. Features. Description. Pin Configuration NC NC NC VSS VDD WP SCL SDA. Ordering Information.

FM24C Kb FRAM Serial Memory Features

SILICON MICROSTRUCTURES

FM24CL04 4Kb FRAM Serial Memory

Specification E2 Interface

FM24C64C-GTR. 64Kb Serial 5V F-RAM Memory Features. Pin Configuration. Description A0 A1 A2 VSS VDD SCL SDA. Ordering Information.

Preliminary Data MOS IC. Type Ordering Code Package SDA Q67100-H5092 P-DIP-8-1

FM24C Kb FRAM Serial Memory Features

Preliminary Data MOS IC. Type Ordering Code Package SDA Q67100-H5096 P-DIP-8-1

DS28CM00. I²C/SMBus Silicon Serial Number

FM24CL64 64Kb Serial 3V F-RAM Memory Features

I 2 C Port Expander with Eight Inputs. Features

2. (2 pts) If an external clock is used, which pin of the 8051 should it be connected to?

12 Push-Pull Outputs and 4 Inputs

NHD-0216K3Z-NS(RGB)-FBW-V3

MicroToys Guide: PS/2 Mouse N. Pinckney April 2005

+Denotes a lead(pb)-free/rohs-compliant package.

and 8 Open-Drain I/Os

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

USB-4303 Specifications

DS2430A 256-Bit 1-Wire EEPROM

Specifications PMD-1208FS

Specifications USB-1408FS

Digital Thermometer and Thermostat

USB-1616FS. Analog Input and Digital I/O. Specifications

General information. Engineering with. Supply voltage. Load voltage L+ Input current. Power losses. Memory. Work memory.

Appendix) Specifications of Monitor & Control Rev. 4.0 July 13, 2016

EE445L Fall 2012 Quiz 2B Page 1 of 6

Product type designation. General information. Supply voltage. Input current

Features. Ordering Information. Selector Guide. Applications. Pin Configurations. I 2 C Port Expander with 8 Open-Drain I/Os

ORDERING INFORMATION. OPERATION Measuring Temperature A block diagram of the DS1621 is shown in Figure 1. DESCRIPTION ORDERING PACKAGE

Specifications

DS2401 Silicon Serial Number

USB-1208LS Specifications

Product type designation. General information. Supply voltage

VORAGO VA108x0 I 2 C programming application note

DS1631/DS1631A/DS1731 High-Precision Digital Thermometer and Thermostat

Supply voltage. Input current. Encoder supply. Memory SIMATIC S7-200, CPU 221 COMPACT UNIT, DC POWER SUPPLY 6 DI DC/4 DO DC, 4 KB CODE/2 KB DATA,

MODBUS Protocol. The ecode Encoders contain both single register (16 bit) and double register (32 bit) values.

HDI Series Amplified pressure sensors

Digital Thermometer and Thermostat

Copyright Extract from Conditions of Sale Safety Warning

DS1855 Dual Nonvolatile Digital Potentiometer and Secure Memory

A B C D E F 0480 FE B F5 3B FC F3 E 1A 1D 2A 2D 3A 3D 4A 4D 5A 5D 6A 6D 7A 7D

DS1676 Total Elapsed Time Recorder, Erasable

Review for Exam 3. Write 0x05 to ATD0CTL4 to set at fastest conversion speed and 10-bit conversions

Freescale Semiconductor, I

Altimeter / Barometer Module SMD500 ultra low power, low voltage

NHD-0220D3Z-FL-GBW-V3

Product Information on the Manual

Hello, and welcome to this presentation of the STM32 I²C interface. It covers the main features of this communication interface, which is widely used

PART IN+ IN- TX_DISABLE TX_FAULT BIAS SET BIASMAX 2 APCSET 2 MODSET 2 MOD SET PC_MON BS_MON

COMMUNICATION MODBUS PROTOCOL

Asynchronous Data Transfer

General information. Supply voltage

DS1306. Serial Alarm Real Time Clock (RTC)

Debounced 8 8 Key-Scan Controller

DS1821 Programmable Digital Thermostat and Thermometer

NHD-0220D3Z-FL-GBW-V3

DS75 Digital Thermometer and Thermostat

EE445L Fall 2010 Final Version A Page 1 of 10

Absolute Encoder Multiturn

I/O Systems (3): Clocks and Timers. CSE 2431: Introduction to Operating Systems

Digital Thermometer and Thermostat

Supply voltage. Input current. Encoder supply. Memory

Product Family Specification

DS1625. Digital Thermometer and Thermostat FEATURES PIN ASSIGNMENT

HP 48 I/O Technical Interfacing Guide

GT24C02. 2-Wire. 2Kb Serial EEPROM (Smart Card application)

DS2401 Silicon Serial Number

Specifications USB-1616FS

DS WIRE INTERFACE 11 DECOUPLING CAP GND

DS1845 Dual NV Potentiometer and Memory

DS1821 Programmable Digital Thermostat and Thermometer

SOLUTIONS!! DO NOT DISTRIBUTE PRIOR TO EXAM!!

PI4IOE5V bit I 2 C-bus and SMBus low power I/O port with interrupt and reset

Asynchronous Transmission. Asynchronous Serial Communications & UARTS

Nuvoton NCT5655Y/W. 16-bit I 2 C-bus and SMBus GPIO controller with interrupt. Revision: 1.0 Date: May, 2016 NCT5655Y/W

DS1305 Serial Alarm Real Time Clock (RTC)

TS2043 Preliminary CMOS IC

80C51 Block Diagram. CSE Overview 1

DS1624 Digital Thermometer and Memory

RS232-ADC16/24 Manual

School of Computer Science Faculty of Engineering and Computer Science Student ID Number. Lab Cover Page. Lab Date and Time:

DS1305. Serial Alarm Real Time Clock (RTC) FEATURES PIN ASSIGNMENT ORDERING INFORMATION

e-pg Pathshala Subject: Computer Science Paper: Embedded System Module: Interrupt Programming in Embedded C Module No: CS/ES/20 Quadrant 1 e-text

I 2 C Application Note in Protocol B

M68HC08 Microcontroller The MC68HC908GP32. General Description. MCU Block Diagram CPU08 1

Measuring Duty Cycles with an Intel MCS-51 Microcontroller

INTEGRATED CIRCUITS. PCA bit I 2 C and SMBus I/O port with interrupt. Product data sheet Supersedes data of 2004 Jul 27.

FM24C02B/04B/08B/16B 2-Wire Serial EEPROM

BTH-1208LS Wireless Multifunction DAQ Device

PT7C4563 Real-time Clock Module (I2C Bus)

COMMUNICATION MODBUS PROTOCOL

UNIVERSITY OF BOLTON SCHOOL OF ENGINEERING MSC SYSTEMS ENGINEERING AND ENGINEERING MANAGEMENT SEMESTER 2 EXAMINATION 2016/2017

FM24C02A 2-Wire Serial EEPROM

Functional block diagram AD53x1 (Analog Devices)

HT1621. RAM Mapping 32 4 LCD Controller for I/O µc. Features. General Description. Selection Table

Transcription:

Application Note One Wire Digital Output 1 Introduction The pressure transmitter automatically outputs pressure data, and when appropriate temperature data, in a fixed interval. The host simply waits for the next data packet. For the digital transmission, the ZACWire protocol has been used. It is a two or three byte transmission with Manchester encoding. The first two bytes represent the pressure value. The third byte is the digital temperature value. Huba sensors are by default set to output both temperature and pressure data. Data interval: Pressure transmitter: typically 1.64ms Pressure transmitter with Temperature: typically 1.97ms Pressure value P0%...P100% = digital value 3000 11000 (0xBB8 0x44C) Temperature value -50 C +150 C = digital value 0 255 (0x0 0xFF) 2 Electrical Parameters for One Wire Interface No. Parameter Symbol Min Typ Max Unit Comments 1 Pull-up resistor (sensor) R pu 30 kω 2 Pull-up resistor (customer) R pu_ext 150 Ω 3 Rise time T rise 5 µs 4 Line resistance 1) R load 3.9 kω 5 Load capacitance 1) C load 0 1 5 nf 6 Voltage low level V low 0 0.2 V DD 7 Voltage high level V high 0.8 1 V DD 1) The rise time must be T rise = 2 * R load * C load 5 μs. If using a pull-up resistor instead of a line resistor, it must meet this specification. The absolute maximum for C load is 5nF. Table 1: typical values and parameters 3 Start and Data Transmission After power-on, the sensor requires a maximum of 8ms for start-up. After that the sensor starts sending its data. The master does not have to initialize the transmission or send a start signal. On the other hand, the transmission cannot be suppressed. After finishing a data transmission there is an idle time of approximately 1ms, at the fastest update rate. This means a complete transmission of bridge data, including idle time, typically takes 1.64ms. A complete transmission of bridge and temperature data, including idle time, typically takes 1.97ms. 1

4 Bit Encoding The bit format is duty-cycle encoded: Start bit => 50% duty cycle used to set up strobe time Logic 1 => 75% duty cycle Logic 0 => 25% duty cycle Stop Time The ZACWire bus will be held high for 32μs (nominal) between consecutive data packets regardless of baud rate. Figure 1: Manchester Duty Cycle 5 Communication Speed and Data Format The communication speed depends on the update rate of the sensor. There are 4 possible update rates, at 8 Hz and 40 Hz update rate the communication speed is typically 8 khz (maximum 9.6 khz) and at 200 Hz and 1 khz update rate the communication speed is 32 khz (minimum 26 khz). Without a special customer calibration, Huba sensors have an update rate of 1 khz which results in a minimum baud rate of 26 khz. The maximum baud rate deviation is in the range of +/- 20%. Data Bits parity check is Even-Parity. Figure 2: Scope plot of One Wire transmission of 2 Bytes 2

The 14 bit digital pressure output format is shown in Figure 3 (only pressure, without temperature). Figure 3: Digital Output Pressure Readings The Huba sensors normally transmit the pressure and the temperature values. The temperature byte represents an 8-bit temperature quantity spanning from -50 to 150 C. Figure 4: Digital Output Pressure Readings with Temperature Figure 5: Transmission example of 2 data packets (only pressure data) 3

6 Temperature Measurement As the temperature changes more slowly than the pressure signal, the measurement is done in longer intervals. The temperature is measured every 128 pressure measurement cycles. With an update rate of 1 khz, such a measurement cycle, including temperature measurement, takes approximately 1ms longer than a pure pressure measurement. 7 Digital Output vs. Resolution 7.1 Pressure signal The digital pressure output signal is a 14 bit value. The digital value 3000 represents the 0% FSO point and the digital value 11000 represents the 100% FSO point. That does not mean that the real resolution of the sensor is 8000 Digits! Huba Control AG normally guarantees minimum 10 bit resolution for their standard products. 7.2 Temperature signal The digital temperature output signal is an 8 bit value. The digital value 0 represents -50 C and the digital value 255 represents +150 C. The temperature range is dependent on the sensor product. Huba Control AG normally guarantees an 8 bit resolution for their standard products. 8 Sensor failure In case of a sensor failure the sensor generates a parity error or the data transmission stops. 9 An Example of PIC1 C Code for Reading the ZACwire The following C code routine (onewire_int) is for reading a byte of ZACwire transmission from a pressure sensor. In this application, the ZACwire was connected to pin 0 of portb (PORTBbits.RB0). This is the interrupt pin of a PIC18F1220. It is best to have the ZACwire connected to a pin of the μcontroller that can cause an interrupt on a falling edge. This routine should be called from the ISR when a falling edge of the ZACwire signal (1st falling edge of a start bit) is detected. In this case, the μcontroller (PIC18F1220) is running at 24MHz, although this routine should work well for speeds between 16MHz and 24MHz. /****************************** * Global Variable Definitions * ******************************/ unsigned char data_byte; unsigned char onewire_int (void) { /********************************************************* * This routine returns two bytes. data_byte is a global * * unsigned char which will hold the data read from the * * onewire. The unsigned char the routine returns will * * be a status indicating the state of the read * 4

* 0x01 = Good * * 0x00 = Time out * * 0x05 = Parity error * *********************************************************/ unsigned char strb_cnt,bit_cnt,tstrobe,prty_cnt; unsigned char time_out; /******************************** * Time the start bit low period * ********************************/ Tstrobe=0x02; /* start non-zero to account for overhead (ISR latency) */ while (!(PORTBbits.RB0)) { /* 7 state loop (access RAM mode) */ if (++Tstrobe==0x00) { return(0x00); /* if Tstrobe rolled over then we have a timeout */ /************************************************ * Tstrobe now contains a time start bit was low * * Now clear data_byte and parity counter before * * next fall of onewire * ************************************************/ data_byte = 0x00; prty_cnt=0x00; /***************************************************** * Now for the 8 bits in a byte wait for falling edge * *****************************************************/ for (bit_cnt=0; bit_cnt<8; bit_cnt++) { time_out=0x00; strb_cnt=0x00; data_byte = (data_byte<<1); /* shift while there is time */ while (PORTBbits.RB0) { if (++time_out==0x00) { /* wait for falling edge of data bit */ return(0x00); /* if time_out rolls over then have a timeout */ /**************************************** * Timer loop until strb_cnt = Tstrobe * * NOTE: it is important that this loop * * takes the same time as the loop above * * that timed the start bit and setup * * Tstrobe * 5

****************************************/ while (strb_cnt!=tstrobe) { /* 7 state loop when compiled */ Nop(); /* in access RAM mode */ strb_cnt++; /******************************** * Now sample state of onewire * ********************************/ if (PORTBbits.RB0) { data_byte++; /* if onewire high then set the LSB of data_byte */ prty_cnt++; /* if onewire high then increment the parity counter */ /************************************************** * Now wait for rise if it has not already happened * **************************************************/ time_out =0x00; while (!(PORTBbits.RB0)) { /* wait for rising edge of data bit */ if (++time_out==0x00) { /* if time_out rolls over then have a timeout */ return(0x00); strb_cnt=0x00 /********************************** * Now wait for falling edge of parity bit * **********************************/ time_out = 0x00; while (PORTBbits.RB0) { if (++time_out==0x00) { return(0x00); /************************************* * Timer loop till strb_cnt = Tstrobe * *************************************/ while (strb_cnt!=tstrobe) { Nop(); /* 7 state loop */ strb_cnt++; /************************ 6

* Now sample parity bit * *************************/ if (PORTBbits.RB0) { prty_cnt++; if (prty_cnt % 2) { /* parity_cnt must be even */ return(0x05); /* parity error */ /************************************ * Now wait for rise of parity if it * * has not already happened * ************************************/ time_out=0x00; while (!(PORTBbits.RB0)) { if (++time_out==0x00) { return(0x00); return(0x01); /* Good data in data_byte */ 10 Revision Date Description Short Sign 7