资源描述
3.2 INTERRUPT SETTINGS
Five different types of interrupts can be programmed. When the corresponding criterion becomes valid, the interrupt pin is triggered to a high level. All interrupt criteria are combined and drive the interrupt pad with an Boolean <OR> condition.
3.2中断设置
5种不同类型的可编程中断。当相应的(中断)准则有效时,中断引脚被一个高电平触发。所有的中断准则都是相结合(联合的)的(combined ),而且可以用布尔<OR>条件来( Boolean <OR> condition)驱动中断缓冲器。
Interrupt generations may be disturbed by changes of EEPROM, image or other control bits because some of these bits influence the interrupt calculation. As a consequence, no write sequence should occur when microprocessor is triggered by interrupt or the interrupt should be deactivated on the microprocessor side when write sequences are operated.
中断的产生可能被EEPROM,image或其他控制位的改变所改变.因为其中一些控制位影响中断计算。因此,未写的(中断)时间序列应该在微处理器被其他中断触发(生效)前发生,或者微处理器应该屏蔽(后来发生的)中断当已写(中断)时间序列(write sequences)正在运行时。
Interrupt criteria are using digital code coming from digital filter output. As a consequence all thresholds are scaled with range selection (section 3.1.3.2). Timings used for high acceleration and low acceleration debouncing are absolute values (1 LSB of HG_dur and LG_dur registers corresponds to 1 millisecond, timiming accuracy is proportional to oscillator accuracy = +/-10%), thus it does not depend on selected bandwidth. Timings used for any motion interrupt and alert detection are proportional to bandwidth settings (section 3.1.3).
中断准则使用的数字代码来自数字滤波器输出。因此所有阈值的设置都由量程选择开关来界定(section 3.1.3.2 ) 。用于高加速度和低加速度之间的去抖的timiming(定时)是绝对值( HG_dur和LG_dur寄存器的一个最小可分辨信号相当于1毫秒, timiming的准确性于振荡器精度成正比= + / -10 % ) , 因此,它并不依赖于选定的带宽。用于any motion中断位和alert规则的timiming正比于带宽设置(section 3.1.3 )。
3.2.1 Enable_LG使能位_LG:
This bit (address 0Bh, bit 0) enables the LG_thres criteria to generate an interrupt.
这个位(address 0Bh, bit 0)使LG_thres (low g 阈值) 准则产生一个中断。
3.2.2 Enable_HG:
This bit (address 0Bh, bit 1) enables the HG_thres criteria to generate an interrupt.
这位(address 0Bh, bit 1)使HG_thres(high g 阈值)准则产生一个中断。
3.2.3 Enable_adv_INT:
This bit (address 15h, bit 6) is used to disable advanced interrupt control bits (any_motion, alert).If enable_adv_INT=0, writing to these bits has no effect on sensor IC function.
这个位(address 15h, bit 6)是用来屏蔽高级中断控制位( any_motion ,alert)。如果enable_adv_INT = 0 ,写这些位( any_motion ,alert)不会改变传感器IC的功能。
3.2.4 Any_motion:
This bit ((address 0Bh, bit 6)enables the any motion criteria to generate directly an interrupt. It can not be turned on simultaneously with alert. This bit can be masked by enable_ adv_INT, the value of this bit is ignored when enable_adv_INT=0 (section 3.2.3)
这个位(address 0Bh, bit 6)使any_motion准则产生直接中断。它不能和alert位同时打开。这一位的值可以被enable_ adv_INT位屏蔽。当enable_adv_INT = 0时,这一位的值被忽视。(section 3.2.3)
3.2.5 Alert:
If this bit (address 0Bh, bit 7) is at 1, the any_motion criterion will set SMB380 into alert mode (section 3.2.9). This bit can be masked by enable_adv_INT, the value of this bit is ignored when enable_adv_INT=0 (section 3.2.3)
如果此位(address 0Bh, bit 7 )是1 , any_motion准则将使SMB380进入警戒模式(注意此模式有什么功能?)。(section 3.2.9)这一位的值可以被enable_ adv_INT位屏蔽。当enable_adv_INT = 0时这一位的值被忽视。(section 3.2.3)
3.2.6 Latch_INT:
If this bit (address 15h, bit 4) is at 1, interrupts are latched. The INT pad stays high until microprocessor detects it and writes reset_INT control bit to 1 (section 3.3.1). When this bit is at 0, interrupts are set and reset directly by SMB380 according to programmable criteria (sections 3.2.7 and 3.2.8).
如果此位(address 15h, bit 4 )为1 ,中断锁存。INT位中断缓冲器保持高电平,直到微处理器检测到它并写reset_INT控制位为1 (section 3.3.1). 当此位是0 ,中断可以由事先编好程序的SMB380直接设置或者复位。(sections 3.2.7 and 3.2.8,LG_中断和HG_中断一般都不是锁存的中断,而new_data_INT默认为锁存的中断!).
3.2.7 LG_thres, LG_hyst, LG_dur, counter_LG
LG_thres (address 0C, bits 7-0 / low-g threshold) and LG_hyst (address 11h, bits 2-0 / low-g threshold hysteresis) are used to detect a free fall. The threshold and duration codes define one criterion for interrupt generation when absolute value of acceleration is low for long enough duration.
LG_thres (地址0C ,位7-0 /低-g阈值)和LG_hyst (address 11h, bits 2-0 / low-g 阈值迟滞)是用来探测自由落体运动。阈值(LG_thres)和时间码(LG_dur)定义了一个中断是否产生的准则,这个准则就是当(被采样的)加速度(所发生的时间)低于足够长的持续时间时,中断是否产生。我认为是: (在足够长的时间内,加速度绝对值低于一定阈值并保持足够长时间时)。
Data format is unsigned integer.
数据格式是无符号整数。
LG_thres criterion_x is true if |acc_x | ≤ LG_thres / 255 * range
LG_thres interrupt is set if (LG_thres criterion_x AND LG_thres criterion_y AND LG_thres criterion_z) AND interrupt counter = (LG_dur+1)
LG_thres criterion_x is false if |acc_x | > (LG_thres + 32*LG_hyst) / 255 * range
LG_thres interrupt is reset if NOT(LG_thres criterion_x AND LG_thres criterion_y AND LG_thres criterion_z)
LG_thres criterion_x是真的,如果 | acc_x | ≤ LG_thres / 255 *range。
LG_thres 中断(位)被设置,if ( LG_thres criterion_x AND LG_thres criterion_y AND LG_thres criterion_z ) AND 中断计数器= ( LG_dur +1 )
LG_thres criterion_x 是false if |acc_x | > (LG_thres + 32*LG_hyst) / 255 * range
LG_thres 中断被重置if NOT(LG_thres criterion_x AND LG_thres criterion_y AND LG_thres criterion_z)
LG_thres and LG_hyst codes must be chosen to have (LG_thres + 32*LG_hyst) < 511.
LG_thres和LG_hyst的码必须被挑选以使( LG_thres + 32 * LG_hyst )<511 。
When LG_thres criterion becomes active, an interrupt counter is incremented by 1 LSB/ms. When the low-g interrupt counter value equals (LG_dur+1), an interrupt is generated. Depending on counter_LG (address 0Bh, bit 3 and 2) register, the counter could also be reset or count down when LG_thres criterion is false.
当LG_thres准则在起作用时(处于激活状态时),中断计数器以1个LSB /ms递增。 当low-g中断计数器的值等于( LG_dur +1 ) ,产生一个中断。依靠counter_LG(address 0Bh, bit 3 and 2)寄存器,当LG_thres是false时。计数器也可以重置或倒计时。
Rev. 1.0 Page 12
Table 6: Description of debouncing counter counter_LG
表6 :去抖计数器counter_LG 的说明
counter_LG <1:0>
low acceleration interrupt counter status when
LG_thres criteria is false
当LG_thres是false时,低加速中断计数器的情况
00
Reset(重置)
01
Count down倒计时 by 1 LSB/ms
10
Count down倒计时 by 2 LSB/ms
11
Count down倒计时 by 3 LSB/ms
If latch_INT=0, the interrupt is not a latched interrupt and then it is reset as soon as LG_thres criteria becomes false. When interrupt occurs, the interrupt counter is reset.
如果latch_INT = 0 ,这个中断不是一个锁存的中断,然后这个(中断)会在LG_thres 变成false后马上重新设置。当中断发生时,中断计数器复位。
The LG_thres criteria is set with an AND condition on all three axes to be used for free fall detection
在所有三个轴用于自由落体的检测中,LG_thres是用AND(条件)来设置的。
3.2.8 HG_thres, HG_hyst, HG_dur, counter_HG
HG_thres (address 0Eh, bits 7-0 / high-g threshold) and HG_hyst (address 11h, bits 5-3 / high-g threshold hysteresis) define the high-G level and its associated hysteresis. HG_dur (high-g threshold qualification duration) and counter_HG (address 0Bh, bits 5 and 4 / high-g counter down register) are used for debouncing the high-g criteria.
HG_thres (address 0Eh, bits 7-0 / high-g 阈值)和HG_hyst (address 11h, bits 5-3 / high-g threshold hysteresis 阈值滞后)规定了high-G强度及其相关的滞后范围。 HG_dur (high-G 阈值限定持续时间)和counter_HG (address 0Bh, bits 5 and 4 / high-g 计数器)用来为high-g 准则去抖. {注意:HG_thres 和HG_hyst都是设定的数值,HG_thres最大为255(例如:HG_thres设为1011 0100时对应数值为180,则由HG_thres / 255 * range公式,当range=2时,可得HG_thres=1.4g),HG_hyst最大值为7,HG_dur是设定的时间码,最大为255ms。}
Threshold and duration codes define a criterion for interrupt generation when absolute value of acceleration is high for long enough duration.
阈值和持续时间码定义了一个中断是否产生的准则,这个准则就是当(被采样的)加速度绝对值(所发生的时间)高于足够长的持续时间时,中断是否产生。
The data format is unsigned integer.
数据格式是无符号整数。
HG_threshold criterion_x is true if |acc_x | ≥ HG_thres / 255 * range
HG_threshold interrupt is set if (HG_thres criterion_x OR HG_thres criterion_y OR
HG_thres criterion_z) AND interrupt counter = (HG_dur+1)
HG_threshold criterion_x is false if |acc_x | < (HG_thres - 32*HG_hyst) / 255 * range
HG_threshold interrupt is reset if NOT(HG_thres criterion_x OR HG_thres criterion_y ORHG_thres criterion_z)
HG_thres and HG_hyst codes must be chosen to have (HG_thres - 32*HG_hyst) > 0.
HG_thres和HG_hyst的码必须被挑选以使(HG_thres - 32*HG_hyst) > 0.。
When HG_thres criterion becomes active, a counter is incremented by 1 LSB/ms. When the high-g acceleration interrupt counter value equals (HG_dur+1), an interrupt is generated. Depending on counter_HG register value, the counter could also be reset or count down when HG_thres criterion is false.
当HG_thres准则在起作用时(处于激活状态时),中断计数器以1个LSB /ms递增。 当high-g加速度中断计数器的值等于( HG_dur +1 ),产生一个中断。依靠counter_HG寄存器,计数器也可以重置或倒计时,当HG_thres是false时。
Rev. 1.0 Page 13
Table 7: Description of debouncing counter_HG
表7 : 去抖计数器counter_LG 的说明
counter_HG<1:0>
High acceleration interrupt counter status when HG_thres criterion is false
当HG_thres是false时,高加速度中断计数器的状况
00
reset
01
Count down倒计时 by 1 LSB/ms
10
Count down倒计时 by 2 LSB/ms
11
Count down倒计时 by 3 LSB/ms
If latch_INT=0, the interrupt is not a latched interrupt and then it is reset as soon as HG_thres criterion becomes false. When interrupt occurs, the interrupt counter is reset.
如果latch_INT = 0 ,这个中断不是一个锁存的中断,然后这个(中断)会在HG_thres 变成false后马上重新设置。当中断发生时,中断计数器复位。
以下是一个计步有效地判断:
3.2.9 Any_motion_thres, any_motion_dur
For the evaluation using “any motion” criterion successive acceleration data from digital filter output are stored and moving differences for all axes are built. To calculate the difference the acceleration values of all axes at time t0 are compared to values at t0+3/(2*bandwidth). The difference of both values is equal to the difference of two successive moving averages (from three data points).
3.2.9 Any_motion_thres, any_motion_dur
为了评价使用“any motion”规则,来自数字滤波器的连续的加速度数据被存储,而且所有轴方向的运动差异被建立(怎样建立的???这种差异是三轴的矢量和么?)。为了计算这个差异,t0时刻所有轴方向上的加速度和t0+3/(2*bandwidth)时刻的加速度相比较。两个值之间的差异等于两个连续移动的平均值(从三个数据点)之间的差异。
The differential value is compared to a global critical threshold any_motion_thres (address 10h, bits 7-0). Interrupt can be generated when the absolute value of measured difference is higher than the programmed threshold for long enough duration defined by any_motion_dur (address 11h, bits 7 and 6).
微分值(这种差异的值)是和全局临界阈值any_motion_thres (address 10h, bits 7-0)相比较。当测量误差的(差异的值)绝对值高于预设的阈值且保持时间足够长(此时间)由any_motion_dur定义(address 11h, bits 7 and 6))则中断能够产生。
Any_motion_thres and any_motion_dur data are unsigned integer. Any_motion_thres LSB size corresponds to 15.6mg for +/- 2g range and scales with range selection (section 3.1.2).
Any_motion_thres和any_motion_dur数据是无符号整数。Any_motion_thres LSB的大小为15.6mg (对于)+ / - 2g的范围。而且由量程选择开关来界定。(也就说1LSB大小代表15.6mg的加速度值,例如Any_motion_thres最大值设为1111 1111即255,则255*15.6mg=3.978g=4g=+ / - 2g的范围)。
Any_motion criterion is valid if |acc(t0)-acc(t0+3/(2*bandwidth))| ≥ any_motion_thres.
An interrupt is set if (any motion criterion_x OR any motion criterion_y OR any
motion criterion_z) for any_motion_dur consecutive times.
The any_motion interrupt is reset if NOT(any_motion criterion_x OR any_motion criterion_y OR any_motion criterion_z) for any_motion_dur consecutive times.
Any_motion criterion在当if |acc(t0)-acc(t0+3/(2*bandwidth))| ≥ any_motion_thres时有效。
中断发生(该中断位置1)当if (any_motion criterion_x OR any_motion criterion_y OR any_
motion criterion_z) for any_motion_dur连续的时间。
any_motion interrupt位置0 if NOT(any_motion criterion_x OR any_motion criterion_y OR any_motion criterion_z)
for any_motion_dur连续的时间
Table 8: any_motion_dur settings
表8 : any_motion_dur的设置
any_motion_dur<1:0>
Number of required consecutive conditions
to set or reset the any_motion interrupt
设置或重置any_motion中断位 的(连续条件的个数需求(单位是ms)??)一些必须的数字
00
1
01
3
10
5
11
7
Rev. 1.0 Page 14
Any_motion_dur is used to filter the motion profile and also to define a minimum interrupt duration because the reset condition is also filtered.
Any_motion_dur是用来筛选运动轮廓,也用来确定中断最小持续时间,因为它的复位状态也是滤波的。(???)
Any_motion_thres can be used to generate an any_motion interrupt or to put SMB380 in alert mode to preload the low-g or high-g threshold logic (enables reduction of reaction time in tumbling mode); this is selected by alert bit (section 3.2.5). These two modes (any_motion and alert) can not be turned on simultaneously.
Any_motion_thres可用于产生一个any_motion中断或把SMB380设置在alert模式中以便于预设low-g或者high-g阈值(可以减少在翻滚模式时的反应时间)。这是被alert位选择的。这两种方式( any_motion和alert)不能同时开启。
Figure 2: Any motion criterion (middle graph) is determined from digital filter output (upper graph) and depends on bandwidth settings: for example for any_motion_dur=01b and bandwidth=110b (1.5kHz), we have 2*bandwidth=3ksamples/s which leads to reaction for interrupt activation of 3*333μs = 1ms and a minimum any motion interrupt duration of 3*333us = 1ms (see lower graph).
图2 :Any_motion规则(中图)被(来至)数字滤波器的输出(的加速度值)(上图)所检测,并取决于带宽设置:例如any_motion_dur = 01b(是指数字3么?)和bandwidth= 110b(1.5kHz),我们有2*bandwidth=3ksamples/s(能否理解为采样频率是3KHz?每个采样点时间333μs),从而导致中断持续时间为3 * 333μs = 1ms,并且最低限度的any motion中断为期3*333us =1ms(见低图)(我认为这句翻译应是:中断激活的反应时间为3 * 333μs = 1ms并且any motion中断的最小持续时间为期3*333us =1ms ) (其中的3是否就是01b设置的参数?)。
此段翻译略……
Rev. 1.0 Page 15
3.2.10 New_data_int
If this bit (address 15h, bit 5) is set to 1, an interrupt will be generated when all three axes acceleration values are new, i.e. SMB380 updated all acceleration values after latest serial read-out. Interrupt generated from new data detection is a latched one; microcontroller has to write reset_INT at 1 after interrupt has been detected high (section 3.3.1). This interrupt is also reset by any acceleration byte read procedure (read access to address 02h to 07h) .New data interrupt always occurs at the end of the Z-axis value update in the output register. Following figure shows two examples of X-axis read out and the corresponding interrupt generation.
如果此位(address 15h, bit 5)设置为1 ,当所有方向的加速度值是新的时,将会产生中断。即SMB380在最新的串行(数据)读取后,更新加速度值。因为新的数据检测而产生的中断是锁存的;微控制器会马上把reset_INT设为1,在中断置高后( 3.3.1节) 。这个中断也会被any acceleration位的read程序重置(读接口地址从02h到07h)。
新数据中断,总是发生在更新输出寄存器上Z轴值的最后时刻。以下图片展示了读X轴数据和产生相应的中断的两个例子。
Figure 3: Explanation of new data interrupt.
图3 :解读新的数据中断。
left side - read out command of x-axis prior to next x-axis conversion → new data interrupt after completion of current conversion cycle after z-axis conversion
right side - read out of x-axis send after x-axis conversion → new data interrupt at the end of next period when x axis updated
左边-前一个X轴值的读取程序(此值为在下一个x轴的值变化之前的值)→此值为(在目前的转换周期完成后,在Z轴(数据)变换之后)新的数据中断(所传来的值)
右边-读取X轴值(1),在下一个x轴的值(2)变化之前传出→值(2)为(当x轴下一个数据更新周期结束时,新的数据中断所传来的值)
Rev. 1.0 Page 15
3.3CONTROL REGISTERS
控制寄存器
All single control bits are active at 1.
所有的单个的控制位设为1 。
3.3.1 Reset_INT
This interrupt (address 0Ah, bit 6) is reset (interrupt pad goes to low) each time this bit is written to 1.
这个中断(地址0Ah ,位6 )每次被清零(中断缓冲器设为低电平)时,这个位被写1。
3.3.2 Updat
展开阅读全文