LTC2978 Firmware Programmer s Getting Started Guide Reading Input Voltage (VIN) Telemetry

Similar documents
Overview of the LTC2978 Configuration EEPROM (NVM) Revision 1.0

NB3H5150 I2C Programming Guide. I2C/SMBus Custom Configuration Application Note

Useful Number Systems

HOMEWORK # 2 SOLUTIO

USB Card Reader Configuration Utility. User Manual. Draft!

Technical Support Bulletin Nr.18 Modbus Tips

Table 1 below is a complete list of MPTH commands with descriptions. Table 1 : MPTH Commands. Command Name Code Setting Value Description

Nemo 96HD/HD+ MODBUS

The string of digits in the binary number system represents the quantity

RS-485 Protocol Manual

PROGRAMMABLE LOGIC CONTROLLERS Unit code: A/601/1625 QCF level: 4 Credit value: 15 TUTORIAL OUTCOME 2 Part 1

eztcp Technical Document Modbus/TCP of eztcp Caution: Specifications of this document may be changed without prior notice for improvement.

Computers. Hardware. The Central Processing Unit (CPU) CMPT 125: Lecture 1: Understanding the Computer

Lecture N -1- PHYS Microcontrollers

Numbering Systems. InThisAppendix...

Decimal Number (base 10) Binary Number (base 2)

Application Note. Introduction AN2471/D 3/2003. PC Master Software Communication Protocol Specification

Systems I: Computer Organization and Architecture

Binary Number System. 16. Binary Numbers. Base 10 digits: Base 2 digits: 0 1

Data Acquisition Module with I2C interface «I2C-FLEXEL» User s Guide

Sample EHG CL and EHG SL10 16-bit Modbus RTU Packet

SRF08 Ultra sonic range finder Technical Specification

3-Channel 0-20mA analyzer with CAN bus and logic output. A2C-mA-M12-X. General Description. Features. Specifications

Caml Virtual Machine File & data formats Document version: 1.4

2011, The McGraw-Hill Companies, Inc. Chapter 3

Dolphin In-Circuit programming Updating Firmware in the field

The New IoT Standard: Any App for Any Device Using Any Data Format. Mike Weiner Product Manager, Omega DevCloud KORE Telematics

The Answer to the 14 Most Frequently Asked Modbus Questions

Base Conversion written by Cathy Saxton

CS101 Lecture 11: Number Systems and Binary Numbers. Aaron Stevens 14 February 2011

1. Give the 16 bit signed (twos complement) representation of the following decimal numbers, and convert to hexadecimal:

Number Representation

User Manual. AS-Interface Programmer

1. Convert the following base 10 numbers into 8-bit 2 s complement notation 0, -1, -12

Binary Representation

Consult protocol, Nissan Technical egroup, Issue 6

2.0 Command and Data Handling Subsystem

plc numbers Encoded values; BCD and ASCII Error detection; parity, gray code and checksums

Chapter 7D The Java Virtual Machine

To convert an arbitrary power of 2 into its English equivalent, remember the rules of exponential arithmetic:

isppac-powr1220at8 I 2 C Hardware Verification Utility User s Guide

Computer Science 281 Binary and Hexadecimal Review

Chapter 6: From Digital-to-Analog and Back Again

SYMETRIX SOLUTIONS: TECH TIP August 2015

Lecture 11: Number Systems

Bluetooth HID Profile

Serial Communications

MAX5417L Evaluation Kit/Evaluation System

AKD EtherNet/IP Communication

73M1866B/73M1966B FXOCTL Application User Guide November 2, 2009 Rev. 4.1 UG_1x66B_009

Machine Architecture and Number Systems. Major Computer Components. Schematic Diagram of a Computer. The CPU. The Bus. Main Memory.

Manual. VE.Bus to NMEA 2000 interface

USB Sabertooth Packet Serial Reference Manual

MODULE BOUSSOLE ÉLECTRONIQUE CMPS03 Référence :

The Hexadecimal Number System and Memory Addressing

Lecture 2. Binary and Hexadecimal Numbers

This 3-digit ASCII string could also be calculated as n = (Data[2]-0x30) +10*((Data[1]-0x30)+10*(Data[0]-0x30));

Modbus Communications for PanelView Terminals

Memory Systems. Static Random Access Memory (SRAM) Cell

USB - FPGA MODULE (PRELIMINARY)

ACR122 NFC Contactless Smart Card Reader

Modbus TCP / DALI converter

Interface Protocol v1.2

Digital circuits make up all computers and computer systems. The operation of digital circuits is based on

Modbus and ION Technology

UniPi technical documentation REV 1.1

RS485 & Modbus Protocol Guide

1.Eastron SDM220Modbus Smart Meter Modbus Protocol Implementation V1.0

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

AN601 I2C 2.8 Communication Protocol. SM130 SM130 - Mini APPLICATION NOTE

CSI 333 Lecture 1 Number Systems

Soft-Starter SSW-06 V1.6X

LSN 2 Number Systems. ECT 224 Digital Computer Fundamentals. Department of Engineering Technology

Note monitors controlled by analog signals CRT monitors are controlled by analog voltage. i. e. the level of analog signal delivered through the

DS1621 Digital Thermometer and Thermostat

PFB366 Profibus-DP Gateway User Manual

MODBUS APPLICATION PROTOCOL SPECIFICATION V1.1b3 CONTENTS

NVMe TM and PCIe SSDs NVMe TM Management Interface

Command Param1 Param2 Return1 Return2 Description. 0xE9 0..0x7F (id) speed pos_high pos_low Set servo #id speed & read position

Using the HCS12 Serial Monitor on Wytec Dragon-12 boards. Using Motorola s HCS12 Serial Monitor on Wytec s Dragon-12 boards

Embedded Systems Design Course Applying the mbed microcontroller

MTS Master Custom Communications Protocol APPLICATION NOTES

CDA 3200 Digital Systems. Instructor: Dr. Janusz Zalewski Developed by: Dr. Dahai Guo Spring 2012

Binary Representation. Number Systems. Base 10, Base 2, Base 16. Positional Notation. Conversion of Any Base to Decimal.

Using Logix5000 Controllers as Masters or Slaves on Modbus

2003 HSC Notes from the Marking Centre Software Design and Development

The goal is to program the PLC and HMI to count with the following behaviors:

DS18B20 Programmable Resolution 1-Wire Digital Thermometer

Section 1.4 Place Value Systems of Numeration in Other Bases

x10* CP290 HOME CONTROL INTERFACE PROGRAMMING GUIDE FOR ADVANCED PROGRAMMERS

Levent EREN A-306 Office Phone: INTRODUCTION TO DIGITAL LOGIC

=

NHD-0420D3Z-FL-GBW-V3

GETTING STARTED WITH PROGRAMMABLE LOGIC DEVICES, THE 16V8 AND 20V8

EPM2000 LabVIEW Building Applications Instructions

Electronic Multi-Measuring Instrument

Fingerprint Based Biometric Attendance System

- 35mA Standby, mA Speaking pre-defined phrases with up to 1925 total characters.

Volume Serial Numbers and Format Date/Time Verification

Atmel Norway XMEGA Introduction

Transcription:

LTC2978 Firmware Programmer s Getting Started Guide Reading Input Voltage (VIN) Telemetry Revision 0.1 Author: Mike Holloway, Linear Technology Date: 1/25/2010, 1:40 PM Revision History: 0.2 Terminology Change: changed command byte to command code 0.1 Initial Draft Purpose The LTC2978 provides a great deal of power and configurability for custom applications. The part additionally provides onboard non-volatile memory (NVM) or EEPROM to store and recall configuration parameters. This architecture allows the chip to power up and load the desired customer configuration autonomously with no I2C/firmware interaction required. However, there are some circumstances where a customer may wish to author firmware to communicate with the part. This document provides a quick overview of one common firmware task How to read the VIN input voltage using the READ_VIN telemetry command. LTpowerPlay is a powerful tool that can be used to understand how to author the firmware to talk to the LTC2978. You can download LTpowerPlay from http://ltpowerplay.com.

Reading the Input Voltage The input voltage as measured by the ADC can be read over the PMBus using the global READ_VIN 16- bit word register. This register uses the standard PMBus Linear format for non-output voltage related registers. We call this format LinearFloat5_11, and it represents a floating point value as a 5-bit signed exponent (upper 5 bits) and a signed 11-bit mantissa (lower 11 bits). A Note on Linear Format: The term Linear format as defined in the PMBus specification actually refers to two distinctly different numeric formats. All output voltage related settings (like READ_VOUT, VOUT_COMMAND, etc) use what we call LinearFloat16 format. This is a 16-bit value that represents an unsigned mantissa which must be multiplied by a separate exponent (2-13 for the LTC2978) to determine the value. The LinearFloat16 format is not discussed in this document. All non output-voltage-related registers using Linear format use what we call LinearFloat5_11 format. This is a distinctly different numeric representation. In this case, the 16-bit value represents a self-contained floating point number, with both a 5-bit signed (two s complement) exponent (upper 5 bits) and a signed 11-bit mantissa (lower 11 bits), as discussed below. To understand the protocol/firmware required to read this register, we will utilize the Register Information tab in the LTpowerPlay GUI. To view this tab connect a demo board and launch LTpowerPlay. Then select the READ_VIN register in the Telemetry pane.

Now go over to the right and activate the Register Information tab. This tab shows you more detailed information about the selected register which can be a great help in understanding how to author the firmware. Below is an example of the Register information for the READ_VIN register: Note that the information in this tab is context sensitive. In other words, it shows you detailed information based on what is selected in the GUI. In this particular case it shows the steps required to read the global READ_VIN register for the chip at 7-bit I2C address 0x5C. Because the READ_VIN is a global register, writing the PAGE register is not required, and the examples reflect this. The view shows example C code as well as detailed SMBus protocol diagrams. The protocol

diagrams follow the conventions established in the SMBus specification. The protocol diagram legend or element key is shown in the figure below: Figure: SMBus packet protocol diagram element key The SMBus read word protocol starts out like a normal I2C write transaction. That is the address+wr is sent first, not address+rd. Then the command code follows. A repeated start follows, and then the address+rd is sent to signal that the slave should return data for the specified command code. The slave responds by transmitting the low byte first, and the host acknowledges this byte. Then the slave returns the second byte (high byte) of the data, and the host NAKs (not acknowledges) this byte. The LTpowerPlay Register Information tab above reveals all of this protocol detail in a compact visual protocol diagram.

NOTE: A very common mistake made by firmware engineers familiar with I2C but unfamiliar with SMBus is attempting to read PMBus registers by immediately sending the address+rd after the first start condition. This is incorrect. The most common error made by I2C-experienced firmware engineers shown here: 1 7 1 S Slave Address Rd 7'b1011_100 1'b1 Though the above protocol would be a valid I2C read, it is NOT a valid SMBus Read. SMBus/PMBus read byte/word transactions always start with the address+wr as shown in the LTpowerPlay protocol diagrams above, not with address+rd. Our specifi task is to read the READ_VIN register for the device at 7-bit I2C address 0x5C. The required I2C primitives in the order they would occur on the bus are as follows: I2C protocol required to read the READ_VIN register (0x88) <Start Condition> Host transmits byte 0xB8 (0x5C<<1 with Write bit set to 0) Host transmits byte 0x88 (command code for READ_VIN register) <Repeated Start Condition> Host transmits byte 0xB9 (0x5C<<1 with Read bit set to 1) Slave Responds with low data byte for READ_VIN, Host Acknowledges this byte Slave Responds with high data byte for READ_VIN, Host NAKs this byte <Stop Condition> Now let s say that the host executes the above protocol and the device replies with the 16-bit hex value 0xD317. Remember that the slave will return the lower byte (0x17) first on the wire and then the upper byte (0xD3). How do we translate the hex value 0xD317 into an actual voltage? The READ_VIN register, as shown by the Register Information tab is formatted as a LinearFloat5_11 value. This standard PMBus Linear format is used to represent all non-output voltage related telemetry registers, like READ_VIN, READ_TEMPERATURE*, READ_IIN, etc. The LinearFloat5_11 formatted value is a 16-bit value containing both a 5-bit signed (two s complement) exponent (in the upper 5 bits) and a signed 11-bit mantissa (in the lower 11 bits). This format allows representation of negative values as well as covering a very large range of values. Let s break the hex value that the slave returned (0xD317) into individual bits and look at the exponent and mantissa fields:

Bit # 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Hex Nibbles D 3 1 7 Binary Value 1 1 0 1 0 0 1 1 0 0 0 1 0 1 1 1 Field Exponent Mantissa Decimal Value -6 +791 So the LinearFloat5_11 formatted 16-bit word 0xD317 represents the numeric value 791 * 2-6 ~= 12.359V (units for the READ_VIN register are volts). More Help on 2 s Complement Representation Those unfamiliar with two s complement representation may be confused as to how we derived the decimal value -6 from the 5-bit binary value 11010. The process is quite simple. In two s complement numeric representation, the most significant bit is a called the sign bit. When it is a 1 (as in this case of our exponent), this indicates that the numeric quantity represented is negative. We can more easily see the magnitude of a negative number by negating it. Negating a two s complement value simple. To negate a value, simply invert all the bits and then add 1. Negation works in either direction -- going from negative to positive or vice versa. In our case, we start with a negative value 11010. To negate this we invert all the bits to get 00101, and then add 1 to get 00110. This is equivalent to decimal +6. So the 5-bit signed (two s complement) representation of decimal -6 is 11010. Note that we can use the same method to negate +6 (binary 00110), and we get binary 11010, confirming that the two s complement representation for -6 is binary 11010.

Example C Code The following code listing shows an example C routine that converts a 16-bit LinearFloat5_11 formatted word into a floating point value. Example Code Listing: 1 Converting a LinearFloat5_11 Formatted Word into a Floating Point Value // convert a LinearFloat5_11 formatted word into a floating point value float lin5_11tofloat(uint16_t wordvalue) { int8_t exponent = wordvalue>>11; // extract exponent as MS 5 bits int16_t mantissa = wordvalue & 0x7ff; // extract mantissa as LS 11 bits if( exponent > 0x0F ) exponent = 0xE0; // sign extend exponent if( mantissa > 0x03FF ) mantissa = 0xF800; // sign extend mantissa } return mantissa * pow(2,exponent); // compute value as // mantissa * 2^(exponent) 1 Linear Technology provides this Example Code as is without warranty of any kind.