Sensors Knowledge Base

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Sensors Knowledge Base

Discussions

Sort by:
Hi Everyone, As I am often asked for a simple bare metal example code illustrating the use of the accelerometer vector-magnitude function, I have decided to share here one of my examples I created for the FXLS8471Q accelerometer while working with the Freescale FRDM-KL25Z platform and FRDM-FXS-MULT2-B sensor expansion board. This example code complements the Python code snippet from the AN4692. The FXLS8471Q is set for detection of a change in tilt angle exceeding 17.25° from the horizontal plane. Once an event is triggered, an interrupt will be generated on the INT1 pin: void FXLS8471Q_Init (void) {      FXLS8471Q_WriteRegister(A_VECM_THS_MSB_REG, 0x84);            // Threshold value set to 300mg or ~17.25°    FXLS8471Q_WriteRegister(A_VECM_THS_LSB_REG, 0xCC);          FXLS8471Q_WriteRegister(A_VECM_CNT_REG, 0x01);                // Debounce timer period set to 80ms          FXLS8471Q_WriteRegister(A_VECM_INITX_MSB_REG, 0x00);    FXLS8471Q_WriteRegister(A_VECM_INITX_LSB_REG, 0x00);    FXLS8471Q_WriteRegister(A_VECM_INITY_MSB_REG, 0x00);    FXLS8471Q_WriteRegister(A_VECM_INITY_LSB_REG, 0x00);    FXLS8471Q_WriteRegister(A_VECM_INITZ_MSB_REG, 0x10);          // Set Z-axis to 1g  as a reference value    FXLS8471Q_WriteRegister(A_VECM_INITZ_LSB_REG, 0x00);          FXLS8471Q_WriteRegister(A_VECM_CFG_REG, 0x78);                // Event latch enabled, A_VECM_INITX/Y/Z used as initial reference, acceleration vector-magnitude detection feature enabled          FXLS8471Q_WriteRegister(CTRL_REG4, 0x02);                     // Acceleration vector-magnitude interrupt enabled    FXLS8471Q_WriteRegister(CTRL_REG5, 0x02);                     // Acceleration vector-magnitude interrupt routed to INT1 - PTA5          FXLS8471Q_WriteRegister(CTRL_REG1, 0x29);                     // ODR = 12.5Hz, Active mode } In the ISR, only the interrupt flag is cleared and the  INT_SOURCE (0x0C) register is read in order to clear the SRC_A_VECM status bit and deassert the INT1 pin, as shown on the screenshot below. void PORTA_IRQHandler() {    PORTA_PCR5 |= PORT_PCR_ISF_MASK;                              // Clear the interrupt flag    IntSource = FXLS8471Q_ReadRegister(INT_SOURCE_REG);           // Read the INT_SOURCE register to clear the SRC_A_VECM bit   } Attached you can find the complete source code. If there are any questions regarding this simple example code, please feel free to ask below. Your feedback or suggestions are also welcome. Regards, Tomas
View full article
The MMA845xQ is a smart low-power, three-axis capacitive micromachined accelerometer up to 14 bits of resolution. This accelerometer is packed with embedded functions with flexible user-programmable options, configurable to two interrupt pins. Embedded interrupt functions allow for overall power savings relieving the host processor from continuously polling data. There is access to both low-pass filtered data as well as high-pass filtered data, which minimizes the data analysis required for jolt detection and faster transitions. The device can be configured to generate inertial wake-up interrupt signals from any combination of the configurable embedded functions allowing the MMA845xQ to monitor events and remain in a low-power mode during periods of inactivity. Here is a Render of the MMA845x Breakout- Board downloaded from OSH Park: And here is an image of the Layout Design for this board: In the Attachments section, you can find the Schematic Source File (.SCH), Schematic PDF File, Layout Source File (BRD), Gerber Files (GTL, GBL, GTS, GBS, GTO, GBO, GKO, XLN) and BOM for this Breakout-board. If you are interested in more designs like this breakout board for other sensors, please go to Freescale Sensors Breakout Boards Designs – HOME
View full article
Hi Everyone,   If you are interested in a simple bare metal example code illustrating the use of the FXLS8471Q orientation detection function, please find below one of my examples I created for the FXLS8471Q accelerometer while working with the NXP FRDM-KL25Z platform and FRDMSTBC-A8471 board.   This example code complements the code snippet from the  AN4068.   void FXLS8471Q_Init (void) { FXLS8471Q_WriteRegister(CTRL_REG1, 0x00); // Standby mode FXLS8471Q_WriteRegister(PL_CFG_REG, 0x40); // Enable orientation detection FXLS8471Q_WriteRegister(PL_BF_ZCOMP_REG, 0x43); // Back/Front trip point set to 75°, Z-lockout angle set to 25° FXLS8471Q_WriteRegister(P_L_THS_REG, 0x14); // Threshold angle = 45°, hysteresis = 14° FXLS8471Q_WriteRegister(PL_COUNT_REG, 0x05); // Debounce counter set to 100ms at 50Hz FXLS8471Q_WriteRegister(CTRL_REG3, 0x00); // Push-pull, active low interrupt FXLS8471Q_WriteRegister(CTRL_REG4, 0x10); // Orientation interrupt enabled FXLS8471Q_WriteRegister(CTRL_REG5, 0x10); // Route orientation interrupt to INT1 - PTD4 FXLS8471Q_WriteRegister(CTRL_REG1, 0x21); // ODR = 50Hz, Active mode }‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍     In the ISR, only the interrupt flag is cleared and the PL_STATUS (0x10) register is read in order to:   - Clear the SRC_LNDPRT flag in the INT_SOURCE register and deassert the INT1 pin, as shown on the screenshot below. - Get orientation information. 0x82 in this example corresponds to "Portrait down" orientation.   void PORTD_IRQHandler() { PORTD_PCR4 |= PORT_PCR_ISF_MASK; // Clear the interrupt flag PL_Status = FXLS8471Q_ReadRegister(PL_STATUS_REG); // Read the PL_STATUS register to clear the SRC_LNDPRT flag in the INT_SOURCE register }‍‍‍‍‍‍‍‍‍‍       Attached you can find the complete source code. If there are any questions regarding this simple example code, please feel free to ask below.    Regards, Tomas
View full article
The FXLN83XX is a 3-axis, low-power, low-g accelerometer along with a CMOS signal conditioning and control ASIC in a small 3 x 3 x 1 mm QFN package. The analog outputs for the X, Y, and Z axes are internally compensated for zero-g offset and sensitivity, and then buffered to the output pads. The outputs have a fixed 0 g offset of 0.75 V, irrespective of the VDD supply voltage. The bandwidth of the output signal for each axis may be independently set using external capacitors. The host can place the FXLN83XXQ into a low-current shutdown mode to conserve power. Here is a Render of the FXLN83XX Breakout Board downloaded from OSH park: Layout Design for this board: In the attachments section, you can find the Schematic Source File (SCH), Schematic PDF File, Layout Source File (BRD), Gerber Files (GTL, GBL, GTS, GBS, GTO, GBO, GKO, XLN) and BOM files.    If you're interested in more designs like this breakout board for other sensors, please go to Freescale Sensors Breakout Boards Designs – HOMEFreescale Sensors Breakout Boards Designs – HOME
View full article
Hi, The MMA865x, 3-axis, 10-bit/12-bit accelerometer that has industry leading performance in a small 2 x 2 x 1 mm DFN package. This accelerometer is packed with embedded functions that include flexible user-programmable options and two configurable interrupt pins. Overall power savings is achieved through inertial wake-up interrupt signals that monitor events and remain in a low-power mode during periods of inactivity. Here is a Render of the MMA865x Breakout- Board downloaded from OSH park: Layout Design for this board: In the attachments section, you can find the Schematic Source File (SCH), Schematic PDF File, Layout Source File (BRD), Gerber Files (GTL, GBL, GTS, GBS, GTO, GBO, GKO, XLN) and BOM files. If you're interested in more designs like this breakout board for other sensors, please go to Freescale Sensors Breakout Boards Designs – HOME
View full article
The MMA8491Q is a low voltage, 3-axis low-g accelerometer housed in a 3 mm x 3 mm QFN package. The device can accommodate two accelerometer configurations, acting as either a 45° tilt sensor or a digital output accelerometer with I2C bus.      • As a 45° Tilt Sensor, the MMA8491Q device offers extreme ease of implementation by using a single line output per axis.      • As a digital output accelerometer, the 14-bit ±8g accelerometer data can be read from the device with a 1 mg/LSB sensitivity. The extreme low power capabilities of the MMA8491Q will reduce the low data rate current consumption to less than 400 nA per Hz. Here is a Render of the MMA8491 Breakout Board downloaded from OSH park: Layout Design for this board: If you're interested in more designs like this breakout board for other sensors, please go to Freescale Sensors Breakout Boards Designs – HOME
View full article
This is the 9 December 2014 build of Vibration Monitoring program written by Mark Pedley in the Sensors Solutions Division systems/algorithms team.  It is compatible with Freescale FRDM-KL25Z/KL26Z/KL46Z/K64F Freedom development platforms.  You can flash your board using the File->Flash pull-down menu.    The application contains an option for controlling motor bias and feedback via optional motor control shield to be discussed in an upcoming Freescale blog.  Use the View->Motor Controls pull-down to enable those functions.
View full article
Hi Everyone, In my previous tutorial, I demonstrated how to import an ISSDK based example project into MCUXpresso IDE, build and run it on the Freedom board (FRDM-KL27Z). If you want to visualize/log sensor data, easily change sensor settings (ODR, Range, Power Mode) or directly read and write sensor registers, you can use the Freedom Sensor Toolbox-Community Edition (STB-CE) as described below or in the STBCEUG. 1. Connect the SDA port (J13) on the FRDM-KL27Z board to a USB port on your computer. 2. Open STB-CE GUI by double clicking the Freedom Sensor Toolbox (CE) shortcut located on your desktop. 3. Select "Out of Box Sensor Demonstration". 4. Select the Project to be launched and click on Continue. Base Board Name – FRDM-KL27Z Shield Board Name – OnBoard Project Name – MMA8451 Accelerometer Demo 5. The ISSDK-based MMA8451 Accelerometer Demo firmware is loaded to the KL27Z MCU and the MMA8451 Accelerometer Demo v1.0 GUI launched. 6. In the Main screen you can change basic MMA8451Q accelerometer settings (ODR, Range, Power Mode), enable embedded functions (Landsacpe/Portrait, Pulse/Tap, Freefall, Transient), start/stop accelerometer data streaming and/or logging.   7. The Register screen (MMA8451) provides low-level access (R/W) to the MMA8451Q registers along with a detailed description of the selected register. 8. To change the bit value, simply click on the corresponding cell (make sure you selected the Standby mode before writing a new value to the selected register). I hope you find this simple document useful. f there are any questions, please feel free to ask below.  Regards, Tomas
View full article
The MMA690x, a SafeAssure solution, is a dual axis, Low g, XY, Sensorbased on Freescale’s HARMEMS technology, with an embedded DSP ASIC, allowing for additional processing of the digital signals. Here is a Render of the MMA690x Breakout Board downloaded from OSH park: Layout Design for this board: In the attachments section, you can find the Schematic Source File (SCH), Schematic PDF File, Layout Source File (BRD), Gerber Files (GTL, GBL, GTS, GBS, GTO, GBO, GKO, XLN) and BOM files.   If you're interested in more designs like this breakout board for other sensors, please go to Freescale Sensors Breakout Boards Designs – HOME
View full article
My friend Matt Muddiman of Freescale gave this presentation as part of the MEMS Education Series (hosted by Arizona Technology Council and MEMS Industry Group) in Scottsdale Arizona earlier this week.
View full article
The following video shows how to run the FRDM 6DOF Bare Board eCompass using the FRDM-K22. This algorithm uses the FXOS8700 contained on the Freedom Board. In order to get more information about the Sensor Fusion Library for Kinetis MCU's 5.0, please refer to the following link: Sensor Fusion|Freescale I hope this material will be useful for you. David
View full article
Here is the Installer file for the revision 4.2.0.8 of the Sensor Toolbox GUI
View full article
The attached is a copy of a presentation given 24 June 2014 at the Sensors Expo Conference in Rosemont IL.
View full article
"Android as a Platform for Sensor Fusion Education and Evaluation" presented at 2013 Sensors Expo & Conference by Michael Stanley.
View full article
Video clip associated with "Android as a Platform for Sensor Fusion Education and Evaluation" presented at 2013 Sensors Expo & Conference by Michael Stanley.
View full article
Session Overview Session Details Sensors Development Ecosystem   Session Hands-on Prerequisites SW prerequisites: Install required SW and tools Download following SDK, IDE and tools: 1. MCUXpresso IDE v11.9.0 or newer 2. MCUXpresso SDK v2.14.0 for FRDM-MCXN947 (while generating SDK select ISSDK and FreeMASTER middleware) 3. FreeMASTER Tool v3.2 or newer: FreeMaster Run-time Debugging tool   HW prerequisites: HW Setup and Connection  1. Know the HWs for Hands-On Training:  2. Connect HWs to get ready for Hands-On Session: Special Instructions: Attendees to bring their own Windows Laptop for hands-on training. Attendees are requested to follow this guide and come prepared with Pre-requisite SW installed on their windows laptops. Hands-on training material and boards (“FRDM-MCXN947” and “Accel 4 Click” boards) will be provided for training purpose only.        
View full article
FXLS93xxx 是NXP针对底盘安全领域的PSI5接口的加速度传感器。FXPS7140xxxx 是NXP针对气囊中侧碰,行人保护等应用推出的PSI5接口的压力传感器。   FXLS93xxx内部集成了OTP, One-Time-Programmable Memory (一次性烧写,不支持客户重复烧写),这种OTP Memory 分为NXP工厂烧写部分(Type是F),客户可读,和客户可烧写部分(UF0, UF1 & UF2). 支持客户烧写的范围是UF0($E0-EE), UF1($F0-FF) & UF2($16-5E) 的区间。芯片内还有部分寄存器是客户可读的和 可读可写的寄存器(非OTP的,写的内容会随下电后重新上电后消失,可以理解为RAM)。 未经烧写OTP的芯片会工作在默认模式PSI5-P16C-500/2L,FXLS93xx0(单轴)加速度数据会在Time slot 1发送,FXLS93xxx(双轴)加速度数据,Ch0数据会在Time slot 1发送,Ch1数据会在Time slot 2发送。 OTP programming 烧写流程     进入烧程模式PME(Programming Mode Entry)的时序 上电后delay(tRS_PM) 6ms     发至少31个同步头,同步头的时间周期必须满足 245-255us   发PME command 注:上电后6ms+127ms中如果没有收到PME command, 则退出PM Entry.       烧写电压Vpp 电压9-11V是指BUS_I/VCC pin上电压   依据寄存器配置内容,写寄存器,寄存器默认值为0x00,如配置内容是默认值,则不需要写 寄存器配置内容写好后, 写0x80到WRITE_OTP_EN($11) 烧写UF0, delay 10ms 烧写完成 写0x81到WRITE_OTP_EN($11) 烧写UF1, delay 10ms 烧写完成 写0x8E(跳过COMMTYPE和PHYSADDR寄存器烧写)到WRITE_OTP_EN($11) 烧写UF2, delay 10ms 烧写完成   验证步骤: 读回烧写过的寄存器,确保烧写内容是否正确 读DEVSTAT和DEVSTAT2 寄存器,判断是否在烧写过程中有错误产生。 烧写UF1,UF2后,做Margin read, 判断烧写深度是否足够   烧写注意事项: OTP烧写中常出现的问题主要是烧写深度不足。失效现象是通过PSI5总线收到传感器错误代码,10-bit 500 即0x1F4, 16-bit 32000 即 0x7D00(PSI5_CFG寄存器中 EMSG_EXT = 0),10-bit 491 即0x1EB, 16-bit 31424 即 0x7AC0(PSI5_CFG寄存器中 EMSG_EXT = 1)错误码可能是会在传感器放置或者工作后一段时间,如几天,几个月或更长时间后产生,所以如发生该问题容易导致客户端失效。目前已知原因是: 烧写电压VPP不够: Datasheet中Vpp 电压9-11V是指BUS_I/VCC pin上电压,要考虑串联电阻和线束的压降,确保烧写OTP过程中,BUS_I pin电压稳定在这个范围内 烧写时间不足,写WRITE_OTP_EN后的延时必须大于10ms, 以保证烧写完成(这里写的OTP Program Timing 最大值10ms是每颗芯片需要烧写的时间有区别,但芯片最大的烧写时间是10ms, 所以烧写时间需要大于10ms以确保每颗芯片都烧写深度足够。)     为确保该问题不发生,请确保前面的两点已经满足,并且推荐烧写UF1,UF2后,做Margin read, 判断烧写深度是否足够。并将所有烧写后寄存器读回,判断烧写内容是否正确。 还要注意进入烧写模式(PME)后,请勿热插拔FXLS93xxx 芯片或模块, 以避免芯片损坏。   烧写工具: 很多客户除了做PSI5传感器, 还在做含有PSI5接口的ECU. 所以我们的文档可以支持客户自己开发PSI5 OTP烧写工具。(NXP 没有烧写工具的解决方案) 购买Seskion的 PSI5 Simulyzer进行烧写 Seskion PSI5-Simulyzer – Measuring, Analyzing, Simulating 下面是介绍如何通过Seskion PSI5 Simulyzer 进行快速烧写     Seskion configuration Once the script is generated from the NXP script generator tool you will need to load it on the PSI5 Simulyzer from Seskion by going into Tools-> ECU Pattern Editor -> Channel 0 -> Load -> Select generated script file. Make sure that “Use for Sensor Init” is ticked , see below snapshot.                 Below an example of a script generated by the Seskion Script generation tool :           The 2 first “0” are trimmed out by the defined number of bit set to 0x2A = 42. Note : Once the script file are loaded to the PSI5-Simulizer from Seskion the “00” from 00b32ba623e are not shown and what will be displayed is b32ba623e. However since the number of bit is 0x2A = 42 the 5x ‘0’ are automatically appended at the beginning of the command.         If the programming using the PSI5 Simulyzer from Seskion is not working there few things to consider for debug : Make Sure that the bit distance in bidirectional communication is set to 250us as specified in sensor product specification.     Make sure that Init Phase1 timing is set to 6.     If device respond to PSI5 programming command but the configuration is not getting written into OTP, please make sure that the applied voltage level is within product specification 9-11V at BUS_I pin. So please include potential voltage drop cause by any potential resistor connected on BUS_I/VCC pin.   烧写过程,一定是先点RUN, 然后再点Power ,烧写完成后sensor一直发送0x1e1, 就代表烧写成功了      
View full article
clicktaleID