MCUXpresso SDK Documentation

plu_combination

plu_combination#

Overview#

The PLU combination project is a simple demonstration program of the SDK PLU driver. In this example, a number of GPIO pins are connected to PLU inputs and the LED is used to monitor the PLU outputs to demonstrate the configuration and use of the Programmable Logic Unit (PLU) to construct a combinational logic network.

Supported Boards#

FRDM-MCXN947
Hardware requirements
  • Type-C USB cable

  • FRDM-MCXN947 board

  • Personal Computer

Board settings

PLU input pins connection:

  • J8-23 (GPIO4_18) to J1-4 (PLU_IN2).

  • J8-24 (GPIO4_19) to J1-2 (PLU_IN3).

  • J8-25 (GPIO4_20) to J8-6 (PLU_IN5).

PLU output pins connection:

  • J8-17 (PLU_OUT0) to J2-4 (LED_RED).

  • J8-18 (PLU_OUT1) to J2-6 (LED_GREEN).

  • J8-19 (PLU_OUT2) to J1-14 (LED_BLUE).

Prepare the Demo

Note: MCUXpresso IDE project default debug console is semihost

  1. Connect a type-c USB cable between the PC host and the MCU-Link port(J17 on the board).

  2. Open a serial terminal with the following settings (See Appendix A in Getting started guide for description how to determine serial port number):

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

Expected Result

Input source and LED status table:

PLU_IN5

PLU_IN3

PLU_IN2

LED_BLUE

LED_GREEN

LED_RED

0

0

0

off

off

off

0

0

1

off

off

on

0

1

0

off

on

off

0

1

1

on

off

off

1

0

0

off

on

on

1

0

1

on

off

on

1

1

0

on

on

off

1

1

1

on

on

on

The log below shows the output of the plu combination example in the terminal window:

PLU combination driver example.

Select the input source.
1. Input source 0
2. Input source 1
3. Input source 2
4. Set all three input sources.
0
Select the input value.
0. Low level.
1. High level.
1
Select the input source.
0. Input source 0
1. Input source 1
2. Input source 2
3. Set all three input sources.
3
Input the three values like 000.
0. Low level.
1. High level.
011

The LED will change as the description in the table

FRDM-MCXN947T
Hardware requirements
  • Type-C USB cable

  • FRDM-MCXN947T board

  • Personal Computer

Board settings

PLU input pins connection:

  • J8-23 (GPIO4_18) to J1-4 (PLU_IN2).

  • J8-24 (GPIO4_19) to J1-2 (PLU_IN3).

  • J8-25 (GPIO4_20) to J8-6 (PLU_IN5).

PLU output pins connection:

  • J8-17 (PLU_OUT0) to J2-4 (LED_RED).

  • J8-18 (PLU_OUT1) to J2-6 (LED_GREEN).

  • J8-19 (PLU_OUT2) to J1-14 (LED_BLUE).

Prepare the Demo

Note: MCUXpresso IDE project default debug console is semihost

  1. Connect a type-c USB cable between the PC host and the MCU-Link port(J17 on the board).

  2. Open a serial terminal with the following settings (See Appendix A in Getting started guide for description how to determine serial port number):

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

Expected Result

Input source and LED status table:

PLU_IN5

PLU_IN3

PLU_IN2

LED_BLUE

LED_GREEN

LED_RED

0

0

0

off

off

off

0

0

1

off

off

on

0

1

0

off

on

off

0

1

1

on

off

off

1

0

0

off

on

on

1

0

1

on

off

on

1

1

0

on

on

off

1

1

1

on

on

on

The log below shows the output of the plu combination example in the terminal window:

PLU combination driver example.

Select the input source.
1. Input source 0
2. Input source 1
3. Input source 2
4. Set all three input sources.
0
Select the input value.
0. Low level.
1. High level.
1
Select the input source.
0. Input source 0
1. Input source 1
2. Input source 2
3. Set all three input sources.
3
Input the three values like 000.
0. Low level.
1. High level.
011

The LED will change as the description in the table

FRDM-MCXW23
Hardware requirements
  • Type-C USB cable

  • FRDM-MCXW23 Board

  • Personal Computer

Board settings

Since the PLU_OUT0 has no external pins on the FRDM board, so only input sources 0 and 1 are supported in this example. Therefore, the PLU_IN5 and PLU_OUT0 do not need to be connected.

PLU input pins connection:

  • J2-7 (GPIO0_6) to J2-8 (PLU_IN3 PIO0_8).

  • J2-6 (GPIO0_7) to J1-6 (PLU_IN4 PIO0_9).

PLU output pins connection:

  • J2-2 (PLU_OUT1 PIO0_13) to J1-5 (RGB_GREEN PIO0_0).

  • J2-1 (PLU_OUT2 PIO0_14) to J4-5 (LED_BLUE PIO0_19).

Prepare the Demo
  1. Connect a USB cable between the host PC and the FRDM board J10.

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

Expected Result

Input source and LED status table:

PLU_IN5

PLU_IN4

PLU_IN3

LED_BLUE

LED_GREEN

0

0

0

off

off

0

0

1

off

on

0

1

0

on

off

0

1

1

on

on

The log below shows the output of the plu combination example in the terminal window:

PLU combination driver example.

Select the input source.
1. Input source 0
2. Input source 1
3. Input source 2
4. Set all three input sources.
0
Select the input value.
0. Low level.
1. High level.
1
Select the input source.
0. Input source 0
1. Input source 1
2. Input source 2
3. Set all three input sources.
3
Input the three values like 000.
0. Low level.
1. High level.
011

The LED will change as the description in the table.

LPCXpresso55S69
Hardware requirements
  • Mini/micro USB cable

  • LPCXpresso55s69 board

  • Personal Computer

Board settings

PLU input pins connection:

  • P17_19 (GPIO1_8) to P18_20 (PLU_IN3).

  • P18_1 (GPIO1_9) to P17_12 (PLU_IN4).

  • P18_3 (GPIO1_10) to P17_10 (PLU_IN5).

PLU output pins connection:

  • P18_16 (PLU_OUT0) to P18_9 (LED_RED).

  • P18_14 (PLU_OUT1) to P18_7 (LED_GREEN).

  • P17_1 (PLU_OUT2) to P18_5 (LED_BLUE).

Prepare the Demo

Note: MCUXpresso IDE project default debug console is semihost

  1. Connect a micro USB cable between the PC host and the CMSIS DAP port(CN2 on the board).

  2. Open a serial terminal with the following settings (See Appendix A in Getting started guide for description how to determine serial port number):

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

Expected Result

Input source and LED status table:

PLU_IN5

PLU_IN4

PLU_IN3

LED_BLUE

LED_GREEN

LED_RED

0

0

0

off

off

off

0

0

1

off

off

on

0

1

0

off

on

off

0

1

1

on

off

off

1

0

0

off

on

on

1

0

1

on

off

on

1

1

0

on

on

off

1

1

1

on

on

on

The log below shows the output of the plu combination example in the terminal window:

PLU combination driver example.

Select the input source.
1. Input source 0
2. Input source 1
3. Input source 2
4. Set all three input sources.
0
Select the input value.
0. Low level.
1. High level.
1
Select the input source.
0. Input source 0
1. Input source 1
2. Input source 2
3. Set all three input sources.
3
Input the three values like 000.
0. Low level.
1. High level.
011

The LED will change as the description in the table

LPCXpresso804
Functional Description

The example will configure the SWM for PLU inputs, outputs, and clock input, then configure the PLU module to make it work.

Note: The RGB LED in this case turns on when the pin level is low and it turns off when the pin level is high.

Each of the three LUT elements are connected to the three PLU input sources to control the RGB LED.

Hardware Requirements
  • Mini/micro USB cable

  • LPCXpresso804 board

  • Personal Computer

Board Settings

PLU input pins connection:

  • CN3_7 (GPIO0_8) to CN8_2 (PLU_IN2).

  • CN3_6 (GPIO0_9) to CN3_10 (PLU_IN3).

  • CN5_1 (GPIO0_10) to CN8_5 (PLU_IN4).

PLU output pins connection:

  • CN3_1 (PLU_OUT0) to CN8_4 (LED_RED).

  • CN3_8 (PLU_OUT1) to CN8_6 (LED_GREEN).

  • CN5_2 (PLU_OUT2) to CN8_3 (LED_BLUE).

Run the Project
  1. Connect a micro USB cable between the PC host and the CMSIS DAP port(CN2 on the board).

  2. Open a serial terminal with the following settings:

    • 9600 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Choose an IDE, building the project and download the program to the target board. More information about how to compile and program the project can refer to the

    [Getting Started with MCUXpresso SDK](../../../../docs/Getting Started with MCUXpresso SDK.pdf).

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

Expected Result

Input source and LED status table:

PLU_IN4

PLU_IN3

PLU_IN2

LED_BLUE

LED_GREEN

LED_RED

0

0

0

off

off

off

0

0

1

off

off

on

0

1

0

off

on

off

0

1

1

on

off

off

1

0

0

off

on

on

1

0

1

on

off

on

1

1

0

on

on

off

1

1

1

on

on

on

The log below shows the output of the plu combination example in the terminal window:

PLU combination driver example.

Select the input source.
1. Input source 0
2. Input source 1
3. Input source 2
4. Set all three input sources.
0
Select the input value.
0. Low level.
1. High level.
1
Select the input source.
0. Input source 0
1. Input source 1
2. Input source 2
3. Set all three input sources.
3
Input the three values like 000.
0. Low level.
1. High level.
011

The LED will change as the description in the table

MCX-N5XX-EVK
Hardware requirements
  • Mini/micro USB cable

  • MCX-N5XX-EVK board

  • Personal Computer

Board settings

PLU input pins connection:

  • J20-23 (GPIO4_18) to J1-4 (PLU_IN2).

  • J20-24 (GPIO4_19) to J1-2 (PLU_IN3).

  • J20-25 (GPIO4_20) to J1-1 (PLU_IN5).

PLU output pins connection:

  • J20-17 (PLU_OUT0) to R201(LED_RED).

  • J20-18 (PLU_OUT1) to R199 (LED_GREEN).

  • J20-19 (PLU_OUT2) to R200 (LED_BLUE).

Prepare the Demo

Note: MCUXpresso IDE project default debug console is semihost

  1. Connect a micro USB cable between the PC host and the MCU-Link port(J5 on the board).

  2. Open a serial terminal with the following settings (See Appendix A in Getting started guide for description how to determine serial port number):

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

Expected Result

Input source and LED status table:

PLU_IN5

PLU_IN4

PLU_IN3

LED_BLUE

LED_GREEN

LED_RED

0

0

0

off

off

off

0

0

1

off

off

on

0

1

0

off

on

off

0

1

1

on

off

off

1

0

0

off

on

on

1

0

1

on

off

on

1

1

0

on

on

off

1

1

1

on

on

on

The log below shows the output of the plu combination example in the terminal window:

PLU combination driver example.

Select the input source.
1. Input source 0
2. Input source 1
3. Input source 2
4. Set all three input sources.
0
Select the input value.
0. Low level.
1. High level.
1
Select the input source.
0. Input source 0
1. Input source 1
2. Input source 2
3. Set all three input sources.
3
Input the three values like 000.
0. Low level.
1. High level.
011

The LED will change as the description in the table

MCX-N9XX-EVK
Hardware requirements
  • Mini/micro USB cable

  • MCX-N9XX-EVK board

  • Personal Computer

Board settings

PLU input pins connection:

  • J20-23 (GPIO4_18) to J1-4 (PLU_IN2).

  • J20-24 (GPIO4_19) to J1-2 (PLU_IN3).

  • J20-25 (GPIO4_20) to J1-1 (PLU_IN5).

PLU output pins connection:

  • J20-17 (PLU_OUT0) to R201(LED_RED).

  • J20-18 (PLU_OUT1) to R199 (LED_GREEN).

  • J20-19 (PLU_OUT2) to R200 (LED_BLUE).

Prepare the Demo

Note: MCUXpresso IDE project default debug console is semihost

  1. Connect a micro USB cable between the PC host and the MCU-Link port(J5 on the board).

  2. Open a serial terminal with the following settings (See Appendix A in Getting started guide for description how to determine serial port number):

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

Expected Result

Input source and LED status table:

PLU_IN5

PLU_IN4

PLU_IN3

LED_BLUE

LED_GREEN

LED_RED

0

0

0

off

off

off

0

0

1

off

off

on

0

1

0

off

on

off

0

1

1

on

off

off

1

0

0

off

on

on

1

0

1

on

off

on

1

1

0

on

on

off

1

1

1

on

on

on

The log below shows the output of the plu combination example in the terminal window:

PLU combination driver example.

Select the input source.
1. Input source 0
2. Input source 1
3. Input source 2
4. Set all three input sources.
0
Select the input value.
0. Low level.
1. High level.
1
Select the input source.
0. Input source 0
1. Input source 1
2. Input source 2
3. Set all three input sources.
3
Input the three values like 000.
0. Low level.
1. High level.
011

The LED will change as the description in the table