MCUXpresso Config Tool for MCUXpresso IDE
Clone an Example Project from MCUXpresso IDE
The following steps will guide you through the manipulation of the general-purpose outputs. The example sets up a CTimer to generate a PWM signal and change between two LEDs.
- Find the Quickstart Panel in the lower left-hand corner and click on Import SDK example(s)

- Click on the FRDM-MCXN947 board to select that you want to import an example that can run on that board, and then click on Next

- Use the arrow button to expand the
driver_examples category, then expand the ctimer examples, click on the check box next to ctimer_match_interrupt_example to select it. To use the UART for printing (instead of the default semihosting), Select UART as the SDK Debug Console checkbox under the project options. Then, click on Finish

- Click on the
“frdmmcxn947_ctimer_match_interrupt_example” project in the Project Explorer View and build, compile, and run the demo as described in the previous section

- You should see the BLUE and RED LED changing back and forth
- Terminate the debug session
Use MCUXpresso IDE Pins Tools to Modify Example
Note: Previously, you had to clone an SDK project like in the previous step.
- Open the pins tool by selecting “ConfigTools” on the top right hand of the file explorer window and then select “ Open Pins”
- The pins tool should now display the pin configuration for the ctimer project
- In the Pins view deselect “Show dedicated pins” and “Show no routed pins” checkboxes to see only the routed pins. Routed pins have a check in a green box next to the pin name. The functions selected for each routed pin are highlighted in green
- In the current configuration, PIO3_2 and PIO3_3 are routed as the outputs of the CTimer. Let’s add a third Ctimer Match output and enable the Green LED
- Select “Show no routed pins” to see the other options. To enable the third Ctimer Match Output, browse the column for Ctimer and select and output. In this example, we will select, Ctimer4 Match 2 on PIO3_6. Select the item in the Ctimer column to enable
- Now, let’s route the Green LED. In the search box type “green” so that the routed pin for this LED is shown. Finally, click the box under the GPIO column. The box will highlight in green, and a check will appear next to the pin
- Next configure the GPIO pin as an output in the “Routing Details” window
- Now it’s time to implement these changes into the project by exporting the new updated pin_mux.c and pin_mux.h files that are generated by the Pins tool. Click on Update Project in the menu bar
- The screen that pops up will show the files that are changing and you can click on “diff” to see the difference between the current file and the new file generated by the Pins tool. Click on “OK” to overwrite the new files into your project
- Let’s add some additional code to the example. Open
simple_match_interrupt.c file and add the following macros for the third ctimer output.
- Add the Green LED functions as well.
- Some additional code to be implemented will be the third ctimer’s callback, this can be copied from
ctimer_match1_callback and modify the content to match2. To be able to visually identify the new ctimer, we will remove one of the previous ctimers as shown
- The main function will need to include the initialization of both the Green LED and the Ctimer
- Build and download the project as done in the previous section
- Run the application. You should now see the Green and Blue LED blinking back and forth
- Terminate the debug session