NXP FRDM-MCXN947 board is a low-cost design and evaluation board based on the MCXN947 device. NXP provides tools and software support for the MCXN947 device, including hardware evaluation boards, software development integrated development environment (IDE), sample applications, and drivers. The board is equipped with Ethernet PHY, and also supports camera modules and NXP's low-cost LCD module PAR-LCD-S035.
In this article, we will explore how to simultaneously implement Ethernet connection transmission and image acquisition using a camera on the MCXN947 board.
When designing circuits, attention must be paid to avoiding pin conflicts, that is, ensuring that the same pin is not configured to perform conflicting functions at different times. When configuring pin functions, it is necessary to consider whether their electrical characteristics (such as voltage range, current drive capability, etc.) meet the requirements of the peripherals. When writing software, it is necessary to consider the support for pin multiplexing in different versions of MCU firmware or library files to ensure software compatibility and stability.
Import the "lwip_examples
" -> "lwip_ping_bm
" project from the FDRM-MCXN947 SDK, open the board -> pin_mux.c
file, and you can see the pin configuration for Ethernet connection as shown in the table below:
Pin Name | Pinmux Assignment |
---|---|
P1_4 | ALT9 - ENET0_TX_CLK |
P1_5 | ALT9 - ENET0_TXEN |
P1_6 | ALT9 - ENET0_TXD0 |
P1_7 | ALT9 - ENET0_TXD1 |
P1_8 | ALT9 - ENET0_TXD2 |
P1_9 | ALT9 - ENET0_TXD3 |
P1_13 | ALT9 - ENET0_RXDV |
P1_14 | ALT9 - ENET0_RXD0 |
P1_15 | ALT9 - ENET0_RXD1 |
P1_20 | ALT9 - ENET0_MDC |
P1_21 | ALT9 - ENET0_MDIO |
Download the schematic of the MCXN947 board from NXP's official website, and find the modules corresponding to Camera and FlexIO LCD, as shown below:
FlexIO is a flexible input/output (I/O) technology developed by NXP, used to provide high-speed, programmable communication capabilities between microcontrollers (MCU) and external devices. It allows developers to configure the FlexIO module inside the microcontroller to simulate various communication protocols and develop custom protocols.
Note: This LCD only supports 3V I/O voltage, so when configuring all pins on this connector, you must ensure they are all set to 3V3 operation mode.
The following diagram shows the working principle of the SDK example, where the camera collects images and transmits them to the LCD display:
It can be seen that the LCD module does not have any pin conflicts with the pins required for Ethernet and Camera functions, while the pins required for configuring the Camera module are duplicated with Ethernet. The pin reuse can be found in the datasheet provided on the NXP official website as shown in the following table:
Pin Name |
Pinmux Assignment |
P0_4 |
ALT0 - P0_4 |
P0_5 |
ALT0 - P0_5 |
P1_4 |
ALT7 - SmartDMA_PIO0 |
P1_5 |
ALT7 - SmartDMA_PIO1 |
P1_6 |
ALT7 - SmartDMA_PIO2 |
P1_7 |
ALT7 - SmartDMA_PIO3 |
P1_10 |
ALT7 - SmartDMA_PIO6 |
P1_11 |
ALT7 - SmartDMA_PIO7 |
P1_18 |
Default-PIO-Low |
P1_19 |
Default-PIO-High |
P2_2 |
ALT1 - CLKOUT |
P3_2 |
ALT2 - FC7_P0 |
P3_3 |
ALT2 - FC7_P1 |
P3_4 |
ALT7 - SmartDMA_PIO4 |
P3_5 |
ALT7 - SmartDMA_PIO5 |
As seen above, pins P1_4, P1_5, P1_6, and P1_7 conflict directly with Ethernet pins. Since Ethernet pins are fixed to the RJ45 PHY, the Camera interface must be reassigned to alternate pins.
From the datasheet, P3_0, P3_1, P3_2, and P3_3 can serve as alternatives. However, P3_2 and P3_3 are already used for I²C. To resolve this, they are reassigned to P3_8 and P3_7 respectively (using kPORT_MuxAlt3).
The updated pin mapping is shown below:
Previous Pin |
Current Pin |
Pinmux Assignment |
P1_4 |
P3_0 |
ALT7 - SmartDMA_PIO0 |
P1_5 |
P3_1 |
ALT7 - SmartDMA_PIO1 |
P1_6 |
P3_2 |
ALT7 - SmartDMA_PIO2 |
P1_7 |
P3_3 |
ALT7 - SmartDMA_PIO3 |
P3_2 |
P3_8 |
ALT3 - FC7_P0 |
P3_3 |
P3_7 |
ALT3 - FC7_P1 |
The reassigned pins (P3_0, P3_1, P3_7, P3_8) are not exposed on the board’s headers, but the schematic shows that they are connected to test pads TP12, TP31, TP18, and TP16. The camera can be wired to these pads directly.
Pin Name | Solder Pad |
---|---|
P3_0 | TP12 |
P3_1 | TP31 |
P3_7 | TP18 |
P3_8 | TP16 |
Integrate the smartdma_camera_flexio_mculcd
example from display_examples
into the lwip_ping_bm
project. Merge .c
and .h
files from board
, drivers
, component
, and source
folders. Add these folders to the include path under Project -> Properties -> C/C++ Build -> Settings -> Includes
.
After integration, compile and flash the project to the board. The output is shown in the images.
The Ethernet and Camera functions can be simultaneously implemented on the MCX N947 board. The lwip_ping_bm
demo showcases ICMP-based Ping functionality using the lwIP TCP/IP stack. It periodically sends ICMP echo requests to a PC and processes the replies.
The smartdma_camera_flexio_mculcd
demo demonstrates how to use SmartDMA to capture image data frame-by-frame from the OV7670 camera and display it on the ST7796S LCD panel via FlexIO.
By reconfiguring and multiplexing pins, simultaneous use of Ethernet and Camera on the MCX N947 is achievable.