打印

关于MAX30208医疗测温器

[复制链接]
677|2
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
沙发
QQ877789857|  楼主 | 2020-6-1 18:20 | 只看该作者
GPIO
The MAX30208 provides access to two GPIO pins which can be used to provide additional functionality. GPIO0 can be configured to output an interrupt while GPIO1 can be configured as an input for a temperature conversion. The interrupt on GPIO0 is triggered based on selectable status bits in the INTERRUPT_ENABLE[0x01] register. By writing to one of the availabe bits in the INTERRUPT_ ENABLE register, the flag for an interrupt is raised if GPIO0_MODE[1:0] in the GPIO_SETUP [0x20] register is set to 11. When GPIO1_MODE[7:0] in the GPIO_SETUP register is set to 11, driving the line low initiates an exter- nal temperature conversion. Table 2 shows a complete list of the functions of the two GPIO Pins.
Table 2. GPIO Mode Functions
Table 3. I2C Slave Address
The state of GPIO pins at each I2C start condition is used to determine the last two bits of the I2C address. This use of the GPIO pins is further detailed below in the I2C Slave Address section.
I2C
I2C Slave Address
I2C Slave Address is 8 bits as shown in Table 3. Bit 0 is 0 for a write operation and 1 for a read operation.
At powerup, GPIO0 and GPIO1 are set to mode 10 as shown in Table 3. The I2C address is determined by the state of these pins. If the mode of either of the GPIO pins is changed to 01 or 11 then those address pins are automatically pulled low internally and can change the I2C address.
I2C/SMBus Compatible Serial Interface
The MAX30208 features an I2C/SMBus-compatible, 2-wire serial interface consisting of a serial data line (SDA) and a serial clock line (SCL). SDA and SCL facil- itate communication between the MAX30208 and the master at clock rates up to 400kHz. Figure 3 shows the 2-wire interface timing diagram. The master generates SCL and initiates data transfer on the bus. The master device writes data to the MAX30208 by transmitting the proper slave address followed by the register address and then the data word. Each transmit sequence is framed by a START (S) or REPEATED START (Sr) con- dition and a STOP (P) condition. Each word transmitted to the MAX30208 is 8-bits long and is followed by an acknowledge clock pulse. A master reading data from the MAX30208 transmits the proper slave address followed by a series of nine SCL pulses. The MAX30208 transmits data on SDA in sync with the master-generated SCL pulses. The master acknowledges receipt of each byte of data. Each read sequence is framed by a START (S) or REPEATED START (Sr) condition, a not acknowledge, and a STOP (P) condition. SDA operates as both an input and an open-drain output. A pullup resistor is required on SDA. SCL operates only as an input. A pullup resis- tor is required on SCL if there are multiple masters on
the bus, or if the single master has an open-drain SCL output. Series resistors in line with SDA and SCL are optional. Series resistors protect the digital inputs of the MAX30208 from high voltage spikes on the bus lines, and minimize crosstalk and undershoot of the bus signals.
Detailed I2C Timing Diagram
The detailed timing diagram is shown in Figure 3. Bit Transfer
One data bit is transferred during each SCL cycle. The data on SDA must remain stable during the high period of the SCL pulse. Changes in SDA while SCL is high are control signals (see the START and STOP Conditions section).
START and STOP Conditions
SDA and SCL idle high when the bus is not in use. A mas- ter initiates communication by issuing a START condition. A START condition is a high-to-low transition on SDA with SCL high. A STOP condition is a low-to-high transition on SDA while SCL is high (Figure 4). A START condition from the master signals the beginning of a transmission to the MAX30208. The master terminates transmission, and frees the bus, by issuing a STOP condition. The bus remains active if a REPEATED START condition is gen- erated instead of a STOP condition.

Early STOP Conditions
The MAX30208 recognizes a STOP condition at any point during data transmission except if the STOP condition occurs in the same high pulse as a START condition. For proper operation, do not send a STOP condition during the same SCL high pulse as the START condition.
Acknowledge Bit
The acknowledge bit (ACK) is a clocked 9th bit that the MAX30208 uses to handshake receipt of each byte of data when in write mode Figure 5. The MAX30208 pulls down SDA during the entire master-generated 9th clock pulse if the previous byte is successfully received. Monitoring ACK allows for detection of unsuccessful data transfers. An unsuccessful data transfer occurs if a receiving device is busy or if a system fault has occurred. In the event of an unsuccessful data transfer, the bus master retries communication. The master pulls down SDA during the 9th clock cycle to acknowledge receipt of data when the MAX30208 is in read mode. An acknowledge is sent by
the master after each read byte to allow data transfer to continue. A not-acknowledge is sent when the master reads the final byte of data from the MAX30208 followed by a STOP condition.
I2C Write Data Format
A write to the MAX30208 includes transmission of a START condition, the slave address with the R/W bit set to 0, one byte of data to configure the internal register address pointer, one or more bytes of data, and a STOP condition. Figure 6 illustrates the proper frame format for writing one byte of data to the MAX30208. Figure 7 illustrates the frame format for writing n-bytes of data to the MAX30208.
The master first sends the slave address with the R/W bit set to 0. This indicates that the master intends to write data to the MAX30208. The MAX30208 acknowledges receipt of the address byte during the master-generated 9th SCL pulse.

使用特权

评论回复
板凳
tyw| | 2020-6-1 18:48 | 只看该作者
本帖最后由 tyw 于 2020-6-1 19:00 编辑
QQ877789857 发表于 2020-6-1 18:20
GPIO
The MAX30208 provides access to two GPIO pins which can be used to provide additional functiona ...
用狗狗翻译的,哈哈,凑合着看


通用输入输出
MAX30208可访问两个GPIO引脚,这些引脚可用于提供附加功能。 GPIO0可配置为输出中断,而GPIO1可配置为温度转换的输入。 GPIO0上的中断是根据INTERRUPT_ENABLE [0x01]寄存器中的可选状态位触发的。通过写INTERRUPT_ ENABLE寄存器中的可用位之一,如果GPIO_SETUP [0x20]寄存器中的GPIO0_MODE [1:0]设置为11,则产生中断标志。当GPIO_SETUP中的GPIO1_MODE [7:0]时寄存器设置为11,将线驱动为低电平将启动外部温度转换。表2给出了两个GPIO引脚功能的完整列表。
表2. GPIO模式功能
表3. I2C从站地址
在每个I2C启动条件下GPIO引脚的状态用于确定I2C地址的最后两位。 GPIO引脚的这种用法在下面的“ I2C从机地址”部分中进一步详细介绍。
I2C
I2C从站地址
I2C从设备地址为8位,如表3所示。位0为写操作,为1,而读操作为1。
上电时,GPIO0和GPIO1设置为模式10,如表3所示。I2C地址由这些引脚的状态决定。如果任一GPIO引脚的模式更改为01或11,则这些地址引脚会在内部自动拉低,并可以更改I2C地址。
I2C / SMBus兼容串行接口
MAX30208具有I2C / SMBus兼容的2线串行接口,由串行数据线(SDA)和串行时钟线(SCL)组成。 SDA和SCL以高达400kHz的时钟速率促进了MAX30208与主机之间的通信。图3显示了2线接口时序图。主机产生SCL并启动总线上的数据传输。主机通过发送正确的从机地址,寄存器地址和数据字,将数据写入MAX30208。每个发送序列都由START(S)或REPEATED START(Sr)条件和STOP(P)条件构成。发送到MAX30208的每个字长为8位,其后是一个确认时钟脉冲。从MAX30208读取数据的主机发送适当的从机地址,随后是一系列的9个SCL脉冲。 MAX30208与主机产生的SCL脉冲同步在SDA上发送数据。主机确认接收到每个数据字节。每个读取序列由START(S)或REPEATED START(Sr)条件,未确认和STOP(P)条件构成。 SDA同时作为输入和漏极开路输出。 SDA上需要一个上拉电阻。 SCL仅用作输入。如果在SCL上有多个主机,则在SCL上需要一个上拉电阻
总线,或者单个主机具有漏极开路SCL输出。符合SDA和SCL的串联电阻是可选的。串联电阻可保护MAX30208的数字输入免受总线上的高压尖峰的影响,并最大程度地减小串扰和总线信号的下冲。
详细的I2C时序图
详细的时序图如图3所示。
在每个SCL周期内传送一个数据位。在SCL脉冲的高电平期间,SDA上的数据必须保持稳定。 SCL为高电平时,SDA的变化是控制信号(请参见“启动和停止条件”部分)。
启动和停止条件
不使用总线时,SDA和SCL空闲高电平。主机通过发出启动条件来启动通信。 START条件是SCL为高电平时SDA由高到低的跳变。 STOP条件是SCL为高电平时,SDA由低到高的跳变(图4)。来自主机的START条件向MAX30208发送传输开始信号。主机通过发出STOP条件来终止传输并释放总线。如果生成了REPEATED START条件,而不是STOP条件,则总线保持活动状态。

提前停止条件
MAX30208在数据传输过程中的任何时候都能识别出STOP条件,除非STOP条件与START条件发生在相同的高脉冲中。为了正常工作,请不要在与启动条件相同的SCL高脉冲期间发送停止条件。
确认位
应答位(ACK)是时钟的第9位,在写入模式下,MAX30208用于握手接收每个数据字节图5.如果前一个字节成功发送,则MAX30208在整个主机产生的第9个时钟脉冲期间拉低SDA收到。监视ACK可以检测不成功的数据传输。如果接收设备正忙或发生系统故障,则数据传输失败。如果数据传输失败,则总线主机将重试通信。当MAX30208处于读取模式时,主机在第9个时钟周期拉低SDA,以确认接收到数据。确认由发送
主机在每个读取字节之后允许数据继续传输。当主机从MAX30208读取数据的最后字节时,发送不应答信息




使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

25

主题

124

帖子

2

粉丝