完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
嗨,伙计们。我正在读SMBus规范,发现了一些我不知道的东西。附件1显示了块读取图,我真的不知道为什么字节计数是由奴隶决定的(附件2)。不是大师?我想由它来决定要接收多少数据,谢谢。
以上来自于百度翻译 以下为原文 Hi, guys. I'm reading the smbus spec and found something that I don't know. The attachment 1 shows block read diagram, which I really don't know is that why Byte Count is determined by slave(attachment 2)? not Master? I think it's up to Master to decide how many data it want to receive. Thanks. Attached Image(s) |
|
相关推荐
19个回答
|
|
|
不,奴隶告诉主人它应该读取多少字节来选择地址。
以上来自于百度翻译 以下为原文 No, the Slave is telling the Master how many bytes it should read for the selected address. |
|
|
|
|
|
QHB:M…我感到困惑。在I2C中,无论读到多少字节,大师都只是去读,就像:开始& GT;地址+W-& GT;寄存器&重复的开始& GT;地址+ R & GT;寄存器中的数据字节。SMBus也是这样吗?我认为在SMBus应该是:开始-GT;地址+W->命令& gt;重复启动&字节计数-gt;地址+ r & gt;数据字节从命令。
以上来自于百度翻译 以下为原文 To qhb: m.... I got confused. In the I2C, the master just go read no matter how many bytes master wants to, just like: Start -> address+W -> register -> Repeated start -> address+R -> data bytes from register. So does SMBus? I thought in SMBus it should be: Start -> address+W -> command -> Repeated start -> Byte count -> address+R -> data bytes from command. |
|
|
|
|
|
这是完全一样的,“地址+R”必须遵循重复启动。SMBus文档告诉您,读取的第一个字节将告诉您应该读取多少字节才能获得整个寄存器。
以上来自于百度翻译 以下为原文 It's exactly the same, the "address+R" must follow the repeated start. The SMBUS documentation tells you that the first byte you read will tell you how many bytes you should read to get the whole register. |
|
|
|
|
|
问题是,主如何知道要读取多少字节?虽然大多数SMBus项目是2字节,但块读取没有指定长度。
以上来自于百度翻译 以下为原文 The question is how does the master know how many bytes to read? While most smbus items are 2 bytes, the block read has not specified length. |
|
|
|
|
|
NKurzman:M…如果主人想连续读8字节怎么办?在I2C中,只需读取而不指定字节长度。SMBus也是这样保存的吗?
以上来自于百度翻译 以下为原文 To NKurzman: m...what if master wants to read 8 bytes consecutively? In I2C, just go reading without specifying byte length. is SMBus also held by this? |
|
|
|
|
|
SMBUS是由特定大小的寄存器组成的。当你读取时,它告诉你(在第一个字节中)你当前正在读取的寄存器中有多少字节。
以上来自于百度翻译 以下为原文 Your totally missing the point. SMBUS is made up of registers of a specific size. When you do a read, it tells you (in the first byte) how many bytes are in the register you are currently reading. |
|
|
|
|
|
只有块读寄存器是这样的。也有固定长度的寄存器。
以上来自于百度翻译 以下为原文 Only the block read registers are like that. There are also fixed length registers. |
|
|
|
|
|
问Q:是的,我想我没有抓住要点。我想也许我在错误的开始时用错误的方式表达。我想做的是用SMBus连续读取7个单元电压。7个单元的地址是0x3C,0x3D…如果这是I2C,我需要做的是发送0x3C和ACK的奴隶连续接收下一个字节,直到发送NACK到奴隶停止它。SMBus也持有这种方式吗?
以上来自于百度翻译 以下为原文 To qɥb: Yes, I think I missed the point. I think maybe I expressed in wrong way at the beginning. What I want to do is to read 7 cells voltage consecutively by SMBus. The address of 7 cells are 0x3C, 0x3D... to 0x42. IF this is by I2C, what I need to do is send 0x3C and ack the slave to continually receive next byte until sending nack to slave to stop it. Is SMBus held this way too? |
|
|
|
|
|
但它不是I2C。我假设那些是16位寄存器。他们不会给你一个尺寸。我不记得柴林读书是允许的。我不能肯定你能做到这一点。你所读到的块将被用来阅读战斗名称。
以上来自于百度翻译 以下为原文 But it is not i2c. I assume those are 16 bit registers. And they will not give you a size. I do not remember chaianed reading to be allowed . I am not sure you can do that. The block read you asked about would be used for reading the batttery name. |
|
|
|
|
|
我有两个I2C设备在一个板上坐在这里- TMP422和PAC1720。两个都说I2C/PMBUS。TMP422没有地址递增,如果你在一个事务中读取多个字节,那么每次只从相同的地址获得数据——除了三个16B的温度寄存器。如果从一个温度高字节位置读取2个字节,即使在高字节和低字节的地址不相邻,也会得到第二读取的低位字节。在每个字节之后,PAC1720将愉快地增加地址,这样您就可以在一个事务中访问整个寄存器映射。LSO使用了一些PMbus监管机构,例如ZL9010。每个寄存器访问具有指定的消息数据长度。这里没有自动递增。底线- PMBus设置“标准”接口,但必须检查每个设备的数据表,以确定其能力。
以上来自于百度翻译 以下为原文 I've got two I2C devices on a board sitting here - TMP422 and PAC1720. Both say I2C/PMbus. The TMP422 does no address incrementing, and if you read multiple bytes in one transaction you just get data from the same address each time - except for the three 16b temperature registers. If you read 2 bytes from a temperature high byte location, you get the low temp byte on the 2nd read even though the addresses for the high and low bytes aren't adjacent. The PAC1720 will happily increment the address after each byte so you can access the whole register map in one transaction. I've also used some PMbus regulators - for example ZL9010. Each register access has a specified message data length. No auto incrementing here. Bottom line - PMBus sets a "standard" interface, but you must review the datasheet for every device to determine it's capability. |
|
|
|
|
|
NKurzman:谢谢,我决定做一个测试来检查这个函数是否工作。我的意思是,I2C或SMBus标准没有指定这个函数必须被添加。
以上来自于百度翻译 以下为原文 To NKurzman: Thank you, I decide to do a test to check whether this function works or not. To mbrowning: Is that to say, the function "read multiple bytes in one transaction" is case-by-case? I mean, the I2C or SMbus standard doesn't specify this function must to be added. |
|
|
|
|
|
你并不完全清楚。总线上的设备的地址值地址或它们在SMBus设备内的地址吗?如果你告诉我们你正在使用的设备将帮助我们。如果那些值(0x3c,0x3d,…)是设备地址,你必须为每个设备使用一个SMBus读事务,每次访问一个设备。如果这些地址是SMBus设备中的位置,那么设备数据表应该告诉您如何访问这些位置,包括如何连续访问这些位置。如您所注意到的,I2C和SMBus,同时共享通常允许I2C AN互操作性的电气规范。D SMBus设备在同一总线上,在事务结构上有很大的不同。I2C规范没有指定用于发送命令和写入和读取数据的任何特定格式。相反,SMBus规范是面向命令的。在几个小例外情况下,所有SMBus事务都是通过向SMBus设备写入命令开始的。该命令可以包括从主机发送给奴隶的数据(例如设置输出电压),或者如果读取事务的一部分,告诉奴隶从奴隶那里需要什么数据(例如SMBus设备温度的当前读数)。拥有SMBus和PMBus®规范的UM(SMIF)保留了一个顾问(ME)来回答关于SMBus和PMBus规范的问题。将您的问题发送到TealQuass@ SMIfUMU.ORG。根据我的总工作量,可能需要几天的时间才能得到响应。
以上来自于百度翻译 以下为原文 Your are not entirely clear. Are the address values addresses of devices on the bus or they addresses within an SMBus device? Perhaps if you told us that device you are using it would help us help you. If those values (0x3C, 0x3D, ...) are device addresses, you will have to use an SMBus read transaction for each device, accessing each device one at a time. If those addresses are locations within an SMBus device, then the device data sheet should tell you how to access those locations, including how to access them in succession. As you have noted, I2C and SMBus, while sharing electrical specifications that generally allow for interoperability of I2C and SMBus devices on the same bus, are very different in the structure of transactions. The I2C specification does not specify any particular format for how commands are sent and data written and read. The SMBus specification, in contrast, is command oriented. With a couple of minor exceptions, all SMBus transactions start with writing a command to a SMBus device. That command may include data sent from the master to the slave (such as setting an output voltage) or if part of a READ transaction, tells the slave what data the master wants from the slave (such as a current reading of the SMBus device temperature). By the way, the System Management Interface Forum (SMIF) that owns the SMBus and PMBus® specifications retains a consultant (me) to answer questions about the SMBus and PMBus specifications. Send your question to techquestions@smiforum.org. Depending on my total workload, it may take a couple of days to get a response. |
|
|
|
|
|
它们是寄存器地址,因为SMBus电池是地址0x16。我猜是一个7单元的TI芯片,但他没有说。他认为自从SMBus像I2C,它将工作像一个I2C EEPROM。你可以通过阅读来阅读下一个地址。我不记得这是真的。标题块读是令人困惑的,因为他不是在谈论SMBus块读,而是一个I2C EEPROM SMBus页面读取
以上来自于百度翻译 以下为原文 They are Register Address since an SMBus Battery is address 0x16. I would Guess a 7 Cell TI Chip, but he did not say. He thinks since SMBus is like I2C that it will work like an I2C eeprom. That you can read the next address by just reading. I do not remember this being true. The Title Block Read is confusing since he is NOT talking about an SMBus Block Read, But an I2C EEPROM SMBus Page Read |
|
|
|
|
|
更多的关于SMBus如何工作(与I2C相比)。由于I2C没有定义数据包的任何结构,这允许设备实现自动增加(或自动递减)I2C设备存储器的连续读取。然而,面向命令的SMBus结构不允许这样做。每个命令都有一个定义的数据格式,它可以是字节、字或块。SMBus规范的最新版本现在包括用于在一个事务中读取和写入32位和64位的协议。SMBus设备数据表定义与每个命令相关联的数据。因此,例如,设置输出电压的命令可以将数据作为具有1 mV/比特的固定分辨率的16位整数。或者它可能具有从从设备支持的预定义输出电压表中选择的8位值。无论数据和格式如何,都要在SMBus设备数据表中描述。这是由编写系统主代码的人来理解每个SMBus设备的命令和数据格式,并使用正确的SMBus协议(例如,写Word)来发送命令和写入DAT。A(或读取单词以读取16位值)。这就是为什么在使用读块协议时,从属发送字节数的原因。对于使用读块协议的命令,SMBus从设备数据表将定义将返回多少字节以及这些字节中包含的每一个字节。当主控制器为读块协议发送以下序列:MART:START条件主机:7位从属地址寄存器:R/W×位=0(作为命令写入)从:ACK(在SMBus奴隶必须总是自己的地址)主控:使用读组的命令的8位命令代码k协议从:AkMist:重复启动主机:7位从属地址主机:R/W=1(告诉主从请求数据)。哪些数据?由于没有停止条件,事务继续,并且从属知道主要与先前发送的命令代码相关联的数据)从属:Ac从属:块CONTHMARE:ACK(ACK),只有当块计数匹配主机期望的数据字节数时才ACK(ACK)。如果存在不匹配,则主控器应声明一个故障和错误,并结束事务,并使用NACK和停止条件)从属设备:由从属设备的数据主控器定义的第一个数据字节:ACK……从属器持续发送数据,因为主控器一直在驱动时钟从属:最后一个数据旁路器:NAC。K(NACK告诉奴隶主正在读取数据,事务正在结束)主:停止条件(结束事务)让我知道这是否有帮助。
以上来自于百度翻译 以下为原文 A bit more on how SMBus works (compared to I2C). Since I2C does not define any structure to the packets, that allows devices to implement auto-incrementing (or auto-decrementing) successive reads of an I2C device memory. However, the command oriented structure of SMBus does not really allow this. Each command has a defined data format, which can be byte, word, or block. The most recent version of the SMBus specification now includes protocols for reading and writing 32 and 64 bits in one transaction. The SMBus device data sheet defines the the data associated with each command. So, for example, a command to set the output voltage might have the data as a 16 bit integer with a fixed resolution of 1 mV/bit. Or it might have an 8 bit value that selects from a table of pre-defined output voltages supported by the slave device. Whatever the data and its format, it is to be described in the SMBus device data sheet. It is up to the person writing the code for the system master to understand each SMBus device's commands and data formats and use the right SMBus protocol (for example, WRITE WORD) to send a command and write data (or READ WORD to read back a 16 bit value). This is why when using the READ BLOCK protocol the slave sends the number of bytes. For a command that uses the READ BLOCK protocol, the SMBus slave device data sheet will define how many bytes will be returned and what each of those bytes contains. When the master sends the following sequence for a READ BLOCK protocol: Master: START condition Master: 7 bit slave address Master: R/W# bit = 0 (as a command is being written) Slave: ACK (in SMBus slaves must always ACK their own address) Master: 8 bit command code for a command that uses the READ BLOCK protocol Slave: ACK Master: REPEATED START Master: 7 bit slave address Master: R/W# = 1 (tells the slave that the master is requesting data. Which data? As there was no STOP condition the transaction continues and the slave knows that the master wants the data associated with the previously send command code) Slave: ACK Slave: Block count Master: ACK (ACK only if the block count matches the number of data bytes the master is expecting. If there is a mismatch, then the master should declare a fault/error and end the transaction with a NACK and STOP condition) Slave: First data byte as defined by the slave device's data sheet Master: ACK ....Slave keeps sending data as the master keeps driving the clock Slave: Last data byte Master: NACK (the NACK tells the slave that the master is done reading data and the transaction is ending) Master: STOP condition (ends the transaction) Let me know if this is helpful. |
|
|
|
|
|
对不起,回复这么晚。Bob White:对不起,我不太明白这个句子,但我可以告诉你,这些地址都在SMBus设备内。附件是设备数据表,它告诉我应该使用Read Word协议来访问这些位置。我可能会问,是否有一个标准指定。NG如何在SMBus接续注册?还是以此类推?我知道I2C有一个连续访问的标准。NKurzman:对不起,我不理解这个句子,什么是“既然他不是在谈论SMBus块读”。他是在说我吗?
以上来自于百度翻译 以下为原文 Sorry, reply so late. To Bob White: Sorry, I don't quite understand this sentence, But I can tell you that those addresses are within an SMBus device. The attachment is the device datasheet, it tells me I should use Read Word protocol to access those location I may ask that is there a standard specifying how to access register successively in SMBus? Or it's case by case? I do know the I2C has a standard to do successive accessing. To NKurzman: Sorry, I don't understand this sentence, what is "since he is NOT talking about an SMBus Block Read". is this he saying me? Attached Image(s) |
|
|
|
|
|
Bob White:这很有帮助。我可能想问一些更深层次的问题。如果我正在编写主代码并实现读块协议,那么如何确保从属发送的字节计数与我想要的计数相匹配呢?听起来我需要提前检查数据表这样的代码:对吗?
以上来自于百度翻译 以下为原文 To Bob White: This is very helpful. I may want to ask some deeper question. If I'm writing the code for Master and implementing the READ BLOCK protocol, how do I make sure that the Byte count that slave sends matches the count what I want? It sounds like I need to check datasheet in advance to code like this: if(the byte count slave send matches) { send ack to slave } else { end nack to slave } Right? |
|
|
|
|
|
在SMBus中有一个叫做块读的东西。它只能在支持它的寄存器上使用。例如标准SMBus电池上的电池名称和制造商名称。
以上来自于百度翻译 以下为原文 In smbus there is a thing called block read. It can only be used on registers that support it. For example the battery name and manufacturer name on a standard smbus battery. |
|
|
|
|
|
安迪,数据表摘录非常清楚——您不能在一个SMBus事务中读取多个单元值。您必须用读取块协议将一个SMBus命令发送到设备,该设备带有要读取的单元的命令代码(例如0x3e读取单元3的电压)。您将从设备中返回一个16位无符号整数的单元电压,分辨率为1 mV/BIT。为了读取另一个单元的电压,您将使用另一个SMBus事务,使用读取的Word协议和要读取的单元格的命令代码。
以上来自于百度翻译 以下为原文 Andy, The data sheet excerpt is quite clear - you cannot read multiple cell values in one SMBus transaction. You have to send an SMBus command to the device with the command code for the cell you want to read (e.g. 0x3E to read the voltage of cell 3) with the READ BLOCK protocol. You will get back from the device the cell voltage in a 16 bit unsigned integer with a resolution of 1 mV/bit. To read the voltage of another cell you will have use another SMBus transaction using the READ WORD protocol and the command code for the cell you want to read. |
|
|
|
|
|
是的,当使用读块协议时,主必须知道是否从主从中预想有多少字节。正如你所说,这些信息将在从设备的数据表中。你的代码片段传达了正确的思想。
以上来自于百度翻译 以下为原文 Yes, the master must know if advance how many bytes are expected from the slave when using the READ BLOCK protocol. As you say, this information will be in the slave device's data sheet. Your code snippet conveys the right idea. |
|
|
|
|
只有小组成员才能发言,加入小组>>
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
473 浏览 0 评论
5793 浏览 9 评论
2334 浏览 8 评论
2224 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3530 浏览 3 评论
1124浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
1098浏览 1评论
我是Microchip 的代理商,有PIC16F1829T-I/SS 技术问题可以咨询我,微信:A-chip-Ti
873浏览 1评论
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
475浏览 0评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-2 09:26 , Processed in 1.659556 second(s), Total 107, Slave 91 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
2623