Multi Source Translation Content

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

Multi Source Translation Content

Discussions

Sort by:
[MCX A153] GPIO Beginner's Guide (Japanese Blog) This article explains the basic concepts of GPIO ( General Purpose Input / Output ) on the MCX A153 . It also explains how to implement software using the MCUXpresso SDK , based on the FRDM-MCXA153 board, for engineers new to NXP products. First, an overview of the hardware is provided, followed by an explanation of how to use the MCUXpresso SDK, along with code snippets. (Reading time: 20 minutes) 1. Overview of the GPIO module   1.1 Role of GPIO GPIO is the most basic interface for controlling microcontroller pins as either "inputs" or "outputs". For example, in the FRDM-MCXA153 , the three RGB LEDs are wired to the following GPIOs , so it is possible to switch the LEDs ON/OFF by controlling the GPIOs. Red : P3_12 Green : P3_13 Blue : P3_0 1.2 Pin control function in MCX A153 In the MCX A153 , pin control functions are managed by the following two modules: (1) PORT module It primarily serves the following roles. Since one pin has multiple functions, PORT configuration is required to use it as a GPIO. Pin function selection ( GPIO / UART / SPI / I2C / PWM , etc. ) Pull-up / Pull-down settings Drive capability settings   (2) GPIO module It primarily serves the following roles: Input/Output Data Control High/Low output of the pin Reading the input state " PORT = pin configuration" and " GPIO = actual input/output operation," and so on.   2. Basic operation of GPIO GPIO modules have output and input modes, and the following operations are possible with each mode: (1) Output mode The following processes are possible: High output Low output Toggle (inverts the current output) (2) Input mode The following processes are possible: Read the pin voltage status (High or Low) Interrupt detection (rising / falling edge)   3. Basic Flow of SDK Drivers   To use GPIO, the following settings are required by the software. - Clock settings - Pin settings (PORT settings) - Input or output settings ( GPIO settings) - Interrupt settings (if necessary) This guide will demonstrate how to use the driver, using a sample project from the MCUXpresso SDK as an example.    3.1 Output Modes I will explain using the following project as an example. Reference URL: Hardware requirements — MCUXpresso SDK Documentation mcuxsdk-examples/driver_examples/gpio/led_output/gpio_led_output.c at main · nxp-mcuxpresso...   3.1.1Initialization First, initialize the clock, port, and GPIO for the red LED. #include "fsl_gpio.h" #include "fsl_port.h" // 赤色LEDに配線されたピンのパラメータ #define BOARD_INITPINS_LED_RED_PORT PORT3 #define BOARD_INITPINS_LED_RED_GPIO GPIO3 #define BOARD_INITPINS_LED_RED_PIN 12 void init_gpio(void) { // クロック有効化 CLOCK_EnableClock(kCLOCK_GateGPIO3); // PORT設定 const port_pin_config_t LED_RED = {/* Internal pull-up/down resistor is disabled */ kPORT_PullDisable, /* Low internal pull resistor value is selected. */ kPORT_LowPullResistor, /* Fast slew rate is configured */ kPORT_FastSlewRate, /* Passive input filter is disabled */ kPORT_PassiveFilterDisable, /* Open drain output is disabled */ kPORT_OpenDrainDisable, /* Low drive strength is configured */ kPORT_LowDriveStrength, /* Normal drive strength is configured */ kPORT_NormalDriveStrength, /* Pin is configured as P3_12 */ kPORT_MuxAlt0, /* Digital input enabled */ kPORT_InputBufferEnable, /* Digital input is not inverted */ kPORT_InputNormal, /* Pin Control Register fields [15:0] are not locked */ kPORT_UnlockRegister}; PORT_SetPinConfig(BOARD_INITPINS_LED_RED_PORT, BOARD_INITPINS_LED_RED_PIN, &LED_RED); // GPIO設定 gpio_pin_config_t LED_RED_config = { .pinDirection = kGPIO_DigitalOutput, .outputLogic = 0U }; GPIO_PinInit(BOARD_INITPINS_LED_RED_GPIO, BOARD_INITPINS_LED_RED_PIN, &LED_RED_config); }   3.1.2Output control ( LED on / off / toggle) The output values can be modified using the following API. GPIO_PinWrite(BOARD_INITPINS_LED_RED_PORT, BOARD_INITPINS_LED_RED_PIN, 1); // High GPIO_PinWrite(BOARD_INITPINS_LED_RED_PORT, BOARD_INITPINS_LED_RED_PIN, 0); // Low GPIO_PortToggle(BOARD_INITPINS_LED_RED_PORT, 1U << BOARD_INITPINS_LED_RED_PIN); // Toggle   3.2 Input Mode I will explain using the following project as an example. Reference URL: Hardware requirements — MCUXpresso SDK Documentation mcuxsdk-examples/driver_examples/gpio/input_interrupt/gpio_input_interrupt.c at main · nxp-mcuxpresso...   3.2.1 Initialization Since it's the same except for the output mode and arguments, I'll omit the details.   3.2.2Input reading The input values can be read using the following API. uint32_t value = GPIO_PinRead(BOARD_SW_GPIO, BOARD_SW_GPIO_PIN); if (value == 0) { // スイッチ押下(プルアップの場合) }   3.2.3Interrupt settings To set the falling edge signal as a GPIO interrupt, use the following API. EnableIRQ is the interrupt enable setting on the Cortex-M side. GPIO_SetPinInterruptConfig(BOARD_SW_GPIO, BOARD_SW_GPIO_PIN, kGPIO_InterruptFallingEdge); EnableIRQ(BOARD_SW_IRQ); Handling interrupts requires a function definition as an interrupt handler. If you don't clear the interrupt flag, the interrupt will continue to occur indefinitely, so be careful. void BOARD_SW_IRQ_HANDLER(void) { /* 割り込みフラグをクリア */ GPIO_GpioClearInterruptFlags(BOARD_SW_GPIO, 1U << BOARD_SW_GPIO_PIN); // 処理 SDK_ISR_EXIT_BARRIER; } The process leading up to an interrupt is shown below. The above explains how to use the GPIO driver with the MCUXpresso SDK.   4. Common pitfalls If you modify the source code and the GPIO doesn't work as expected, please check the following items. The pin is set to a different function → Check the PORT settings to see if the pin is assigned to GPIO. Clock not enabled → Check if CLOCK_EnableClock is being called. Incorrect pin number → Check if it matches the hardware pin number. GPIO interrupts are not being received → Check that interrupts are enabled on the Cortex-M side using EnableIRQ. GPIO interrupts are looping → Check if the interrupt flag has been cleared.   5. Summary   The GPIO pins on the MCX A153 operate in a two-stage configuration: pin configuration via the PORT module and input/output control via the GPIO module. Therefore, when using a pin as a GPIO, you must first configure the pin assignment settings in the PORT module and select the GPIO function. After that, you use the GPIO module to initialize it as an input or output and perform operations such as turning LEDs on and off or reading the state of switches. Using the MCUXpresso SDK, these settings and controls can be implemented concisely via the library API. Furthermore, by utilizing the GPIO interrupt function, it is possible to efficiently detect events such as switch presses. If the GPIO does not work as expected, check whether the PORT setting is enabled, whether the clock is enabled for the target PORT, and whether the pin number setting is correct.   ========================= We are currently unable to respond to comments left in the "Comment" section of this post. We apologize for the inconvenience, but please refer to " Technical Questions to NXP - How to Contact Us( Japanese Blog) " when making an inquiry. (If you are already an NXP distributor or have a relationship with NXP, you may ask your representative directly.) This article explains the basic concepts of GPIO ( General Purpose Input / Output ) on the MCX A153 . It also explains how to implement software using the MCUXpresso SDK , based on the FRDM-MCXA153 board, for engineers new to NXP products. First, an overview of the hardware is provided, followed by an explanation of how to use the MCUXpresso SDK, along with code snippets. (Reading time: 20 minutes) MCX Japanese Blog
View full article
OpenWrt upgrade for i.MX platforms is ready Processor and Board Support i.MX 8M Mini EVK i.MX 8M Nano EVK i.MX 8M Plus EVK i.MX 8M Quad EVK i.MX 91 EVK i.MX 93 EVK i.MX 93W EVK i.MX 95 15x15 EVK i.MX 95 19x19 EVK FRDM-IMX8MPLUS FRDM-IMX91 FRDM-IMX91S FRDM-IMX93 FRDM-IMX93W FRDM-IMX95 FRDM-IMX95-PRO OpenWrt and Toolchain OpenWrt from mainline (date: 29 Jun 2026, commit: f0a60eee2fe tag: v25.12.5) Toolchain:  ARMV8: GCC 14.3.0, GNU Binutils 2.44 U-Boot Bootloader i.MX SDK release, tag: lf-6.12.49-2.2.0 v2025.04 Linux Kernel OpenWrt kernel 6.12.94 based on IMX SDK release kernel lf-6.12.49-2.2.0 Firmware firmware-imx-8.30 Features Squashfs rootfs support on SD card. Support CLI and web configuration. U-Boot Boot Loader - U-Boot: lf-6.12.49-2.2.0. - Arm Trusted firmware (TF-A) integration. - Boot from SDHC Linux Kernel Core - Linux kernel 6.12.49 - Cortex-A53 (AARCH64), little endian for imx8m platforms - Cortex-A55 (AARCH64), little endian for imx9 platforms - 64-bit effective kernel addressing Linux Kernel Drivers - SDIO 3.0 / eMMC5.1 - USB 3.0/2.0 Dual-Role with PHY type C - 32-bit LPDDR4/LPDDR5 - 2x Gigabit Ethernet with AVB, IEEE 1588, EEE   and 1x w/ TSN - PCIe Gen 3 + WIFI - CAN FD - Dual-ch. QuadSPI (XIP) or 1x OctalSPI(XIP) - RTC - IW610/IW612 WiFi module - Bluetooth Licensing The majority of the software included in the OpenWrt release is licensed under a form of open source license (e.g. GPL, BSD). Some software is licensed under the NXP EULA license.  How to obtain this release The source code of the OpenWrt release can be got from the following link: https://github.com/nxp-imx/imx_openwrt   branch: imx-openwrt-25.12 tag: imx_v25.12_v6.12.49 The user guide can be found in the below link for build and deployment on IMX targets: https://github.com/nxp-imx/imx_openwrt/blob/imx-openwrt-25.12/target/linux/imx/README
View full article
Debugging_Bare_Metal_Code_in_NOR_Flash Scope This practical guide records the complete workflow used to build a ROM-target bare-metal image, program it into NOR flash, boot independently from NOR, and attach CodeWarrior with symbols for source-level debugging. Create the bare-metal project and confirm it works with the RAM/JTAG configuration. Create a ROM build configuration and link .intvec at 0xEFF00000 and .reset at 0xEFFFFFFC. Build the ELF. Generate the raw BIN from the same build. Create the Flash Programmer task using T1013RDB_NOR_FLASH.xml. Confirm the S29GL01GP flash range is 0xE8000000 to 0xEFFFFFFF. Configure the BIN destination as 0xEFF00000. Erase the selected sectors, program the image, and enable verification. Select NOR boot and power-cycle or reset the board. Confirm the program starts without JTAG downloading the image. Attach CodeWarrior to the running target. Load the exact matching ELF as symbols only. Confirm the Program Counter, set breakpoints, and begin source-level debugging.
View full article
MCX W72 Knowledge hub The MCX W72x family features a 96 MHz Arm® Cortex®-M33 core coupled with a multiprotocol radio subsystem supporting Matter, Thread, Zigbee and Bluetooth LE. The independent radio subsystem, with a dedicated core and memory, offloads the main CPU, preserving it for the primary application and allowing firmware updates to support future wireless standards. The MCX W72x also offers advanced security with an integrated EdgeLock® Secure Enclave Core Profile and will be supported by NXP's EdgeLock 2GO cloud services for credential sharing. The MCX W72x family includes Bluetooth Channel Sounding capabilities, with a dedicated on-chip Localization Compute Engine to reduce ranging latency. It incorporates additional memory to support application-specific code, connectivity stacks and over-the-air firmware updates. In addition, the radio subsystem can run the full Thread or Zigbee stack alongside the Bluetooth Low Energy stack. This delivers reliable wireless performance, as the real-time activities of the radio run on a separate core from the application. Building on NXP's strong history of providing industrial edge solutions, the MCX W series offers a wide operating temperature range from -40 °C to 125 °C and peripherals for industrial applications, including an optional CAN interface and will be part of NXP's 15-year Product Longevity program to support long-term industrial use. The MCX W series is supported by the MCUXpresso Developer Experience to optimize, ease and help accelerate embedded system development.   Security Certifications  PSA Certified Level 2 SESIP Level 2 Security Target  SESIP Level 2 KW47/MCXW72 SESIP certificate and ST are on TrustCB website Regulatory Certifications European Union Declaration of Conformity - FRDM MCXW72 MIC Radio Certificate - FRDM-MCXW72 European Union Declaration of Conformity - MCXW72-LOC MIC Radio Certificate - MCXW72-LOC Bluetooth Qualifications Qualified Products | Bluetooth® Technology Website Q360996: KW47 / MCX W72 Bluetooth LE 6.0 (Channel Sounding) Controller Q332147: KW47 / MCX W72 Bluetooth LE 6.0 (Channel Sounding) Host Documents MCX W72 Product Family Data Sheet MCX W72 Reference Manual Errata Sheet for MCX W72 MCXW72 Hardware Design Guide   Getting Started with Matter on MCX W72 platforms Getting Started with OpenThread on NXP MCX W72    FRDM-MCXW72 User Manual Getting Started with the FRDM-MCXW72   MCX W72-LOC User Manual Bluetooth Interested in Bluetooth technology? Bluetooth® Low Energy Primer – Essential reading for understanding BLE fundamentals. Bluetooth® Specifications – Full list of standards, protocols, and technical documents. Awards and Recognition - Every year, the Bluetooth Special Interest Group (SIG) celebrates the hard work and commitment of working groups, committee members, and contributors who have been recognized by their peers as making a difference in advancing Bluetooth technology.  2024: Channel Sounding 2025: Channel sounding amplitude-based attack resilience, LE test mode enhancements and Ranging profile and service.  Bluetooth AI Assistant - Amber   Bluetooth Feature Overview Bluetooth_5.0_Feature_Overview  Bluetooth_5.1_Feature_Overview  Bluetooth_5.2_Feature_Overview Bluetooth_5.3_Feature_Overview Bluetooth_5.4_Feature_Overview Bluetooth_6_Feature_Overview Bluetooth_6.1_Feature_Overview Bluetooth_6.2_Feature_Overview Bluetooth_6.3_Feature_Overview Bluetooth Core Specification Core Specification 4.0 Core Specification 4.1 Bluetooth 4.1 FAQ Core Specification 4.2 Bluetooth 4.2 FAQ Core Specification 5.0 Core Specification 5.1 Core Specification 5.2 Core Specification 5.3 Core Specification 5.4 Core Specification 6.0 Core Specification 6.1 Core Specification 6.2 Core Specification 6.3   Application Notes Software, Hardware and Peripherals: AN14850 Boosting application performance with MCX W72: This application note describes the usage of the dual-core architecture in the MCX W72 microcontroller to improve performance in generic embedded applications. AN14937 32kHz Crystal-less mode on MCX W72: This application note provides information on the 32 kHz Crystal-less mode on the MCX W72 device. This mode allows you to reduce the cost of the system, without compromising the 32 kHz clock accuracy. The Free‑Running Oscillator (FRO32K) is used as the 32 kHz clock source and is calibrated against the 32 MHz RF oscillator through the Signal Frequency Analyzer (SFA) module of MCX W72 AN14745 Features, Usage, and Capabilities of Smart Power Switch on the MCX W72: This application note describes the use of the smart power switch in the MCX W72microcontroller. The MCX W72 integrates a programmable solid-state switch that turns connected components on or off, including MCX W72 power domains. AN14747 Loadpull test Report for MCX W72: This document explains the purpose of measuring the supply current, the transmit power, and the harmonics level. These measurements are monitored while the complex output load seen by the device under test (DUT) is tuned in amplitude and phase. Power Management:  AN14739 MCX W72 Bluetooth Low Energy Power Consumption Analysis: This document provides the power consumption analysis of the MCX W72 (IIOT) wireless MCU using the MCXW72-EVK board AN14745 Features Usage and Capabilities of Smart Power Switch on MCX W72 Microcontroller:  This application note describes the use of the smart power switch in the MCX W72 microcontroller. The MCX W72 integrates a programmable solid-state switch that turns connected components on or off, including MCX W72 power domains. AN14841 802.15.4 Matter and Zigbee Power Consumption Analysis for MCX W72: This document provides the power consumption analysis of the Kinetis MCX W72 (IIoT) wireless MCUs. AN14742 Power Management Hardware for the MCX W72: This application note describes the usage of the different modules dedicated to power management in the MCX W72microcontroller AN14664 Coincell Hardware Recommendations for Kinetis BLE Applications: his document describes some hardware and software solutions to minimize the peaks of current at the coin cell level RF: AN14865 Channel Sounding Fundamentals for the KW47 and MCX W72: This document provides an overview of the fundamentals for CS technology and how it can be used for custom solutions and applications. AN14779 Printed Channel Sounding Antennas for the KW47 and MCX W72: his application note is focused on printed antennas implemented on printed-circuit boards (PCB), designed by NXP for the KW47 and MCX W72 controllers AN14832 Fundamental Steps to Design a Channel Sounding Board - Creating a Simple PCB without Diversity: In this document, an example of a minimalistic CS subsystem is presented. Attention is paid to the Radio-Frequency (RF) path, since RF circuitry strongly influences the properties of the whole CS application. AN14747 Loadpull Test Report for MCX W72: This document explains the purpose of measuring the supply current, the transmit power, and the harmonics level. These measurements are monitored while the complex output load seen by the device under test (DUT) is tuned in amplitude and phase. AN14868 RF Modeling of Channel Sounding in ANSYS: focuses on techniques for simulating and analyzing channel sounding in wireless communication systems using ANSYS tools AN14855 Channel Sounding Tests in Different Environments: This application note is about Bluetooth Channel Sounding (CS), a technique for measuring the distance between two devices in the Bluetooth frequency band. It explains key factors affecting accuracy AN14869 Fundamental Steps to Design a Complex Channel Sounding Board:  It focuses on creating hardware that supports advanced CS features, including antenna diversity and optimized RF paths, to improve accuracy and mitigate issues like multipath propagation. AN2731 Compact Planar Antennas for 2.4GHz Communication: This document is not an exhaustive inquiry into antenna design. It is instead focused on helping the customers understand enough board layout and antenna basics to select a correct antenna type for their application, as well as avoiding typical layout mistakes that cause performance issues that lead to delays AN14889: FRDM-MCXW72 Radio Frequency System Evaluation Report for Bluetooth Low Energy and for IEEE 802.15.4 This document provides the radio frequency (RF) evaluation test results of the FRDM-MCXW72 board for Bluetooth Low Energy (2FSK modulation) and IEEE 802.15.4 (OQPSK modulation) applications.  Security: AN14648 MCX W72 In-System Programming Utility: The document provides steps to boot the MCX W72 MCU in ISP mode and establish various serial connections to communicate with the MCU AN14613 MCX W72 Secure Boot using SEC tool: The MCX W72 is a low-power, highly secure, single-chip wireless MCU, the contents of flash memory can be saved as encrypted data, which can be decrypted instantly. It helps in protecting the sensitive data and algorithms. AN14646 Debug Authentication on MCX W72: This application note describes the steps for debug authentication using the MCUXpresso Secure Provisioning Tool (SEC). AN14728 MCX W72 Flash Encryption using NPX: There is an increasing requirement to protect the application code and data stored in flash memories in an encrypted form due to security reasons. The NVM PRINCE XEX (NPX) is a module inside the Flash Memory Controller (FMC) that allows customers to protect the contents of flash regions (up to four regions). It performs on-the-fly, low-latency encryption and decryption of flash contents, and it is transparent to the developer and to the Cortex-M33 platform. No special handle is needed from the perspective of the developer. AN14644 MCX W72 Managing Lifecycles: This document describes the following: Lifecycle stages that are available to the user, how to access the lifecycles, limitations of the lifecycles, how to transition to the next lifecycle AN14670 EdgeLock 2GO Provisioning via SPSDK for MCUs: EdgeLock 2GO is a fully managed cloud platform operated by NXP that provides secure provisioning services for easy deployment and maintenance of IoT devices that integrate NXP MCU, MPU, and EdgeLock SE05x secure elements. AN14624 EdgeLock 2GO PRovisioning via Secure Provisioning Tool (SEC) for MCUs: EdgeLock 2GO is a fully managed cloud platform operated by NXP that provides secure provisioning services for easy deployment and maintenance of IoT devices that integrate NXP MCU, MPU, and EdgeLock SE05x secure elements. AN14544 EdgeLock 2Go Services for MPU and MCU: EdgeLock 2GO is the service platform of NXP for provisioning and managing IoT devices. It lets you securely install keys and certificates into your devices, either during manufacturing or in the field, and then keep credentials up to date during the device life cycle. EdgeLock 2GO uses the security capability of each device, for optimal levels of security across your entire IoT fleet. Bluetooth Training Bluetooth Low Energy 6.0 NXP Training MCX W Series Training - NXP Community   RF Switch Comparison Absorptive/Reflective Standards Comparison ETSI / FCC / ARIB requirements BLE Channel Sounding  - Overview BLE Channel Sounding - RF Hardware BLE Channel Sounding - ANSYS Modeling Tools  BLE Channel Sounding - Antenna Prototypes Validation Measurements Equipment Wireless Equipment: This article provides the links to the Equipment that helps to the project development  Useful Links Debug probe firmware installation for the KW47-EVK and FRDM-MCXW72 This post will cover how to install the CMSIS-DAP/SEGGER J-link firmware for the KW47-EVK and FRDM-MCXW72 using NXP’s MCU-LINK installer. How to generate a Standalone IAR toolchain project from MCUXSDK application example - KWX/MCWX  Updating NBU for Wireless Examples on KW47/MCXW72This post will cover how to update the NBU firmware How to import and run demo examples with MCUXpresso for Visual Studio Code: This article gives information on how to import and run demo examples from the new SDK with ARM GCC toolchain, in MCUXpresso for Visual Studio Code. [MCUXSDK] How to use GitHub SDK for KW4x, MCXW7x, MCXW2x - NXP Community this community post provides step by step how to use GitHub SDK [MCUXSDK] GitHub SDK - Documentation for Bluetooth LE platforms - NXP Community this community post provides the documentation for BLE platforms.  The best way to build a PCB first time right with KW47 (Automotive) or MCXW72 (IoT/Industrial): In this community provides the important link to build a PCB using a KW45 or K32W148 and MCXW71 and all concerning the radio performances, low power and radio certification (CE/FCC/ICC) Workaround implementation for DCDC failure during drive strength change a DCDC failure can occur infrequently during a drive strength change to low, and the DCDC output voltage becomes greater than or equal to the current output voltage. How to use the HCI_bb on Kinetis family products and get access to the DTM mode:  This article is presenting two parts: How to flash the HCI_bb binary into the Kinetis product. Perform RF measurement using the R&S CMW270 BLE HCI Application to set transmitter/receiver test commands: This article provides the steps to show how user could send serial commands to the device. Bluetooth LE HCI Black Box Quick Start Guide : This article describes a simple process for enabling the user controls the radio through serial commands. Using HCI_VENDOR_CONFIG_TX_POWER on KW47 and MCXW72 Bluetooth LE Devices Kinetis (../45/47/43;MCX W71/72/70) & MCX W23 Power Profile Tools (including Localization):  This page is dedicated to the Kinetis (KW35/KW38/KW45/KW47/KW43) and MCX W7x (MCX W71/W72/W70) Power Profile Tools. It will help you to estimate the power consumption in your application (Automotive or IIoT) and evaluate the battery lifetime of your solution. One Wireless Connectivity Power Profile Tool KW47/MCXW72 32MHz & 32kHz Oscillation margins: this article provides the properly configuration for the Oscillation margins for the circuit. Errata ERR053377: Use Cases for Different Message Buffer ConfigurationsThis article discusses the different use cases and configuration of the errata "ERR053377: FlexCAN: Message Buffer (MB) and Enhanced RX FIFO Filter Element (ERFFEL) Memory Corruption" CAN-FD maximum baud rate on KW47 and MCXW72  This article describes the clock accuracy requirements and FlexCAN configuration needed to achieve the maximum supported CAN FD data rate of 6 Mbps on KW47 and MCXW72 devices. It explains how to use the FRO192 clock in closed-loop trim mode with a 32 MHz crystal reference and provides example code for clock and CAN FD configuration. Videos NXP Channel Sounding technology interfacing with Google Pixel 10 This is a demo showing the MCX W72 LOC board interacting with Google Pixel 10 phone using channel sounding Exploring Bluetooth Channel Sounding on FRDM-MCXW72 - Part 1: In this video, you will see step‑by‑step how Bluetooth® Channel Sounding works using NXP’s Rate2 distance‑estimation solution. Performing the demonstration includes a computer with VS Code, the MCUXpresso extension and toolchains installed, a FRDM‑MCXW72 development board and a smartphone running the BLE Hero application. Exploring Bluetooth Channel Sounding on FRM-MCXW72 - Part 2:  Concluding the demonstration of Bluetooth® Channel Sounding, part two of this presentation continues with a brief review of the testing setup and walks you through running board‑to‑board measurements
View full article
i.MX8MMini (m845S) DDRレジスタ・プログラミング・エイド (RPA) これは、i.MX 8MMini (m845S) DDR 初期化に関連するレジスタの詳細なプログラミング支援機能です。詳細については、メインの mScale DDR ツールページを参照してください。 https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/i-MX-8M-Family-DDR-Tool-Release/ta-p/1104467 このページは、RPAスプレッドシートの保存のみを目的としていることに注意してください。ご不明な点がございましたら、新しいコミュニティスレッドを作成してください。
View full article
i.MX8MNano (m815S) DDR Register Programming Aid (RPA) This is a detailed programming aid for the registers associated with i.MX 8MNano (m815S) DDR initialization.  For more details, refer to the main mScale DDR tools page: https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/i-MX-8M-Family-DDR-Tool-Release/ta-p/1104467 Please note that this page is only intended to store the RPA spreadsheets. For questions, please create a new community thread. Re: i.MX8MNano (m815S) DDR Register Programming Aid (RPA) Hello @Rodrigue , in case of the mScale processors, the training is performed for each of the frequency points - there are separate register sets that hold the calibration values for each frequency. Please note that this page is only meant to store the RPAs. For the future questions about the RPAs, please setup a separate community thread. Best Regards, Jan Re: i.MX8MNano (m815S) DDR Register Programming Aid (RPA) Hi @jan_spurek , May you please indicate some details with respect to the second Frequency Point? How is this handled by the DDR Stress test? As far as I understand the tool only check the calibration around one frequency point since it only verifies against a typical DDR register setting. Or just there for further helping validating the design at lower bus frequency with the vTSA tool? Thanks and best regards
View full article
i.MX8M (m850D) DDR 寄存器编程辅助工具 (RPA) 这是针对与 i.MX 8M (m850D) DDR初始化相关寄存器的详细编程辅助工具。如需更多详细信息,请参阅 mScale DDR 工具主页面: https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/i-MX-8M-Family-DDR-Tool-Release/ta-p/1104467 请注意,此页面仅用于存储 RPA 电子表格。如有疑问,请创建新的社区主题。
View full article
i.MX 8M系列 DDR 工具发布 Important: If you have any questions or would like to report any issues with the DDR tools or supporting documents please create a support ticket in the  i.MX community. Please note that any private messages or direct emails are not monitored and will not receive a response. 注意: 请注意,i.MX 8M 系列已添加 DDR 支持,并且此功能也已在Config Tools for i.MX Applications Processors | NXP Semiconductors中添加。请考虑使用此工具以获取更多增强功能。 i.MX 8M系列 DDR 工具概览 i.MX 8M 系列 DDR 工具是一款基于 Windows 的软件,旨在帮助用户进行 LPDDR4/DDR4/DDR3L 培训、压力测试以及为 u-boot SPL 生成 DDR 初始代码。 本页面包含 i.MX 8M 系列 DDR 工具的最新版本,支持以下 SoC: i.MX 8M Quad及其衍生产品i.MX 8M Quadlite和i.MX 8M Dual i.MX 8M Mini Quad 及其衍生产品 i.MX 8M Mini Quadlite/Dual/DualLite/Solo/SoloLite i.MX 8M Nano Quad 及其衍生产品 i.MX 8M Nano Quadlite/Dual/DualLite/Solo/SoloLite i.MX 8M Plus NOTE: For the i.MX 8/8X Family of DDR tools please refer to the: i.MX 8/8X Family DDR Tools Release   i.MX 8M 系列 DDR 工具旨在让用户能够根据设备配置(密度、芯片选择数量等)和板布局(数据总线位切换等)生成和测试自定义 DRAM 初始化。此过程使用户能够继续进行引导加载程序和操作系统的启动。操作系统启动后,建议运行基于操作系统的内存测试(如 Linux memtester)以进一步验证和测试 DDR 内存接口。   i.MX 8M 系列 DDR 工具包括: DDR 寄存器编程辅助工具 (RPA) MSCALE DDR 工具   有关这些 DDR 工具及其使用的更多详细信息,请参阅 i.MX 8M DDR Tools 用户指南。   i.MX 8M系列DDR工具 i.MX 8M 系列 DDR 压力测试工具是一款基于 Windows 的软件工具,用于验证 DDR 初始化是否正常工作,以便与 u-boot 和操作系统启动过程配合使用。要安装 DDR 压力测试,您需要保存并解压缩 zip 文件 mscale_ddr_tool_vXXX_setup.exe.zip  (其中“xxx”为当前版本号)并按照屏幕上的安装说明进行操作。 i.MX 8M 系列 DDR 工具 需求 该工具需要访问Windows注册表,因此用户必须以管理员模式运行它。 当用户设计新的 i.MX 8M 系列开发板时,请务必遵循《硬件开发指南》和《MSCALE_DDR_Tool_User_Guide》中所述的规则,这将有助于用户在各自的 i.MX 8M 开发板上启动 DDR 设备。 i.MX 8M 系列 DDR 工具 用户指南 i.MX 8M DDR 工具包含以下文档:MSCALE_DDR_Tool_User_Guide NOTE: Please read the MSCALE_DDR_Tool_User_Guide inside the package carefully before you use this tool. i.MX8M DDR工具修订历史 版本 主要变更*(特性) 备注 3.31 集成针对 8MQ ERR051273 的解决方案   3.30 修复所有 i.MX 8M 系列的 DBI 启用问题 自动识别 i.MX 8M Nano 板上的 ROHM 和 PCA9450 电源管理IC (PMIC) 修复 4GB/8GB 内存测试工具问题   3.20 为 i.MX 8M Plus 添加支持   3.10 修复PC软件与目标板之间某些特定字符的UART通信问题。 在生成的C代码中微调DDRPHY寄存器。   3.00 为 i.MX8M-nano 添加支持 添加对不同PMIC或PMIC配置的支持 为所有DDR频率点添加压力测试支持 Nano 版 RPA 工具新增对 DDR3L 和 DDR4 的支持 请注意:DDR3L 和 LPDDR4 的 RPA 文件中包含"preliminary"标识,仅表示这些 RPA 基于 NXP 内部验证板开发,而 DDR4 RPA 则基于已发布的 EVK 开发。 2.10 更改 DDR4 容量计算方法   2.00 添加对 i.MX8M-mini 的支持   * 更多详细信息请参阅发行说明 i.MX 8M 调试 UART2 的.ds 脚本示例配置: ################step 0: configure debug uart port. Assumes use of UART IO Pads.   ##### ##### If using non-UART pads (i.e. using other pads to mux out the UART signals), ##### ##### then it is up to the user to overwrite the following IO register settings   ##### memory set 0x3033023C 32 0x00000000 #IOMUXC_SW_MUX_UART2_RXD memory set 0x30330240 32 0x00000000 #IOMUXC_SW_MUX_UART2_TXD memory set 0x303304A4 32 0x0000000E #IOMUXC_SW_PAD_UART2_RXD memory set 0x303304A8 32 0x0000000E #IOMUXC_SW_PAD_UART2_TXD memory set 0x303304FC 32 0x00000000 #IOMUXC_SW_MUX_UART2_SEL_RXD sysparam set debug_uart   1 #UART index from 0 ('0' = UART1, '1' = UART2, '2' = UART3, '3' = UART4) i.MX 8M 调试 UART3 的.ds 脚本开头示例配置 ################step 0: configure debug uart port. Assumes use of UART IO Pads.   ##### ##### If using non-UART pads (i.e. using other pads to mux out the UART signals), ##### ##### then it is up to the user to overwrite the following IO register settings   ##### memory set 0x30330244 32 0x00000000 #IOMUXC_SW_MUX_UART3_RXD memory set 0x30330248 32 0x00000000 #IOMUXC_SW_MUX_UART3_TXD memory set 0x303304AC 32 0x0000000E #IOMUXC_SW_PAD_UART3_RXD memory set 0x303304B0 32 0x0000000E #IOMUXC_SW_PAD_UART3_TXD memory set 0x30330504 32 0x00000002 #IOMUXC_SW_MUX_UART3_SEL_RXD sysparam set debug_uart   2 #UART index from 0 ('0' = UART1, '1' = UART2, '2' = UART3, '3' = UART4) i.MX 8M Mini PMIC 配置的.ds 脚本开头示例配置 ##############step 0.5: configure I2C port IO pads according to your PCB design.   ##### ########### You can modify the following instructions to adapt to your board PMIC ####### memory set 0x30330214 32 0x00000010  #IOMUXC_SW_MUX_I2C1_SCL memory set 0x30330218 32 0x00000010  #IOMUXC_SW_MUX_I2C1_SDA memory set 0x3033047C 32 0x000000C6 #IOMUXC_SW_PAD_I2C1_SCL memory set 0x30330480 32 0x000000C6  #IOMUXC_SW_PAD_I2C1_SDA sysparam set pmic_cfg 0x004B #bit[7:0] = PMIC addr,bit[15:8]=I2C Bus. Bus index from 0 ('0' = I2C1, '1' = I2C2, '2' = I2C3, '3' = I2C4) sysparam set pmic_set 0x2F01 #bit[7:0] = Reg val, bit[15:8]=Reg addr. #REG(0x2F) = 0x01 sysparam set pmic_set 0x0C02   #REG(0x0C) = 0x02 sysparam set pmic_set 0x171E   #REG(0x17) = 0x1E sysparam set pmic_set 0x0C00   #REG(0x0C) = 0x00 sysparam set pmic_set 0x2F11    #REG(0x2F)=0x11 i.MX 8M 系列 DDR 寄存器编程辅助工具 (RPA) i.MX 8M DDR RPA(或简称为 RPA)是一款用于为用户特定的 DDR 配置(如 DDR 设备类型、密度等)开发 DDR 初始化的 Excel 电子表格工具。RPA 生成 DDR 初始化(在单独的 Excel 工作表标签中):   DDR 压力测试脚本:此格式专用于 DDR 压力测试,首先将本工作表中的内容复制到文本文件中,然后将该文件命名为“.ds”文件扩展名的文档。用户在执行DDR压力测试时将选择此文件。 《如何使用Excel工作表》选项卡提供了使用 RPA 的说明。   i.MX 8M 系列 DDR 寄存器编程辅助 (RPA):当前版本 要获取最新的 RPA,请参考以下链接(注意,现有的 RPA 已从本主页面移除,并移至下方特定于 SoC)的链接中): i.MX 8M Quad: https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/i-MX8M-m850D-DDR-Register-Programming-Aid-RPA/ta-p/1172441 i.MX 8M Mini : https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/i-MX8MMini-m845S-DDR-Register-Programming-Aid-RPA/ta-p/1172443 i.MX 8M Nano: https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/i-MX8MNano-m815S-DDR-Register-Programming-Aid-RPA/ta-p/1172444 i.MX 8M Plus: https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/i-MX-8MPlus-m865S-DDR-Register-Programming-Aids-RPA/ta-p/1235352   处理器 掩模版本 支持的存储器 最新 RPA 版本 * i.MX 8M Quad & Derivatives 全部 LPDDR4 启示录 33 i.MX 8M Quad & Derivatives 全部 DDR4 版本 18 i.MX 8M Quad & Derivatives 全部 DDR3L Rev 9 i.MX 8M Mini& 衍生产品 A0 LPDDR4 启示录 22 i.MX 8M Mini及衍生产品 A0 DDR4 版本 21 i.MX 8M Mini & 衍生产品 A0 DDR3L 版本 10 i.MX 8M Nano & 衍生产品 A0 LPDDR4 Rev 9 i.MX 8M Nano及其衍生产品 A0 DDR4 版本 12 i.MX 8M Nano及其衍生产品 A0 DDR3L Rev 6 i.MX 8M Plus 及其衍生产品 A1 LPDDR4 Rev 9 i.MX 8M Plus 及其衍生产品 A1 DDR4 Rev 9 * 有关更新的详细信息,请参阅相应 RPA 的“修订记录”选项卡。 要修改自定义设置的 DRAM 频率,请参阅iMX 8M Mini 寄存器编程辅助工具 DRAM PLL 配置 相关资源链接: i.MX 应用处理器的配置工具 | NXP 半导体 i.MX 8M Mini 寄存器编程辅助工具 DRAM PLL 设置 i.MX 8/8X 系列 DDR 工具发布 i.MX 6/7 DDR 压力测试 GUI 工具 i.MX 8M 应用处理器相关资源 i.MX8M (m850D) DDR 寄存器编程辅助工具 (RPA) i.MX8MMini (m845S) DDR 寄存器编程辅助 (RPA) i.MX8MNano (m815S) DDR 寄存器编程辅助 (RPA) i.MX 8MPlus (m865S) DDR 寄存器编程辅助工具 (RPA) i.MX 8ULP DDR 工具:i.MX 软件和开发工具 | NXP Semiconductors 向下滚动到“其他资源 --> 工具 --> DDR 工具” i.MX 8M | i.MX 8M Mini | i.MX 8M Nano 回复:i.MX 8M 系列 DDR工具发布 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 太好了。谢谢!
View full article
i.MX8M (m850D) DDRレジスタプログラミング支援 (RPA) これは、i.MX 8M (m850D) DDR 初期化に関連するレジスタの詳細なプログラミング補助資料です。詳細については、mScale DDRツールのメインページをご参照ください。 https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/i-MX-8M-Family-DDR-Tool-Release/ta-p/1104467 このページは、RPAスプレッドシートの保存のみを目的としていることに注意してください。ご不明な点がございましたら、新しいコミュニティスレッドを作成してください。
View full article
i.MX8MNano (m815S) DDRレジスタプログラミング支援 (RPA) これは、i.MX 8MNano (m815S) DDR初期化に関連するレジスタの詳細なプログラミング支援資料です。詳細については、mScale DDRツールのメインページをご参照ください。 https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/i-MX-8M-Family-DDR-Tool-Release/ta-p/1104467 このページは、RPAスプレッドシートの保存のみを目的としていることに注意してください。ご不明な点がございましたら、新しいコミュニティスレッドを作成してください。 Re: i.MX8MNano (m815S) DDRレジスタプログラミング支援 (RPA) こんにちは、@Rodrigueさん mScaleプロセッサでは、各周波数ポイントでトレーニングが実施されます。各周波数のキャリブレーション値を保持する個別のレジスタ・セットがあります。 このページの目的はRPAの保存に限定されることにご注意ください。RPAに関する今後の質問については、別のコミュニティ・スレッドを作成してください。 よろしくお願いいたします。 Jan Re: i.MX8MNano (m815S) DDR Register Programming Aid (RPA) こんにちは@jan_spurek 、 2番目の周波数ポイントに関して詳細を教えていただけますか? DDRストレステストでは、これはどのように処理されますか? 私が知る限り、このツールは一般的なDDRレジスタ設定のみを検証するため、確認するのは1つの周波数ポイント付近のキャリブレーションに限られます。 それとも、vTSAツールを使用して、低いバス周波数での設計をさらに検証するためにお手伝いが必要ですか? お返事をよろしくお願いいたします。
View full article
i.MX8MNano (m815S) DDR 寄存器编程辅助 (RPA) 这是关于与 i.MX 8MNano (m815S) DDR 初始化相关的寄存器的详细编程指南。如需更多详细信息,请参阅 mScale DDR 工具主页面: https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/i-MX-8M-Family-DDR-Tool-Release/ta-p/1104467 请注意,此页面仅用于存储 RPA 电子表格。如有疑问,请创建新的社区主题。 回复:i.MX8MNano (m815S) DDR 寄存器编程辅助 (RPA) 您好,@Rodrigue, 对于 mScale 处理器,将针对每个频率点执行训练 - 有单独的寄存器集保存每个频率的校准值。 请注意,此页面仅用于存储 RPA。对于有关 RPA 的未来问题,请设置单独的社区主题。 顺祝商祺! Jan Re: i.MX8MNano (m815S) DDR Register Programming Aid (RPA) 你好@jan_spurek、 请您提供有关第二个频率点的详细信息吗? DDR 压力测试如何处理这种情况? 据我所知,该工具仅在某个频率点附近检查校准,因为它仅与典型的 DDR 寄存器设置进行验证。 或者只是为了进一步帮助使用 vTSA 工具在较低总线频率下验证设计吗? 谢谢并致以最诚挚的问候
View full article
i.MX 8M Family DDR Tool Release Important: If you have any questions or would like to report any issues with the DDR tools or supporting documents please create a support ticket in the  i.MX community. Please note that any private messages or direct emails are not monitored and will not receive a response. NOTE: Please note that DDR support for the i.MX 8M Family and has also been added in the Config Tools for i.MX Applications Processors | NXP Semiconductors Please consider using this tool with more enhanced features. i.MX 8M Family DDR Tools Overview The i.MX 8M Family DDR Tool is a Windows-based software to help users to do LPDDR4/DDR4/DDR3L training, stress test and DDR initial code generation for u-boot SPL. This page contains the latest releases for the i.MX 8M Family DDR Tools and cover the following SoCs : i.MX 8M Quad and its derivatives i.MX 8M Quadlite and i.MX 8M Dual i.MX 8M Mini Quad and its derivatives i.MX 8M Mini Quadlite/Dual/DualLite/Solo/SoloLite  i.MX 8M Nano Quad and its derivatives i.MX 8M Nano Quadlite/Dual/DualLite/Solo/SoloLite  i.MX 8M Plus NOTE: For the i.MX 8/8X Family of DDR tools please refer to the: i.MX 8/8X Family DDR Tools Release   The purpose of the i.MX 8M Family DDR Tools is to enable users to generate and test a custom DRAM initialization based on their device configuration (density, number of chip selects, etc.) and board layout (data bus bit swizzling, etc.).  This process equips the user to then proceed with the bring-up of a boot loader and an OS.  Once the OS is brought up, it is recommended to run an OS-based memory test (like Linux memtester) to further verify and test the DDR memory interface.     The i.MX 8M Family DDR Tools consist of: DDR Register Programming Aid (RPA) MSCALE DDR Tool   For more details regarding these DDR tools and their usage, refer to the i.MX 8M DDR Tools User Guide.   i.MX 8M Family DDR Tool  The i.MX 8M Family DDR stress test tool is a Windows-based software tool that is used as a mechanism to verify that the DDR initialization is operational for use with u-boot and OS bring-up. To install the DDR Stress Test, save and extract the zip file mscale_ddr_tool_vXXX_setup.exe.zip   (where 'xxx' is the current version number) and follow the on-screen installation instructions. i.MX 8M Family DDR Tool Requirements The tool requires access to the Windows registry, hence users must run it in administrator mode. When users design new i.MX 8M Family boards, please make sure to follow the rules outlined in the respective Hardware Developers Guide and the MSCALE_DDR_Tool_User_Guide, which can help users bring up DDR devices on their respective i.MX 8M boards. i.MX 8M Family DDR Tool User Guide The i.MX 8M DDR tool includes the document: MSCALE_DDR_Tool_User_Guide NOTE: Please read the MSCALE_DDR_Tool_User_Guide inside the package carefully before you use this tool. i.MX8M DDR Tool Revision History Rev Major Changes* (Features) Comments 3.31 Integration of the workaround for 8MQ ERR051273   3.30 Fix DBI enabled issue for all i.MX 8M series Automatically identify ROHM and PCA9450 PMICs on i.MX 8M Nano board Fix 4GB/8GB memory tester issues   3.20 Add support to i.MX 8M Plus   3.10 Fixe UART communication issues for some specific characters between the PC software and the target board. Fine-tune DDRPHY registers in generated C code.   3.00 Add support to i.MX8M-nano Add support to different PMIC or PMIC configuration Add support to stress test for all DDR frequency points RPA tools for Nano include support for DDR3L, DDR4, and LPDDR4.   Note that the DDR3L and LPDDR4 RPAs contain the name preliminary only to denote that these RPAs are based on internal NXP validation boards where the DDR4 RPA is based on the released EVK.   2.10 Change DDR4 capacity computing method   2.00 Add support to i.MX8M-mini   * Further details available in the release notes Sample configuration in the .ds script for i.MX 8M debug UART2: ################step 0: configure debug uart port. Assumes use of UART IO Pads.   ##### ##### If using non-UART pads (i.e. using other pads to mux out the UART signals), ##### ##### then it is up to the user to overwrite the following IO register settings   ##### memory set 0x3033023C 32 0x00000000 #IOMUXC_SW_MUX_UART2_RXD memory set 0x30330240 32 0x00000000 #IOMUXC_SW_MUX_UART2_TXD memory set 0x303304A4 32 0x0000000E #IOMUXC_SW_PAD_UART2_RXD memory set 0x303304A8 32 0x0000000E #IOMUXC_SW_PAD_UART2_TXD memory set 0x303304FC 32 0x00000000 #IOMUXC_SW_MUX_UART2_SEL_RXD sysparam set debug_uart   1 #UART index from 0 ('0' = UART1, '1' = UART2, '2' = UART3, '3' = UART4) Sample configuration in the front of the .ds script for i.MX 8M debug UART3  ################step 0: configure debug uart port. Assumes use of UART IO Pads.   ##### ##### If using non-UART pads (i.e. using other pads to mux out the UART signals), ##### ##### then it is up to the user to overwrite the following IO register settings   ##### memory set 0x30330244 32 0x00000000 #IOMUXC_SW_MUX_UART3_RXD memory set 0x30330248 32 0x00000000 #IOMUXC_SW_MUX_UART3_TXD memory set 0x303304AC 32 0x0000000E #IOMUXC_SW_PAD_UART3_RXD memory set 0x303304B0 32 0x0000000E #IOMUXC_SW_PAD_UART3_TXD memory set 0x30330504 32 0x00000002 #IOMUXC_SW_MUX_UART3_SEL_RXD sysparam set debug_uart   2 #UART index from 0 ('0' = UART1, '1' = UART2, '2' = UART3, '3' = UART4) Sample configuration in the front of the .ds script for i.MX 8M Mini PMIC configuration: ##############step 0.5: configure I2C port IO pads according to your PCB design.   ##### ########### You can modify the following instructions to adapt to your board PMIC ####### memory set 0x30330214 32 0x00000010  #IOMUXC_SW_MUX_I2C1_SCL memory set 0x30330218 32 0x00000010  #IOMUXC_SW_MUX_I2C1_SDA memory set 0x3033047C 32 0x000000C6 #IOMUXC_SW_PAD_I2C1_SCL memory set 0x30330480 32 0x000000C6  #IOMUXC_SW_PAD_I2C1_SDA sysparam set pmic_cfg 0x004B #bit[7:0] = PMIC addr,bit[15:8]=I2C Bus. Bus index from 0 ('0' = I2C1, '1' = I2C2, '2' = I2C3, '3' = I2C4) sysparam set pmic_set 0x2F01 #bit[7:0] = Reg val, bit[15:8]=Reg addr. #REG(0x2F) = 0x01 sysparam set pmic_set 0x0C02   #REG(0x0C) = 0x02 sysparam set pmic_set 0x171E   #REG(0x17) = 0x1E sysparam set pmic_set 0x0C00   #REG(0x0C) = 0x00 sysparam set pmic_set 0x2F11    #REG(0x2F)=0x11 i.MX 8M Family DDR Register Programming Aid (RPA) The i.MX 8M DDR RPA (or simply RPA) is an Excel spreadsheet tool used to develop DDR initialization for a user’s specific DDR configuration (DDR device type, density, etc.). The RPA generates the DDR initialization(in a separate Excel worksheet tab):   DDR Stress Test Script: This format is used specifically with the DDR stress test by first copying the contents in this worksheet tab and then pasting it to a text file, naming the document with the “.ds” file extension. The user will select this file when executing the DDR stress test. The How to Use Excel worksheet tab provides instructions on using the RPA   i.MX 8M Family DDR Register Programming Aid (RPA): Current Versions To obtain the latest RPAs, please refer to the following links (note, existing RPAs have been removed from this main page and moved to the SoC specific links below): i.MX 8M Quad : https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/i-MX8M-m850D-DDR-Register-Programming-Aid-RPA/ta-p/1172441 i.MX 8M Mini : https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/i-MX8MMini-m845S-DDR-Register-Programming-Aid-RPA/ta-p/1172443 i.MX 8M Nano: https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/i-MX8MNano-m815S-DDR-Register-Programming-Aid-RPA/ta-p/1172444 i.MX 8M Plus: https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/i-MX-8MPlus-m865S-DDR-Register-Programming-Aids-RPA/ta-p/1235352   Processor Mask Revisions Memory Supported Latest RPA Version * i.MX 8M Quad & Derivatives All LPDDR4 Rev 36 i.MX 8M Quad & Derivatives All DDR4 Rev 20 i.MX 8M Quad & Derivatives All DDR3L Rev 12 i.MX 8M Mini & Derivatives A0 LPDDR4 Rev 25 i.MX 8M Mini & Derivatives A0 DDR4 Rev 23 i.MX 8M Mini & Derivatives A0 DDR3L Rev 12 i.MX 8M Nano & Derivatives A0 LPDDR4 Rev 12 i.MX 8M Nano & Derivatives A0 DDR4 Rev 14 i.MX 8M Nano & Derivatives A0 DDR3L Rev 8 i.MX 8M Plus & Derivatives A1 LPDDR4 Rev 11 i.MX 8M Plus & Derivatives A1 DDR4 Rev 11 * For the details about the updates, please refer to the Revision History tab of the respective RPA.  To modify the DRAM Frequency for a custom setting refer to iMX 8M Mini Register Programming Aid DRAM PLL setting  Related Resources Links: Config Tools for i.MX Applications Processors | NXP Semiconductors i.MX 8M Mini Register Programming Aid DRAM PLL setting  i.MX 8/8X Series DDR Tool Release  i.MX 6/7 DDR Stress test GUI Tool i.MX 8M Application Processor Related Resources i.MX8M (m850D) DDR Register Programming Aid (RPA)  i.MX8MMini (m845S) DDR Register Programming Aid (RPA)  i.MX8MNano (m815S) DDR Register Programming Aid (RPA) i.MX 8MPlus (m865S) DDR Register Programming Aids (RPA)   i.MX 8ULP DDR tools: i.MX Software and Development Tools | NXP Semiconductors Scroll down to “Other Resources --> Tools --> DDR Tools” i.MX 8M | i.MX 8M Mini | i.MX 8M Nano Re: i.MX 8M Family DDR Tool Release Great. Thank You
View full article
i.MX8M (m850D) DDR Register Programming Aid (RPA) This is a detailed programming aid for the registers associated with i.MX 8M (m850D) DDR initialization.  For more details, refer to the main mScale DDR tools page: https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/i-MX-8M-Family-DDR-Tool-Release/ta-p/1104467 Please note that this page is only intended to store the RPA spreadsheets. For questions, please create a new community thread.
View full article
i.MX8MMini (m845S) DDR Register Programming Aid (RPA) This is a detailed programming aid for the registers associated with i.MX 8MMini (m845S) DDR initialization.  For more details, refer to the main mScale DDR tools page: https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/i-MX-8M-Family-DDR-Tool-Release/ta-p/1104467 Please note that this page is only intended to store the RPA spreadsheets. For questions, please create a new community thread.
View full article
i.MX 8MファミリーDDRツールリリース Important: If you have any questions or would like to report any issues with the DDR tools or supporting documents please create a support ticket in the  i.MX community. Please note that any private messages or direct emails are not monitored and will not receive a response. 注:i.MX 8Mファミリ向けのDDRサポートは、 i.MXアプリケーション・プロセッサ向け構成ツールにも追加されています | NXP Semiconductors 機能が強化されているこのツールの使用をご検討ください。 i.MX 8M ファミリー DDR ツールの概要 i.MX 8MファミリDDRツールは、LPDDR4/DDR4/DDR3Lのトレーニング、ストレス・テスト、U-Boot SPL用のDDR初期コード生成が実行可能なWindowsベースのソフトウェアです。このページでは、i.MX 8MファミリDDRツールの最新リリースおよび以下のSoCを取りあげています。 i.MX 8M クアッドとその派生型 i.MX 8M クアッドライトおよび i.MX 8M デュアル i.MX 8M Nano Quadおよびその派生製品であるi.MX 8M Nano Quadlite/Dual/DualLite/Solo/SoloLite i.MX 8M Nano Quad および その派生品 i.MX 8M Nano Quadlite/Dual/DualLite/Solo/SoloLite i.MX 8M Plus NOTE: For the i.MX 8/8X Family of DDR tools please refer to the: i.MX 8/8X Family DDR Tools Release   i.MX 8/8X DDRツールの目的は、デバイス構成(密度、チップ・セレクト数など)およびボードのレイアウト(データ・バス・ビットのスウィズリングなど)に基づいて、カスタムDRAM初期化を生成およびテストできるようにすることにあります。このプロセスにより、ユーザーはブート・ローダとOSの立ち上げを進めることができるようになります。OSが起動したら、OSベースのメモリ・テスト(Linux memtesterなど)を実行して、DDRメモリ・インターフェースをさらに検証およびテストすることをお勧めします。   i.MX 8MファミリDDRツールの構成要素は以下のとおりです。 DDRレジスタプログラミングエイド(RPA) MSCALE DDRツール   これらのDDRツールとその使用方法の詳細については、i.MX 8M DDRツールのユーザーガイドを参照してください。   i.MX 8MファミリーDDRツール i.MX 8MファミリのDDRストレス・テスト・ツールは、U-BootおよびOSの起動に伴うDDR初期化が正常に動作することを検証するためのWindowsベースのソフトウェア・ツールです。DDRストレス・テストをインストールするには、zipファイルmscale_ddr_tool_vXXX_setup.exe.zip(「xxx」は現在のバージョン番号)を保存、解凍してから、画面上のインストール手順に従います。 i.MX 8M ファミリー DDR ツール 要件 このツールは Windows レジストリへのアクセスを必要とするため、ユーザーは管理者モードで実行する必要があります。 新しいi.MX 8Mファミリ・ボードを設計する際は、該当ハードウェアの開発者ガイドとMSCALE_DDR_Tool_User_Guideに記載されているルールに忠実に従うと、対象となるi.MX 8MボードでDDRデバイスを起動するのに役立ちます。 i.MX 8MファミリDDRツール・ユーザーガイド i.MX 8M DDRツールには、ドキュメント「MSCALE_DDR_Tool_User_Guide」が付属します。 NOTE: Please read the MSCALE_DDR_Tool_User_Guide inside the package carefully before you use this tool. i.MX8M DDRツール変更履歴 Rev 主な変更*(機能) コメント 3.31 8MQ ERR051273の回避策の組み込み   3.30 i.MX 8Mの全シリーズに共通するDBI有効化の問題を修正 i.MX 8M Nanoボード上でROHMとPCA9450 PMICの識別を自動化 4GB/8GBメモリ・テスタの問題を修正   3.20 i.MX 8M Plusにサポートを追加   3.10 PCソフトウェアとターゲット・ボード間の特定の文字に関するUART通信の問題を修正 生成されたCコード内のDDRPHYレジスタを微調整   3.00 i.MX8M-nanoにサポートを追加 異なるPMICまたはPMIC構成にサポートを追加 すべてのDDR周波数ポイントでストレス・テストのサポートを追加 Nano 用の RPA ツールには、DDR3L、DDR4、および LPDDR4 のサポートが含まれています。 DDR3LとLPDDR4のRPAに「暫定版」という名称が含まれるのは、これらRPAが内部NXP検証ボードを基盤にしていることを示すためのみであり、DDR4 RPAはリリースされたEVKに基づきます。   2.10 DDR4容量計算方法を変更   2.00 i.MX8M Miniのサポートを追加   *詳細については、リリース・ノートを参照してください i.MX 8MデバッグUART2向けの.dsスクリプトのサンプル構成: ################step 0: configure debug uart port. Assumes use of UART IO Pads.   ##### ##### If using non-UART pads (i.e. using other pads to mux out the UART signals), ##### ##### then it is up to the user to overwrite the following IO register settings   ##### memory set 0x3033023C 32 0x00000000 #IOMUXC_SW_MUX_UART2_RXD memory set 0x30330240 32 0x00000000 #IOMUXC_SW_MUX_UART2_TXD memory set 0x303304A4 32 0x0000000E #IOMUXC_SW_PAD_UART2_RXD memory set 0x303304A8 32 0x0000000E #IOMUXC_SW_PAD_UART2_TXD memory set 0x303304FC 32 0x00000000 #IOMUXC_SW_MUX_UART2_SEL_RXD sysparam set debug_uart   1 #UART index from 0 ('0' = UART1, '1' = UART2, '2' = UART3, '3' = UART4) i.MX 8MデバッグUART2向けの.dsスクリプトの前のサンプル構成: ################step 0: configure debug uart port. Assumes use of UART IO Pads.   ##### ##### If using non-UART pads (i.e. using other pads to mux out the UART signals), ##### ##### then it is up to the user to overwrite the following IO register settings   ##### memory set 0x30330244 32 0x00000000 #IOMUXC_SW_MUX_UART3_RXD memory set 0x30330248 32 0x00000000 #IOMUXC_SW_MUX_UART3_TXD memory set 0x303304AC 32 0x0000000E #IOMUXC_SW_PAD_UART3_RXD memory set 0x303304B0 32 0x0000000E #IOMUXC_SW_PAD_UART3_TXD memory set 0x30330504 32 0x00000002 #IOMUXC_SW_MUX_UART3_SEL_RXD sysparam set debug_uart   2 #UART index from 0 ('0' = UART1, '1' = UART2, '2' = UART3, '3' = UART4) i.MX 8M Mini PMIC構成向けの.dsスクリプトの前のサンプル構成: ##############step 0.5: configure I2C port IO pads according to your PCB design.   ##### ########### You can modify the following instructions to adapt to your board PMIC ####### memory set 0x30330214 32 0x00000010  #IOMUXC_SW_MUX_I2C1_SCL memory set 0x30330218 32 0x00000010  #IOMUXC_SW_MUX_I2C1_SDA memory set 0x3033047C 32 0x000000C6 #IOMUXC_SW_PAD_I2C1_SCL memory set 0x30330480 32 0x000000C6  #IOMUXC_SW_PAD_I2C1_SDA sysparam set pmic_cfg 0x004B #bit[7:0] = PMIC addr,bit[15:8]=I2C Bus. Bus index from 0 ('0' = I2C1, '1' = I2C2, '2' = I2C3, '3' = I2C4) sysparam set pmic_set 0x2F01 #bit[7:0] = Reg val, bit[15:8]=Reg addr. #REG(0x2F) = 0x01 sysparam set pmic_set 0x0C02   #REG(0x0C) = 0x02 sysparam set pmic_set 0x171E   #REG(0x17) = 0x1E sysparam set pmic_set 0x0C00   #REG(0x0C) = 0x00 sysparam set pmic_set 0x2F11    #REG(0x2F)=0x11 i.MX 8Mファミリー DDRレジスタプログラミングエイド (RPA) i.MX 8M DDR RPA(または単にRPA)は、ユーザーが特定のDDR構成(DDRデバイス・タイプ、密度など)向けのDDR初期化を練り上げるために使用するExcelスプレッドシート・ツールです。RPAは、DDR初期化を(別々のExcelワークシート・タブに)生成します。   DDRストレス・テスト・スクリプト:こちらはDDRストレス・テスト専用の形式です。まず、このワークシート・タブの内容をコピーしてテキスト・ファイルに貼り付け、ドキュメントに「.ds」というファイル拡張子を付けます。このファイルはユーザーがDDRストレス・テストを実行する際に選択されます。 「How to Use Excel worksheet(Excelワークシートの使用方法)」タブにはRPAの使用手順が記載されています。   i.MX 8/8X DDRレジスタ・プログラミング支援(RPA):現在のバージョン 最新の RPA を入手するには、以下のリンクをご参照ください (既存の RPA はこのメインページから削除され、以下の SoC 固有のリンクに移動していることにご注意ください)。 i.MX 8M Quad : https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/i-MX8M-m850D-DDR-Register-Programming-Aid-RPA/ta-p/1172441 i.MX 8M Mini : https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/i-MX8MMini-m845S-DDR-Register-Programming-Aid-RPA/ta-p/1172443 i.MX 8M Nano: https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/i-MX8MNano-m815S-DDR-Register-Programming-Aid-RPA/ta-p/1172444 i.MX 8M Plus: https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/i-MX-8MPlus-m865S-DDR-Register-Programming-Aids-RPA/ta-p/1235352   プロセッサ マスクのリビジョン メモリがサポートされています 最新の RPA バージョン * i.MX 8M Quad & デリバティブ すべて LPDDR4 Rev 33 i.MX 8M Quadと派生製品 すべて DDR4 Rev 18 i.MX 8M Quadと派生製品 すべて DDR3L Rev 9 i.MX 8M Mini& 派生製品 A0 LPDDR4 黙示録22章 i.MX 8M Miniと派生製品 A0 DDR4 Rev 21 i.MX 8M Miniと派生製品 A0 DDR3L Rev 10 i.MX 8M Nanoと派生製品 A0 LPDDR4 Rev 9 i.MX 8M Nanoと派生製品 A0 DDR4 Rev 12 i.MX 8M Nanoと派生製品 A0 DDR3L Rev6 i.MX 8M Plusと派生製品 A1 LPDDR4 Rev 9 i.MX 8M Plusと派生製品 A1 DDR4 Rev 9 * 更新内容の詳細については、該当するRPAの「変更履歴」タブを参照してください。 DRAM周波数をカスタム設定に変更するには、i.MX 8M Miniレジスタ・プログラミング支援DRAM PLL設定を参照してください。 関連リソースのリンク: i.MXアプリケーション・プロセッサ用Config Tool | NXP Semiconductors i.MX 8M Miniレジスタ・プログラミング支援DRAM PLL設定 i.MX 8/8XシリーズDDRツールのリリース  i.MX 6/7 DDRストレステストGUIツール i.MX 8M アプリケーションプロセッサ関連リソース i.MX8M(m850D)DDRレジスタ・プログラミング支援ツール(RPA) i.MX8MMini(m845S)DDRレジスタ・プログラミング支援(RPA)  i.MX8MNano (m815S) DDRレジスタプログラミング支援 (RPA) i.MX 8MPlus(m865S)DDRレジスタ・プログラミング支援(RPA)   i.MX 8ULP DDR ツール: i.MX ソフトウェアおよび開発ツール | NXP Semiconductors 「その他のリソース --> ツール --> DDR ツール」までスクロールしてください i.MX 8M | i.MX 8M Mini | i.MX 8M Nano Re: i.MX 8MファミリーDDRツールリリース <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> どうもありがとうございます。
View full article
i.MX8MMini (m845S) DDR 寄存器编程辅助 (RPA) 这是与 i.MX 8MMini (m845S) DDR 初始化相关的寄存器的详细编程辅助。有关更多详细信息,请参阅 mScale DDR 工具主页面: https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/i-MX-8M-Family-DDR-Tool-Release/ta-p/1104467 请注意,此页面仅用于存储 RPA 电子表格。如有疑问,请创建新的社区主题。
View full article
[MCX A153] LPCMP入門ガイド(日本語ブログ) 1. はじめに 本記事では、NXP MCX A シリーズ (MCX A153) に搭載されている LPCMP (Low-Power Comparator) を、MCUXpresso SDK の frdmmcxa153_lpcmp_interrupt サンプルと、FRDM-MCXA153ボードを題材に解説します。 LPCMP は 2 つのアナログ入力の大小関係を比較し、結果をデジタル出力として得る周辺機能で、しきい値検出、ゼロクロス検出、電源監視、タッチ入力など幅広い用途に使われます。MCX A153 の LPCMP は内蔵 8bit DAC と 8ch アナログマルチプレクサを備えており、外付け部品を増やすことなくしきい値比較が可能です。 本サンプルは、CMP0 の正入力 (P2_2 / CMP0_IN0) に外部電圧 (VDD または GND)、負入力に内蔵 DAC 出力 (≒ VREFI/2 = VDD/2) を割り当て、比較結果の立ち上がり/立ち下がりエッジ割り込みで LED_RED を点灯/消灯させます。 (読了:20分) 2. LPCMP の概要 LPCMP は以下のサブブロックで構成されます。 コンパレータコア: プラス入力 / マイナス入力を比較しデジタル出力 (COUT) を生成 8bit DAC: 256 タップの抵抗ラダーで Vin を分圧。VREFH0 (VDD) または VREFH1 (VREFI 入力) を Vin として選択可能 出力式: DACO = Vin / 256 × (DAC_DATA + 1) 、DAC_DATA = 0〜255 出力範囲: Vin × 1/256 〜 Vin × 256/256 (= Vin) の 256 段階 (0V は出力できない) ANMUX (PMUX / MMUX): 8:1 のアナログセレクタ。外部ピン (IN0〜IN5)、内部 DAC 出力、Reservedセレクタを正/負入力に割り当て可能 ウィンドウ / サンプリング / フィルタ: チャタリング除去、タイミング制御 出力ピン / 割り込み: CFR (立ち上がり)、CFF (立ち下がり)、RRF (出力変化) の 3 フラグ 3. 内部ブロック図   3.1 入力セレクタとコア   3.2 内蔵 DAC VRSEL = 0 で VREFH0 (VDD)、VRSEL = 1 で VREFH1 (VREFI 入力) が Vin となります。   4. MCX A153 における固有情報 項目 内容 インスタンス CMP0 (本サンプル使用), CMP1 アナログ入力ピン CMP0_IN0〜IN5 内蔵 DAC 分解能 8bit (256 段階) DAC 基準電圧 VDD (VREFH0) または VREFI 外部入力 (VREFH1) 割り込みフラグ CFR (立ち上がり), CFF (立ち下がり), RRF (出力変化) 機能クロック源 FRO12M, FRO HF, CLK_1M 等から CLOCK_AttachClk で選択 アナログ電源 SPC0 ACTIVE_CFG1 で CMP / DAC 用アナログ電源を有効化   5. サンプルの動作   5.1 配線 FRDM-MCXA153 のピンヘッダで以下のように接続します。 信号 ピン Board Location 接続先 役割 VREFI P2_7 J3-1 JP8-2 (VDD) DAC 基準電圧 Vin (= VDD) CMP0_IN0 P2_2 J2-9 VDD または GND を手動で切替 プラス入力 LED_RED P3_12 オンボード ― 比較結果の表示 J3-1 を JP8-2 (VDD) にジャンパすることで VREFI = VDD となり、内蔵 DAC の Vin が VDD になります。DAC_DATA は ((LPCMP_DCR_DAC_DATA_MASK >> SHIFT) >> 1) = 127 が設定されるため、DACO ≒ VDD/2 です。J2-9 (CMP0_IN0) を VDD に繋ぐと LED_RED 点灯、GND に繋ぐと消灯します。   5.2 シーケンス   5.3 比較結果の挙動   6. クロック設定 LPCMP はバスクロックとは別に、サンプリング/フィルタ用の機能クロック (CMP_FUNC) を要求します。また、アナログ回路のため SPC (System Power Controller) で CMP / DAC 用アナログ電源を有効化する必要があります。 hardware_init.c の該当コードは以下の 3 行です。 CLOCK_AttachClk(kFRO12M_to_CMP0); /* 1) 機能クロックソースを選択 */ CLOCK_SetClockDiv(kCLOCK_DivCMP0_FUNC, 1U); /* 2) 分周を 1 に設定 (12MHz のまま) */ SPC0->ACTIVE_CFG1 |= ((1U << 16U) | (1U << 20U)); /* 3) CMP0/DAC0 アナログ電源 ON */ SPC0->ACTIVE_CFG1 レジスタの構造 6.1 クロックツリー MCX A153 リファレンスマニュアル Figure 46参照。 6.2 SPC ACTIVE_CFG1 の該当ビット ビット 内容 bit16 (CMP0_AEN) Active モードで CMP0 アナログ回路を有効化 bit20 (CMP0_DAC_AEN) Active モードで CMP0 内蔵 DAC を有効化 この 2 ビットを立て忘れると、 LPCMP_Init() 自体はエラーにならないものの、比較結果が常に 0 のまま、あるいは DAC 出力が立ち上がらないという症状になります。 7. PINMUX 設定 pin_mux.c では以下 4 系統 (計 5 ピン) をセットアップしています。 ピン 機能 ALT 設定ポイント P2_2 CMP0_IN0 (アナログ入力) ALT0 Pull-Down、Input Buffer Disable P2_7 VREFI (DAC 基準電圧) ALT0 Pull-Disable、Input Buffer Disable P3_12 GPIO (LED_RED) ALT0 出力、初期値 1 (消灯) P0_2 LPUART0_RX ALT2 Pull-Up P0_3 LPUART0_TX ALT2 Pull-Up   7.1 アナログピンでの注意点 アナログ入力として使う P2_2 / P2_7 では、必ずデジタル Input Buffer を Disable にします。これを有効のままにすると、入力電圧がロジック閾値付近を通過するたびにシュートスルー電流が流れ、消費電流増加や発熱、さらにアナログ信号の歪みに繋がります。 const port_pin_config_t port2_2_pin16_config = { kPORT_PullDown, kPORT_LowPullResistor, kPORT_FastSlewRate, kPORT_PassiveFilterDisable, kPORT_OpenDrainDisable, kPORT_LowDriveStrength, kPORT_NormalDriveStrength, kPORT_MuxAlt0, kPORT_InputBufferDisable, /* <-- 必須 */ kPORT_UnlockRegister, }; PORT_SetPinConfig(PORT2, 2U, &port2_2_pin16_config);   7.2 PORT / GPIO クロックとリセット解除 PINMUX を触る前に、使用する PORT と GPIO にクロックを供給し、リセットを解除する必要があります。 CLOCK_EnableClock(kCLOCK_GatePORT0); CLOCK_EnableClock(kCLOCK_GatePORT2); CLOCK_EnableClock(kCLOCK_GatePORT3); CLOCK_EnableClock(kCLOCK_GateGPIO3); RESET_ReleasePeripheralReset(kPORT0_RST_SHIFT_RSTn); RESET_ReleasePeripheralReset(kPORT2_RST_SHIFT_RSTn); RESET_ReleasePeripheralReset(kPORT3_RST_SHIFT_RSTn); RESET_ReleasePeripheralReset(kGPIO3_RST_SHIFT_RSTn); これを忘れると GPIOレジスタへの書き込みでフォルトが発生する、または書いても反映されない現象が起こります。 8. SDK API を用いたコード解説   8.1 app.h の定義 #define DEMO_LPCMP_BASE CMP0 #define DEMO_LPCMP_USER_CHANNEL 0U /* CMP0_IN0 */ #define DEMO_LPCMP_DAC_CHANNEL 7U /* 内蔵 DAC 出力の MUX チャネル */ #define DEMO_LPCMP_IRQ_ID CMP0_IRQn #define DEMO_LPCMP_IRQ_HANDLER_FUNC CMP0_IRQHandler   8.2 main() 中の初期化シーケンス lpcmp_config_t mLpcmpConfigStruct; lpcmp_dac_config_t mLpcmpDacConfigStruct; BOARD_InitHardware(); /* clocks + pinmux + console */ /* 1) デフォルト設定を取得し、必要箇所だけ上書き */ LPCMP_GetDefaultConfig(&mLpcmpConfigStruct); /* 2) コンパレータ初期化 */ LPCMP_Init(DEMO_LPCMP_BASE, &mLpcmpConfigStruct); /* 3) 内蔵 DAC 設定: Vin = VREFI(=VDD), DAC_DATA = 127 (フルスケールの半分) * DACO = VREFI / 256 * (127 + 1) = VREFI * 128/256 = VREFI/2 */ mLpcmpDacConfigStruct.enableLowPowerMode = false; mLpcmpDacConfigStruct.referenceVoltageSource = kLPCMP_VrefSourceVin2; /* VREFI */ mLpcmpDacConfigStruct.DACValue = ((LPCMP_DCR_DAC_DATA_MASK >> LPCMP_DCR_DAC_DATA_SHIFT) >> 1U); /* = 127 */ LPCMP_SetDACConfig(DEMO_LPCMP_BASE, &mLpcmpDacConfigStruct); /* 4) PMUX = IN0, MMUX = DAC ch7 */ LPCMP_SetInputChannels(DEMO_LPCMP_BASE, DEMO_LPCMP_USER_CHANNEL, DEMO_LPCMP_DAC_CHANNEL); /* 5) 立ち上がり/立ち下がり両エッジ割り込みを有効化 */ LPCMP_EnableInterrupts(DEMO_LPCMP_BASE, kLPCMP_OutputRisingInterruptEnable | kLPCMP_OutputFallingInterruptEnable); EnableIRQ(DEMO_LPCMP_IRQ_ID); while (1) { } /* あとは割り込み駆動 */   8.3 割り込みハンドラ void DEMO_LPCMP_IRQ_HANDLER_FUNC(void) { LPCMP_ClearStatusFlags(DEMO_LPCMP_BASE, kLPCMP_OutputRisingEventFlag | kLPCMP_OutputFallingEventFlag); if (kLPCMP_OutputAssertEventFlag == (kLPCMP_OutputAssertEventFlag & LPCMP_GetStatusFlags(DEMO_LPCMP_BASE))) { LED_ON(); /* V+ > V- (COUT=1) : LED 点灯 */ } else { LED_OFF(); /* V+ < V- (COUT=0) : LED 消灯 */ } SDK_ISR_EXIT_BARRIER; } Rising / Falling どちらの割り込みでも一旦両方のフラグをクリアし、その後 kLPCMP_OutputAssertEventFlag (= 現在の COUT) を見て LED をオン/オフ分岐します。   9. 動かし方 frdmmcxa153_lpcmp_interrupt を IDE で開きビルド J3-1 (P2_7 / VREFI) を JP8-2 (VDD) にジャンパ して VREFI = VDD にする ターゲットに書き込み、ターミナル (115200 bps) を開く J2-9 (P2_2 / CMP0_IN0) をジャンパ線で VDD に接続 → LED_RED 点灯 同ピンを GND に繋ぎ替え → LED_RED 消灯   10. よくあるつまずき 症状 原因 対処 LPCMPの出力が切り替わらない SPC0 ACTIVE_CFG1 の CMP0/DAC アナログ電源有効化忘れ SPC0->ACTIVE_CFG1 |= (1<<16) 割り込みが入らない LPCMP_EnableInterrupts または EnableIRQ(CMP0_IRQn) 漏れ 両方の呼び出しを確認 DAC 出力が立ち上がらない VRSEL と VREFI 入力ピンの不一致、VREFI 未接続 kLPCMP_VrefSourceVin2 使用時は P2_7 に基準電圧を印加 しきい値付近でチャタリング ヒステリシス 0、フィルタ無効 hysteresisMode を Level1〜3 に、またはフィルタ有効化 GPIOレジスタ書き込みでフォルト PORT クロック未供給 / リセット未解除 CLOCK_EnableClock() と RESET_ReleasePeripheralReset() の呼び出しを確認   11. まとめ MCX A153 の LPCMP は、以下の特徴を持ちます。 8 入力 ANMUX + 内蔵 8bit DAC により外付け回路最小でしきい値比較が可能 DAC 出力は DACO = Vin/256 × (DAC_DATA + 1) (DAC_DATA = 0〜255) で、Vin×1/256 〜 Vin の 256 段階 低消費電力モードやヒステリシス、フィルタ機能を SDK API 1 行で設定可能 使用するには  (1) 機能クロック Attach + Divider  (2) SPC アナログ電源 Enable  (3) アナログピンの Input Buffer Disable の 3 点が必須 本サンプルは最小構成ですが、しきい値を DAC で動的に変える、ウィンドウモードを使う、割り込みの代わりに DMA / 外部トリガとして使用するといった拡張も可能です。LPCMP を使うアプリ開発の出発点として本記事がお役に立てば幸いです。 ========================= 本投稿の「Comment」欄にコメントをいただいても、現在返信に対応しておりません。 お手数をおかけしますが、お問い合わせの際には「NXPへの技術質問 - 問い合わせ方法 (日本語ブログ)」をご参照ください。 (既に弊社NXP代理店、もしくはNXPとお付き合いのある方は、直接担当者へご質問いただいてもかまいません。) 本記事では、NXP MCX A シリーズ (MCX A153) に搭載されている LPCMP (Low-Power Comparator) を、MCUXpresso SDK の frdmmcxa153_lpcmp_interrupt サンプルと、FRDM-MCXA153ボードを題材に解説します。 LPCMP は 2 つのアナログ入力の大小関係を比較し、結果をデジタル出力として得る周辺機能で、しきい値検出、ゼロクロス検出、電源監視、タッチ入力など幅広い用途に使われます。MCX A153 の LPCMP は内蔵 8bit DAC と 8ch アナログマルチプレクサを備えており、外付け部品を増やすことなくしきい値比較が可能です。 本サンプルは、CMP0 の正入力 (P2_2 / CMP0_IN0) に外部電圧 (VDD または GND)、負入力に内蔵 DAC 出力 (≒ VREFI/2 = VDD/2) を割り当て、比較結果の立ち上がり/立ち下がりエッジ割り込みで LED_RED を点灯/消灯させます。 (読了:20分) MCUXpresso SDK MCX 日本語ブログ
View full article
[MCX A153] LPCMP Beginner's Guide (Japanese Blog) 1. Introduction This article explains the LPCMP ( Low - Power Compulator ) included in the NXP MCX A series ( MCX A153 ), using the sample from the MCUXpresso SDK frdmmcxa153_lpcmp_interrupt and the FRDM-MCXA153 board as examples. LPCMP is a peripheral function that compares the relative magnitudes of two analog inputs and obtains the result as a digital output. It is used in a wide range of applications, including threshold detection, zero-crossing detection, power supply monitoring, and touch input. The MCX A153's LPCMP features a built-in 8-bit DAC and 8-channel analog multiplexer, enabling threshold comparison without the need for additional external components. This sample assigns an external voltage (VDD or GND) to the positive input (P2_2 / CMP0_IN0) of CMP0 and the internal DAC output (≒ VREFI/2 = VDD/2) to the negative input, and turns the LED_RED on/off using rising/falling edge interrupts of the comparison result. (Reading time: 20 minutes) 2. Overview of LPCMP LPCMP consists of the following subblocks: Comparator core : Compares positive and negative inputs to generate a digital output (COUT). 8-bit DAC : Vin is divided using a 256-tap resistor ladder. VREFH0 (VDD) or VREFH1 (VREFI input) can be selected as Vin. Output formula: DACO = Vin / 256 × (DAC_DATA + 1) , DAC_DATA = 0 to 255 Output range: 256 levels from Vin × 1/256 to Vin × 256/256 (= Vin) (0V cannot be output) ANMUX (PMUX / MMUX) : 8:1 analog selector. External pins (IN0-IN5), internal DAC output, and Reserved selector can be assigned to positive/negative inputs. Window / Sampling / Filter : Debouncing, Timing Control Output pin / Interrupt : Three flags: CFR (rising edge), CFF (falling edge), RRF (output change). 3. Internal Block Diagram   3.1 Input Selector and Core   3.2 Built-in DAC When VRSEL = 0, VREFH0 (VDD) becomes Vin, and when VRSEL = 1, VREFH1 (VREFI input) becomes Vin.   4. Unique information in MCX A153 item Content instance CMP0 (used in this sample), CMP1 Analog input pins CMP0_IN0~IN5 Built-in DAC resolution 8-bit (256 levels) DAC reference voltage VDD (VREFH0) or VREFI external input (VREFH1) Interrupt flag CFR (Climate Change), CFF (Climate Fall), RRF (Reduced Output Frequency) Functional clock source Select from FRO12M, FRO HF, CLK_1M, etc. using CLOCK_AttachClk Analog power supply Enable the analog power supply for the CMP/DAC using SPC0 ACTIVE_CFG1.   5. Sample Operation   5.1 Wiring Connect the FRDM-MCXA153 pin headers as follows: signal pin Board Location Destination role VREFI P2_7 J3-1 JP8-2 (VDD) DAC reference voltage Vin (= VDD) CMP0_IN0 P2_2 J2-9 Manually switch between VDD and GND. Plus input LED_RED P3_12 Onboard ― Displaying comparison results By jumpering J3-1 to JP8-2 (VDD), VREFI = VDD, and the Vin of the built-in DAC becomes VDD. DAC_DATA is set to ((LPCMP_DCR_DAC_DATA_MASK >> SHIFT) >> 1) = 127, so DACO ≈ VDD/2. Connecting J2-9 (CMP0_IN0) to VDD lights up LED_RED, and connecting it to GND turns it off.   5.2 Sequence   5.3 Behavior of Comparison Results   6. Clock settings The LPCMP requires a separate function clock (CMP_FUNC) for sampling/filtering, in addition to the bus clock. Furthermore, because it's an analog circuit, the analog power supply for the CMP/DAC must be enabled in the SPC (System Power Controller). hardware_init.c The relevant code is the following three lines: CLOCK_AttachClk(kFRO12M_to_CMP0); /* 1) 機能クロックソースを選択 */ CLOCK_SetClockDiv(kCLOCK_DivCMP0_FUNC, 1U); /* 2) 分周を 1 に設定 (12MHz のまま) */ SPC0->ACTIVE_CFG1 |= ((1U << 16U) | (1U << 20U)); /* 3) CMP0/DAC0 アナログ電源 ON */ Structure of the SPC0->ACTIVE_CFG1 register 6.1 Clock Tree Refer to Figure 46 in the MCX A153 Reference Manual . 6.2 The corresponding bit of SPC ACTIVE_CFG1 bit Content bit16 (CMP0_AEN) Enable the CMP0 analog circuit in Active mode. bit20 (CMP0_DAC_AEN) Enable the CMP0's built-in DAC in Active mode. If you forget to set these two bits, LPCMP_Init() itself won't cause an error, but the comparison result will always remain 0, or the DAC output will not start up. 7. PINMUX Settings pin_mux.c We have set up the following four systems (a total of 5 pins). pin function ALT Setting points P2_2 CMP0_IN0 (analog input) ALT0 Pull-Down, Input Buffer Disable P2_7 VREFI (DAC Reference Voltage) ALT0 Pull-Disable, Input Buffer Disable P3_12 GPIO (LED_RED) ALT0 Output, initial value 1 (light off) P0_2 LPUART0_RX ALT2 Pull-Up P0_3 LPUART0_TX ALT2 Pull-Up   7.1 Precautions when using analog pins When using P2_2 / P2_7 as analog inputs, be sure to disable the digital input buffer . If it is left enabled, a shoot-through current will flow every time the input voltage passes near the logic threshold, leading to increased current consumption, heat generation, and distortion of the analog signal. const port_pin_config_t port2_2_pin16_config = { kPORT_PullDown, kPORT_LowPullResistor, kPORT_FastSlewRate, kPORT_PassiveFilterDisable, kPORT_OpenDrainDisable, kPORT_LowDriveStrength, kPORT_NormalDriveStrength, kPORT_MuxAlt0, kPORT_InputBufferDisable, /* <-- 必須 */ kPORT_UnlockRegister, }; PORT_SetPinConfig(PORT2, 2U, &port2_2_pin16_config);   7.2 PORT / GPIO Clock and Reset Release Before touching PINMUX, you need to supply a clock to the PORT and GPIO you will be using and disable the reset. CLOCK_EnableClock(kCLOCK_GatePORT0); CLOCK_EnableClock(kCLOCK_GatePORT2); CLOCK_EnableClock(kCLOCK_GatePORT3); CLOCK_EnableClock(kCLOCK_GateGPIO3); RESET_ReleasePeripheralReset(kPORT0_RST_SHIFT_RSTn); RESET_ReleasePeripheralReset(kPORT2_RST_SHIFT_RSTn); RESET_ReleasePeripheralReset(kPORT3_RST_SHIFT_RSTn); RESET_ReleasePeripheralReset(kGPIO3_RST_SHIFT_RSTn); Forgetting this will result in a fault occurring when writing to the GPIO register, or the changes being written not being reflected. 8. Code Explanation Using the SDK API   8.1 Definition of app.h #define DEMO_LPCMP_BASE CMP0 #define DEMO_LPCMP_USER_CHANNEL 0U /* CMP0_IN0 */ #define DEMO_LPCMP_DAC_CHANNEL 7U /* 内蔵 DAC 出力の MUX チャネル */ #define DEMO_LPCMP_IRQ_ID CMP0_IRQn #define DEMO_LPCMP_IRQ_HANDLER_FUNC CMP0_IRQHandler   8.2 Initialization Sequence in main() lpcmp_config_t mLpcmpConfigStruct; lpcmp_dac_config_t mLpcmpDacConfigStruct; BOARD_InitHardware(); /* clocks + pinmux + console */ /* 1) デフォルト設定を取得し、必要箇所だけ上書き */ LPCMP_GetDefaultConfig(&mLpcmpConfigStruct); /* 2) コンパレータ初期化 */ LPCMP_Init(DEMO_LPCMP_BASE, &mLpcmpConfigStruct); /* 3) 内蔵 DAC 設定: Vin = VREFI(=VDD), DAC_DATA = 127 (フルスケールの半分) * DACO = VREFI / 256 * (127 + 1) = VREFI * 128/256 = VREFI/2 */ mLpcmpDacConfigStruct.enableLowPowerMode = false; mLpcmpDacConfigStruct.referenceVoltageSource = kLPCMP_VrefSourceVin2; /* VREFI */ mLpcmpDacConfigStruct.DACValue = ((LPCMP_DCR_DAC_DATA_MASK >> LPCMP_DCR_DAC_DATA_SHIFT) >> 1U); /* = 127 */ LPCMP_SetDACConfig(DEMO_LPCMP_BASE, &mLpcmpDacConfigStruct); /* 4) PMUX = IN0, MMUX = DAC ch7 */ LPCMP_SetInputChannels(DEMO_LPCMP_BASE, DEMO_LPCMP_USER_CHANNEL, DEMO_LPCMP_DAC_CHANNEL); /* 5) 立ち上がり/立ち下がり両エッジ割り込みを有効化 */ LPCMP_EnableInterrupts(DEMO_LPCMP_BASE, kLPCMP_OutputRisingInterruptEnable | kLPCMP_OutputFallingInterruptEnable); EnableIRQ(DEMO_LPCMP_IRQ_ID); while (1) { } /* あとは割り込み駆動 */   8.3 Interrupt Handlers void DEMO_LPCMP_IRQ_HANDLER_FUNC(void) { LPCMP_ClearStatusFlags(DEMO_LPCMP_BASE, kLPCMP_OutputRisingEventFlag | kLPCMP_OutputFallingEventFlag); if (kLPCMP_OutputAssertEventFlag == (kLPCMP_OutputAssertEventFlag & LPCMP_GetStatusFlags(DEMO_LPCMP_BASE))) { LED_ON(); /* V+ > V- (COUT=1) : LED 点灯 */ } else { LED_OFF(); /* V+ < V- (COUT=0) : LED 消灯 */ } SDK_ISR_EXIT_BARRIER; } In both rising and falling interrupts, both flags are cleared first, and then the LED is branched on/off based on kLPCMP_OutputAssertEventFlag (= current COUT).   9. How to operate frdmmcxa153_lpcmp_interrupt Open it in the IDE and build it. Jumper J3-1 (P2_7 / VREFI) to JP8-2 (VDD) to set VREFI = VDD. Write to the target and open a terminal (115200 bps). Connect J2-9 (P2_2 / CMP0_IN0) to VDD with a jumper wire → LED_RED lights up. Reconnect the same pin to GND → LED_RED turns off   10. Common stumbling blocks Symptoms cause handle The LPCMP output is not switching. Forgot to enable the analog power supply for CMP0/DAC in SPC0 ACTIVE_CFG1. SPC0->ACTIVE_CFG1 |= (1<<16) No interruption LPCMP_EnableInterrupts or EnableIRQ(CMP0_IRQn) leak Check both calls DAC output does not start up. VRSEL and VREFI input pin mismatch, VREFI not connected kLPCMP_VrefSourceVin2 When in use, apply the reference voltage to P2_7. Chattering near the threshold Hysteresis 0, filter disabled hysteresisMode Set to Level 1-3, or enable filtering. Fault when writing to GPIO registers PORT clock not supplied / Reset not released CLOCK_EnableClock() And confirm the call to RESET_ReleasePeripheralReset()   11. Summary The LPCMP in the MCX A153 has the following characteristics: With 8 ANMUX inputs and a built-in 8-bit DAC, threshold comparison is possible with minimal external circuitry. The DAC output is DACO = Vin/256 × (DAC_DATA + 1) (DAC_DATA = 0 to 255), with 256 steps ranging from Vin × 1/256 to Vin. Low-power mode, hysteresis, and filtering functions can be configured with a single line of SDK API code. To use (1) Functional Clock Attachment + Divider (2) SPC Analog Power Supply Enable (3) Disable the Input Buffer for analog pins These three points are essential. This sample uses a minimal configuration, but it can be extended to dynamically change thresholds with a DAC, use window mode, or use DMA/external triggers instead of interrupts. We hope this article will be helpful as a starting point for developing applications that use LPCMP. ========================= We are currently unable to respond to comments left in the "Comment" section of this post. We apologize for the inconvenience, but please refer to " Technical Questions to NXP - How to Contact Us( Japanese Blog) " when making an inquiry. (If you are already an NXP distributor or have a relationship with NXP, you may ask your representative directly.) This article explains the LPCMP ( Low - Power Compulator ) included in the NXP MCX A series ( MCX A153 ), using the sample from the MCUXpresso SDK frdmmcxa153_lpcmp_interrupt and the FRDM-MCXA153 board as examples. LPCMP is a peripheral function that compares the relative magnitudes of two analog inputs and obtains the result as a digital output. It is used in a wide range of applications, including threshold detection, zero-crossing detection, power supply monitoring, and touch input. The MCX A153's LPCMP features a built-in 8-bit DAC and 8-channel analog multiplexer, enabling threshold comparison without the need for additional external components. This sample assigns an external voltage (VDD or GND) to the positive input (P2_2 / CMP0_IN0) of CMP0 and the internal DAC output (≒ VREFI/2 = VDD/2) to the negative input, and turns the LED_RED on/off using rising/falling edge interrupts of the comparison result. (Reading time: 20 minutes) MCUXpresso SDK MCX Japanese Blog
View full article
[MCX A153] LPCMP 新手指南(日语博客) 1. 引言 本文以 MCUXpresso SDK 中的 示例和 frdmmcxa153_lpcmp_interrupt FRDM-MCXA153 板为例,解释了 NXP MCX A 系列( MCX A153 ) 中包含的 LPCMP( 低 功耗 计算器 )。 LPCMP 是一种外设功能,用于比较两个模拟输入信号的相对幅度,并将结果以数字输出的形式呈现。它广泛应用于各种场景,包括阈值检测、过零检测、电源监控和触摸输入。MCX A153 的 LPCMP 内置 8 位 DAC 和 8 通道模拟多路复用器,无需额外的外部元件即可实现阈值比较。 此示例将外部电压(VDD 或 GND)分配给 CMP0 的正输入端(P2_2 / CMP0_IN0),将内部 DAC 输出(≒ VREFI/2 = VDD/2)分配给负输入端,并使用比较结果的上升沿/下降沿中断来打开/关闭 LED_RED。 (阅读时间:20分钟) 2. LPCMP概述 LPCMP由以下子模块组成: 比较器核心:比较正负输入以生成数字输出(COUT)。 8 位 DAC :输入电压 Vin 通过 256 抽头电阻梯形电路进行分压。VREFH0 (VDD) 或 VREFH1 (VREFI 输入) 可选择作为输入电压 Vin。 输出公式: DACO = Vin / 256 × (DAC_DATA + 1) ,DAC_DATA = 0 到 255 输出范围:256 级,从 Vin × 1/256 到 Vin × 256/256 (= Vin) (不能输出 0V) ANMUX(PMUX / MMUX) :8:1 模拟选择器。外部引脚(IN0-IN5)、内部 DAC 输出和保留选择器可分配给正/负输入。 窗口/采样/滤波器:去抖动、时序控制 输出引脚/中断:三个标志:CFR(上升沿)、CFF(下降沿)、RRF(输出变化)。 3. 内部框图   3.1 输入选择器和核心   3.2 内置DAC 当 VRSEL = 0 时,VREFH0 (VDD) 变为 Vin;当 VRSEL = 1 时,VREFH1 (VREFI 输入) 变为 Vin。   4. MCX A153 中的独特信息 项目 内容 实例 CMP0(本样本中使用),CMP1 模拟输入引脚 CMP0_IN0~IN5 内置DAC分辨率 8 位(256 级) DAC参考电压 VDD (VREFH0) 或 VREFI 外部输入 (VREFH1) 中断标志 CFR(气候变化)、CFF(气候下降)、RRF(降低输出频率) 功能时钟源 使用 CLOCK_AttachClk 模拟电源 使用 SPC0 ACTIVE_CFG1 启用 CMP/DAC 的模拟电源。   5. 示例操作   5.1 接线 按如下方式连接 FRDM-MCXA153 引脚接头: 信号 别针 董事会位置 目的地 角色 VREFI P2_7 J3-1 JP8-2(VDD) DAC参考电压Vin(= VDD) CMP0_IN0 P2_2 J2-9 手动切换VDD和GND。 加输入 红色 LED P3_12 机上 — 显示对比结果 将 J3-1 跳线连接到 JP8-2 (VDD) 后,VREFI = VDD,内置 DAC 的输入电压 (Vin) 变为 VDD。DAC_DATA 设置为 ((LPCMP_DCR_DAC_DATA_MASK >> SHIFT) >> 1) = 127,因此 DACO ≈ VDD/2。将 J2-9 (CMP0_IN0) 连接到 VDD 会点亮 LED_RED,将其连接到 GND 则会熄灭 LED_RED。   5.2 序列   5.3 对比结果的行为   6. 时钟设置 除了总线时钟外,LPCMP 还需要一个单独的功能时钟 (CMP_FUNC) 用于采样/滤波。此外,由于它是模拟电路,因此必须在 SPC(系统电源控制器)中启用 CMP/DAC 的模拟电源。 hardware_init.c 相关代码如下三行: CLOCK_AttachClk(kFRO12M_to_CMP0); /* 1) 機能クロックソースを選択 */ CLOCK_SetClockDiv(kCLOCK_DivCMP0_FUNC, 1U); /* 2) 分周を 1 に設定 (12MHz のまま) */ SPC0->ACTIVE_CFG1 |= ((1U << 16U) | (1U << 20U)); /* 3) CMP0/DAC0 アナログ電源 ON */ SPC0->ACTIVE_CFG1 寄存器的结构 6.1 时钟树 请参阅MCX A153 参考手册中的图 46。 6.2 SPC ACTIVE_CFG1 的对应位 少量 内容 bit16 (CMP0_AEN) 使 CMP0 模拟电路处于激活状态。 bit20 (CMP0_DAC_AEN) 启用 CMP0 的内置 DAC 并进入激活模式。 如果忘记设置这两个位, LPCMP_Init() 本身不会导致错误,但比较结果将始终为 0,或者 DAC 输出将不会启动。 7. 引脚复用设置 pin_mux.c 我们设置了以下四个系统(共 5 个引脚)。 别针 功能 备用 设置要点 P2_2 CMP0_IN0(模拟输入) 谷丙转氨酶0 下拉输入缓冲区禁用 P2_7 VREFI(DAC 参考电压) 谷丙转氨酶0 拉取禁用,输入缓冲区禁用 P3_12 GPIO(LED_RED) 谷丙转氨酶0 输出,初始值为 1(灯灭) P0_2 LPUART0_RX ALT2 引体向上 P0_3 LPUART0_TX ALT2 引体向上   7.1 使用模拟引脚时的注意事项 当使用 P2_2 / P2_7 作为模拟输入时,请务必禁用数字输入缓冲器。如果启用该缓冲器,则每次输入电压接近逻辑阈值时都会产生直通电流,导致电流消耗增加、发热增多以及模拟信号失真。 const port_pin_config_t port2_2_pin16_config = { kPORT_PullDown, kPORT_LowPullResistor, kPORT_FastSlewRate, kPORT_PassiveFilterDisable, kPORT_OpenDrainDisable, kPORT_LowDriveStrength, kPORT_NormalDriveStrength, kPORT_MuxAlt0, kPORT_InputBufferDisable, /* <-- 必須 */ kPORT_UnlockRegister, }; PORT_SetPinConfig(PORT2, 2U, &port2_2_pin16_config);   7.2 端口/GPIO 时钟和复位释放 在操作 PINMUX 之前,需要为要使用的端口和 GPIO 提供时钟信号,并禁用复位功能。 CLOCK_EnableClock(kCLOCK_GatePORT0); CLOCK_EnableClock(kCLOCK_GatePORT2); CLOCK_EnableClock(kCLOCK_GatePORT3); CLOCK_EnableClock(kCLOCK_GateGPIO3); RESET_ReleasePeripheralReset(kPORT0_RST_SHIFT_RSTn); RESET_ReleasePeripheralReset(kPORT2_RST_SHIFT_RSTn); RESET_ReleasePeripheralReset(kPORT3_RST_SHIFT_RSTn); RESET_ReleasePeripheralReset(kGPIO3_RST_SHIFT_RSTn); 如果忘记这一点,在写入 GPIO 寄存器时将会出现故障,或者写入的更改不会反映出来。 8. 使用 SDK API 的代码说明   8.1 app.h 的定义 #define DEMO_LPCMP_BASE CMP0 #define DEMO_LPCMP_USER_CHANNEL 0U /* CMP0_IN0 */ #define DEMO_LPCMP_DAC_CHANNEL 7U /* 内蔵 DAC 出力の MUX チャネル */ #define DEMO_LPCMP_IRQ_ID CMP0_IRQn #define DEMO_LPCMP_IRQ_HANDLER_FUNC CMP0_IRQHandler   8.2 main() 函数中的初始化顺序 lpcmp_config_t mLpcmpConfigStruct; lpcmp_dac_config_t mLpcmpDacConfigStruct; BOARD_InitHardware(); /* clocks + pinmux + console */ /* 1) デフォルト設定を取得し、必要箇所だけ上書き */ LPCMP_GetDefaultConfig(&mLpcmpConfigStruct); /* 2) コンパレータ初期化 */ LPCMP_Init(DEMO_LPCMP_BASE, &mLpcmpConfigStruct); /* 3) 内蔵 DAC 設定: Vin = VREFI(=VDD), DAC_DATA = 127 (フルスケールの半分) * DACO = VREFI / 256 * (127 + 1) = VREFI * 128/256 = VREFI/2 */ mLpcmpDacConfigStruct.enableLowPowerMode = false; mLpcmpDacConfigStruct.referenceVoltageSource = kLPCMP_VrefSourceVin2; /* VREFI */ mLpcmpDacConfigStruct.DACValue = ((LPCMP_DCR_DAC_DATA_MASK >> LPCMP_DCR_DAC_DATA_SHIFT) >> 1U); /* = 127 */ LPCMP_SetDACConfig(DEMO_LPCMP_BASE, &mLpcmpDacConfigStruct); /* 4) PMUX = IN0, MMUX = DAC ch7 */ LPCMP_SetInputChannels(DEMO_LPCMP_BASE, DEMO_LPCMP_USER_CHANNEL, DEMO_LPCMP_DAC_CHANNEL); /* 5) 立ち上がり/立ち下がり両エッジ割り込みを有効化 */ LPCMP_EnableInterrupts(DEMO_LPCMP_BASE, kLPCMP_OutputRisingInterruptEnable | kLPCMP_OutputFallingInterruptEnable); EnableIRQ(DEMO_LPCMP_IRQ_ID); while (1) { } /* あとは割り込み駆動 */   8.3 中断处理程序 void DEMO_LPCMP_IRQ_HANDLER_FUNC(void) { LPCMP_ClearStatusFlags(DEMO_LPCMP_BASE, kLPCMP_OutputRisingEventFlag | kLPCMP_OutputFallingEventFlag); if (kLPCMP_OutputAssertEventFlag == (kLPCMP_OutputAssertEventFlag & LPCMP_GetStatusFlags(DEMO_LPCMP_BASE))) { LED_ON(); /* V+ > V- (COUT=1) : LED 点灯 */ } else { LED_OFF(); /* V+ < V- (COUT=0) : LED 消灯 */ } SDK_ISR_EXIT_BARRIER; } 在上升沿和下降沿中断中,两个标志位都会被清除,然后根据 kLPCMP_OutputAssertEventFlag (= 当前 COUT)来控制 LED 的开/关状态。   9. 如何操作 frdmmcxa153_lpcmp_interrupt 在 IDE 中打开并构建。 将跳线 J3-1 (P2_7 / VREFI) 连接到 JP8-2 (VDD)以设置 VREFI = VDD。 向目标写入数据并打开终端(115200 bps)。 用跳线将 J2-9 (P2_2 / CMP0_IN0) 连接到 VDD → LED_RED 亮起。 将同一引脚重新连接到 GND → 红色 LED 熄灭   10. 常见的绊脚石 症状 原因 处理 LPCMP 输出未切换。 忘记在 SPC0 ACTIVE_CFG1 中启用 CMP0/DAC 的模拟电源。 SPC0->ACTIVE_CFG1 |= (1<<16) 无中断 LPCMP_EnableInterrupts 或 EnableIRQ(CMP0_IRQn) 泄漏 检查这两个电话 DAC 输出无法启动。 VRSEL 和 VREFI 输入引脚不匹配,VREFI 未连接 kLPCMP_VrefSourceVin2 使用时,将参考电压施加到 P2_7。 门槛附近传来一阵嘈杂声 滞后为 0,滤波器已禁用 hysteresisMode 设置为 1-3 级,或启用筛选功能。 写入GPIO寄存器时发生故障 端口时钟未提供/复位未释放 CLOCK_EnableClock() 并确认对 RESET_ReleasePeripheralReset() 调用   11. 总结 MCX A153 中的 LPCMP 具有以下特点: 它具有 8 个 ANMUX 输入和一个内置的 8 位 DAC,只需极少的外部电路即可进行阈值比较。 DAC 输出为 DACO = Vin/256 × (DAC_DATA + 1) (DAC_DATA = 0 到 255),有 256 个步长,范围从 Vin × 1/256 到 Vin。 低功耗模式、迟滞和滤波功能可以通过一行 SDK API 代码进行配置。 使用 (1)功能性时钟附件+分隔线 (2)SPC模拟电源使能 (3)禁用模拟引脚的输入缓冲器 这三点至关重要。 本示例采用最小配置,但可以扩展以实现以下功能:使用数模转换器 (DAC) 动态更改阈值、使用窗口模式,或使用 DMA/外部触发器代替中断。我们希望本文能为开发使用 LPCMP 的应用程序提供起点。 ========================= 即使您在本文的“评论”栏留言,我们目前也无法回复。 给您带来不便,我们深感抱歉。请在询问时参阅“NXP技术问题-联系方式(日本博客)”。 (如果您已经是NXP的代理商或与其有合作关系,可以直接向负责人咨询。) 本文以 MCUXpresso SDK 中的 示例和 frdmmcxa153_lpcmp_interrupt FRDM-MCXA153 板为例,解释了 NXP MCX A 系列( MCX A153 ) 中包含的 LPCMP( 低 功耗 计算器 )。 LPCMP 是一种外设功能,用于比较两个模拟输入信号的相对幅度,并将结果以数字输出的形式呈现。它广泛应用于各种场景,包括阈值检测、过零检测、电源监控和触摸输入。MCX A153 的 LPCMP 内置 8 位 DAC 和 8 通道模拟多路复用器,无需额外的外部元件即可实现阈值比较。 此示例将外部电压(VDD 或 GND)分配给 CMP0 的正输入端(P2_2 / CMP0_IN0),将内部 DAC 输出(≒ VREFI/2 = VDD/2)分配给负输入端,并使用比较结果的上升沿/下降沿中断来打开/关闭 LED_RED。 (阅读时间:20分钟) MCUXpresso SDK MCX 日本博客
View full article
S32プラットフォーム上のS32 Design Studioバージョン3.4のライセンスが期限切れになりました。 私のS32 Design Studio(S32プラットフォーム用)v.3.4の有効期限が切れました。 アクティベーションコードの有効期限を延長していただけますか? S32デザインスタジオ バージョンv.3.4 注文番号: S32DS-3-4_188376977 発注番号 ライセンス総数: 101 アクティベーションコード:7EEF-99B6-BDC8-8692 Re: S32平台S32 Design Studio 3.4版本的许可证已过期。 こんにちは、 お客様のS32DSライセンスが延長されました。以前のコードを使用して、S32DSを再度有効化してください。 回复: S32平台S32 Design Studio 3.4版本的许可证已过期。 よろしくお願い申し上げます。
View full article