⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 smsc47b397.txt

📁 i2c源码
💻 TXT
字号:
November 23, 2004The following specification describes the SMSC LPC47B397-NC sensor chip(for which there is no public datasheet available).  This document wasprovided by Craig Kelly (In-Store Broadcast Network) and edited/correctedby Mark M. Hoffman <mhoffman@lightlink.com>.* * * * *Methods for detecting the HP SIO and reading the thermal data on a dc7100.The thermal information on the dc7100 is contained in the SIO Hardware Monitor(HWM).  The information is accessed through an index/data pair.  The index/datapair is located at the HWM Base Address + 0 and the HWM Base Address + 1.  TheHWM Base address can be obtained from Logical Device 8, registers 0x60 (MSB)and 0x61 (LSB).  Currently we are using 0x480 for the HWM Base Address and0x480 and 0x481 for the index/data pair.Reading temperature information.The temperature information is located in the following registers:Temp1		0x25	(Currently, this reflects the CPU temp on all systems).Temp2		0x26Temp3		0x27Temp4		0x80Programming ExampleThe following is an example of how to read the HWM temperature registers:MOV	DX,480HMOV	AX,25HOUT	DX,ALMOV	DX,481HIN	AL,DXAL contains the data in hex, the temperature in Celsius is the decimalequivalent.Ex: If AL contains 0x2A, the temperature is 42 degrees C.Reading tach information.The fan speed information is located in the following registers:		LSB	MSBTach1		0x28	0x29	(Currently, this reflects the CPU				fan speed on all systems).Tach2		0x2A	0x2BTach3		0x2C	0x2DTach4		0x2E	0x2FImportant!!!Reading the tach LSB locks the tach MSB.The LSB Must be read first.How to convert the tach reading to RPM.The tach reading (TCount) is given by:  (Tach MSB * 256) + (Tach LSB)The SIO counts the number of 90kHz (11.111us) pulses per revolution.RPM = 60/(TCount * 11.111us)Example:Reg 0x28 = 0x9BReg 0x29 = 0x08TCount = 0x89B = 2203RPM = 60 / (2203 * 11.11111 E-6) = 2451 RPMObtaining the SIO version.CONFIGURATION SEQUENCETo program the configuration registers, the following sequence must be followed:1. Enter Configuration Mode2. Configure the Configuration Registers3. Exit Configuration Mode.Enter Configuration ModeTo place the chip into the Configuration State The config key (0x55) is writtento the CONFIG PORT (0x2E). Configuration ModeIn configuration mode, the INDEX PORT is located at the CONFIG PORT address andthe DATA PORT is at INDEX PORT address + 1.The desired configuration registers are accessed in two steps: a.	Write the index of the Logical Device Number Configuration Register	(i.e., 0x07) to the INDEX PORT and then write the number of the	desired logical device to the DATA PORT.b.	Write the address of the desired configuration register within the	logical device to the INDEX PORT and then write or read the config-	uration register through the DATA PORT.  Note: If accessing the Global Configuration Registers, step (a) is not required.Exit Configuration ModeTo exit the Configuration State the write 0xAA to the CONFIG PORT (0x2E).The chip returns to the RUN State.  (This is important).Programming ExampleThe following is an example of how to read the SIO Device ID located at 0x20; ENTER CONFIGURATION MODE   MOV	DX,02EHMOV	AX,055HOUT	DX,AL; GLOBAL CONFIGURATION  REGISTER MOV	DX,02EHMOV	AL,20HOUT	DX,AL ; READ THE DATAMOV	DX,02FHIN	AL,DX; EXIT CONFIGURATION MODE     MOV	DX,02EHMOV	AX,0AAHOUT	DX,ALThe registers of interest for identifying the SIO on the dc7100 are Device ID(0x20) and Device Rev  (0x21).The Device ID will read 0X6FThe Device Rev currently reads 0x01Obtaining the HWM Base Address.The following is an example of how to read the HWM Base Address located inLogical Device 8.; ENTER CONFIGURATION MODE   MOV	DX,02EHMOV	AX,055HOUT	DX,AL; CONFIGURE REGISTER CRE0,   ; LOGICAL DEVICE 8           MOV	DX,02EHMOV	AL,07HOUT	DX,AL ;Point to LD# Config RegMOV	DX,02FHMOV	AL, 08HOUT	DX,AL;Point to Logical Device 8;MOV	DX,02EH MOV	AL,60HOUT	DX,AL	; Point to HWM Base Addr MSBMOV	DX,02FHIN	AL,DX	; Get MSB of HWM Base Addr; EXIT CONFIGURATION MODE     MOV	DX,02EHMOV	AX,0AAHOUT	DX,AL

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -