2270225_en-US

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

2270225_en-US

2270225_en-US

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.

  1. Find the Quickstart Panel in the lower left-hand corner and click on Import SDK example(s)
    Sabina_Bruce_14-1767120564749.png
  2. 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
    Sabina_Bruce_15-1767120575767.png
  3. 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
    Sabina_Bruce_16-1767120587691.png
  4. 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
    Sabina_Bruce_17-1767120603466.png
  5. You should see the BLUE and RED LED changing back and forth
  6. Terminate the debug session

Use MCUXpresso IDE Pins Tools to Modify Example


  1. Open the pins tool by selecting “ConfigTools” on the top right hand of the file explorer window and then select “ Open Pins”
    Sabina_Bruce_2-1767120490131.png

  2. The pins tool should now display the pin configuration for the ctimer project
    Sabina_Bruce_3-1767120490074.png

  3. 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
    Sabina_Bruce_4-1767120490861.png
  4. 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
  5. 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
    Sabina_Bruce_5-1767120490102.png
  6. 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
    Sabina_Bruce_6-1767120489892.png
  7. Next configure the GPIO pin as an output in the “Routing Details” window
    Sabina_Bruce_7-1767120490064.png
  8. 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
    Sabina_Bruce_8-1767120490018.png
  9. 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
    Sabina_Bruce_9-1767120490120.png
  10. 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.
    Sabina_Bruce_10-1767120489936.png
  11. Add the Green LED functions as well.
    Sabina_Bruce_11-1767120491994.png
  12. 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
    Sabina_Bruce_12-1767120492171.png

  13. The main function will need to include the initialization of both the Green LED and the Ctimer
    Sabina_Bruce_13-1767120490811.png
  14. Build and download the project as done in the previous section
  15. Run the application. You should now see the Green and Blue LED blinking back and forth
  16. Terminate the debug session
Tags (1)
No ratings
Version history
Last update:
‎12-30-2025 12:10 PM
Updated by: