bubble_peripheral#
Overview#
This demo demonstrates basic usage of the on-board accelerometer to implement a bubble level. A bubble level utilizes two axes to visually show deviation from a level plane (0 degrees) on a given axis. This demo behaves exactly the same with bubble demo, but it focuses on how to use files generated by MCUXpresso Config Tools.
The following files are generated by MCUXpresso Config Tools:
bubble_peripheral.mex: This mex file contains pin/clock/peripheral settings of this example. User can modify the settings in config tool and generate new source file for pin/clock/peripheral.
peripheral.c/.h: These files are generated by MCUXpresso peripherals tool which could be imported back to the tool.
clock_config.c/.h: These files are generated by MCUXpresso clocks tool which could be imported back to the tool.
pin_mux.c/.h: These files are generated by MCUXpresso pins tool which could be imported back to the tool.
Supported Boards#
EVKB-IMXRT1050
Hardware requirements
Mini/micro USB cable
EVKB_IMXRT1050 board
Personal Computer
Board settings
No special settings are required.
Prepare the Demo
Connect a USB cable between the host PC and the OpenSDA USB port on the target board.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
When the example runs successfully, you can see the similar information from the terminal as shown below.
Welcome to the BUBBLE example
You will see the change of LED brightness when change angles of board
x= 6 y = 22
x= 8 y = 26
x= 10 y = 28
x= 10 y = 28
x= 11 y = 29
x= 11 y = 29
MIMXRT1060-EVKB
Hardware requirements
Mini/micro USB cable
MIMXRT1060-EVKB board
Personal Computer
Board settings
No special settings are required.
Prepare the Demo
Connect a USB cable between the host PC and the OpenSDA USB port on the target board.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
When the example runs successfully, you can see the similar information from the terminal as shown below.
Welcome to the BUBBLE example
You will see the change of LED brightness when change angles of board
x= 6 y = 22
x= 8 y = 26
x= 10 y = 28
x= 10 y = 28
x= 11 y = 29
x= 11 y = 29
Note:
If the user LED flashes constantly and the following message is printed on the console: Sensor device initialize failed!
Please check the sensor chip U12
please check if the combo sensor (U12) is presented on the board.
MIMXRT1060-EVKC
Hardware requirements
Mini/micro USB cable
MIMXRT1060-EVKC board
Personal Computer
Board settings
No special settings are required.
Prepare the Demo
Connect a USB cable between the host PC and the OpenSDA USB port on the target board.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
When the example runs successfully, you can see the similar information from the terminal as shown below.
Welcome to the BUBBLE example
You will see the change of LED brightness when change angles of board
x= 6 y = 22
x= 8 y = 26
x= 10 y = 28
x= 10 y = 28
x= 11 y = 29
x= 11 y = 29
Note:
If the user LED flashes constantly and the following message is printed on the console: Sensor device initialize failed!
Please check the sensor chip U115
please check if the combo sensor (U115) is presented on the board.
EVK-MIMXRT1010
Hardware requirements
Mini/micro USB cable
EVK_MIMXRT1010 board
Personal Computer
Board settings
No special settings are required.
Prepare the Demo
Connect a USB cable between the host PC and the OpenSDA USB port on the target board.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
When the example runs successfully, you can see the similar information from the terminal as shown below.
Welcome to the BUBBLE example
You will see the change of LED brightness when change angles of board
x= 6 y = 22
x= 8 y = 26
x= 10 y = 28
x= 10 y = 28
x= 11 y = 29
x= 11 y = 29
Note:
if sensor chip(U26) is not welded on the board, the LED will be blinking
Note: To debug in qspiflash, following steps are needed:
Select the flash target and compile.
Set the SW8: 1 off 2 off 3 on 4 off, then power on the board and connect USB cable to J41.
Start debugging in IDE.
Keil: Click “Download (F8)” to program the image to qspiflash first then clicking “Start/Stop Debug Session (Ctrl+F5)” to start debugging.
EVK-MIMXRT1015
Hardware requirements
Mini/micro USB cable
EVK_MIMXRT1015 board
Personal Computer
Board settings
No special settings are required.
Prepare the Demo
Connect a USB cable between the host PC and the OpenSDA USB port on the target board.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
When the example runs successfully, you can see the similar information from the terminal as shown below.
Welcome to the BUBBLE example
You will see the change of LED brightness when change angles of board
x= 6 y = 22
x= 8 y = 26
x= 10 y = 28
x= 10 y = 28
x= 11 y = 29
x= 11 y = 29
Note:
if sensor chip(U26) is not welded on the board, the LED will be blinking
Note: To debug in qspiflash, following steps are needed:
Select the flash target and compile.
Set the SW8: 1 off 2 off 3 on 4 off, then power on the board and connect USB cable to J41.
Start debugging in IDE.
Keil: Click “Download (F8)” to program the image to qspiflash first then clicking “Start/Stop Debug Session (Ctrl+F5)” to start debugging.
EVK-MIMXRT1020
Hardware requirements
Mini/micro USB cable
EVK_MIMXRT1020 board
Personal Computer
Board settings
No special settings are required.
Prepare the Demo
Connect a USB cable between the host PC and the OpenSDA USB port on the target board.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
When the example runs successfully, you can see the similar information from the terminal as shown below.
Welcome to the BUBBLE example
You will see the change of LED brightness when change angles of board
x= 6 y = 22
x= 8 y = 26
x= 10 y = 28
x= 10 y = 28
x= 11 y = 29
x= 11 y = 29
Note:
if sensor chip(U26) is not welded on the board, the LED will be blinking
Note: To debug in qspiflash, following steps are needed:
Select the flash target and compile.
Set the SW8: 1 off 2 off 3 on 4 off, then power on the board and connect USB cable to J23.
Start debugging in IDE.
Keil: Click “Download (F8)” to program the image to qspiflash first then clicking “Start/Stop Debug Session (Ctrl+F5)” to start debugging.
MIMXRT1024-EVK
Hardware requirements
Mini/micro USB cable
MIMXRT1024-EVK board
Personal Computer
Board settings
No special settings are required.
Prepare the Demo
Connect a USB cable between the host PC and the OpenSDA USB port on the target board.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
When the example runs successfully, you can see the similar information from the terminal as shown below.
Welcome to the BUBBLE example
You will see the change of LED brightness when change angles of board
x= 6 y = 22
x= 8 y = 26
x= 10 y = 28
x= 10 y = 28
x= 11 y = 29
x= 11 y = 29
Note:
if sensor chip(U26) is not welded on the board, the LED will be blinking
Note: To debug in qspiflash, following steps are needed:
Select the flash target and compile.
Set the SW8: 1 off 2 off 3 on 4 off, then power on the board and connect USB cable to J23.
Start debugging in IDE.
Keil: Click “Download (F8)” to program the image to qspiflash first then clicking “Start/Stop Debug Session (Ctrl+F5)” to start debugging.
MIMXRT1040-EVK
Hardware requirements
Mini/micro USB cable
MIMXRT1040-EVK board
Personal Computer
Board settings
Remove jumper J80.
Prepare the Demo
Connect a USB cable between the host PC and the OpenSDA USB port on the target board.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
When the example runs successfully, you can see the similar information from the terminal as shown below.
Welcome to the BUBBLE example
You will see the change of LED brightness when change angles of board
x= 6 y = 22
x= 8 y = 26
x= 10 y = 28
x= 10 y = 28
x= 11 y = 29
x= 11 y = 29
Note:
If the user LED flashes constantly and the following message is printed on the console:
Sensor device initialize failed!
please check if the combo sensor (U66) is presented on the board.
EVK-MIMXRT1064
Hardware requirements
Mini/micro USB cable
EVK-MIMXRT1064 board
Personal Computer
Board settings
No special settings are required.
Prepare the Demo
Connect a USB cable between the host PC and the OpenSDA USB port on the target board.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
When the example runs successfully, you can see the similar information from the terminal as shown below.
Welcome to the BUBBLE example
You will see the change of LED brightness when change angles of board
x= 6 y = 22
x= 8 y = 26
x= 10 y = 28
x= 10 y = 28
x= 11 y = 29
x= 11 y = 29
Note:
If the user LED flashes constantly and the following message is printed on the console: Sensor device initialize failed!
Please check the sensor chip U32
please check if the combo sensor (U32) is presented on the board.
MIMXRT1160-EVK
Hardware requirements
Mini/micro USB cable
MIMXRT1160-EVK board
Personal Computer
Board settings
No special settings are required.
Prepare the Demo
Connect a USB cable between the host PC and the OpenSDA USB port on the target board.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
When the example runs successfully, you can see the similar information from the terminal as shown below.
Welcome to the BUBBLE example
You will see the change of LED brightness when change angles of board
x= 6 y = 22
x= 8 y = 26
x= 10 y = 28
x= 10 y = 28
x= 11 y = 29
x= 11 y = 29
Note:
If the user LED flashes constantly and the following message is printed on the console: Sensor device initialize failed!
Please check the sensor chip U34
please check if the combo sensor (U34) is presented on the board.
MIMXRT1180-EVK
Hardware requirements
Mini/micro USB cable
MIMXRT1180-EVK board
Personal Computer
Board settings
No special settings are required.
Prepare the Demo
Connect a USB cable between the host PC and the OpenSDA USB port on the target board.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Launch the debugger in your IDE to begin running the demo.
Running the demo
When the example runs successfully, you can see the similar information from the terminal as shown below.
Welcome to the BUBBLE example
You will see the change of LED brightness when change angles of board
x= 6 y = 22
x= 8 y = 26
x= 10 y = 28
x= 10 y = 28
x= 11 y = 29
x= 11 y = 29
Note:
If the user LED flashes constantly and the following message is printed on the console: Sensor device initialize failed!
Please check the sensor chip U115
please check if the combo sensor (U115) is presented on the board.
FRDM-K22F
Hardware requirements
Mini/Micro USB cable
FRDM-K22F board
Personal Computer
Board settings
No special settings are required.
Prepare the Demo
Connect a USB cable between the host PC and the OpenSDA USB port on the target board.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
When the example runs successfully, you can see the similar information from the terminal as shown below.
Welcome to the BUBBLE example
You will see the change of angle data and LED brightness when change the angles of board
x= 6 y = 22 x= 8 y = 26 x= 10 y = 28 x= 10 y = 28 x= 11 y = 29 x= 11 y = 29
FRDM-K32L2A4S
Hardware requirements
Mini/Micro USB cable
FRDM-K32L2A4S board
Personal Computer
Board settings
No special settings are required.
Prepare the Demo
Connect a USB cable between the host PC and the OpenSDA USB port on the target board.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
When the example runs successfully, you can see the similar information from the terminal as shown below.
Welcome to the BUBBLE example
You will see the change of angle data and LED brightness when change the angles of board
x= 6 y = 22
x= 8 y = 26
x= 10 y = 28
x= 10 y = 28
x= 11 y = 29
x= 11 y = 29
FRDM-K32L2B
Hardware requirements
Mini/Micro USB cable
FRDM-K32L2B board
Personal Computer
Board settings
FXOS8700 must be available on board to run this example. If it’s not soldered, the example cannot work.
Prepare the Demo
Connect a USB cable between the host PC and the OpenSDA USB port on the target board.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
When the example runs successfully, you can see the similar information from the terminal as shown below.
Welcome to the BUBBLE example You will see angle data change in the console when change the angles of board
x= 6 y = 22 x= 8 y = 26 x= 10 y = 28 x= 10 y = 28 x= 11 y = 29 x= 11 y = 29
FRDM-KE15Z
Hardware requirements
Micro USB cable
FRDM-KE15Z board
Personal Computer
Board settings
No special settings are required.
Prepare the Demo
Connect a USB cable between the host PC and the OpenSDA USB port on the target board.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
When the example runs successfully, you can see the similar information from the terminal as shown below.
Welcome to the BUBBLE example
You will see the change of angle data and LED brightness when change the angles of board
x= 6 y = 22
x= 8 y = 26
x= 10 y = 28
x= 10 y = 28
x= 11 y = 29
x= 11 y = 29
FRDM-KE17Z
Hardware requirements
Micro USB cable
FRDM-KE17Z board
Personal Computer
Board settings
Make sure the FXOS8700CQ(U12) on the board is installed to run this demo. No special settings are required.
Prepare the Demo
Connect a USB cable between the host PC and the OpenSDA USB port on the target board.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
When the example runs successfully, you can see the similar information from the terminal as shown below.
Welcome to the BUBBLE example
You will see the change of angle data and LED brightness when change the angles of board
x= 6 y = 22
x= 8 y = 26
x= 10 y = 28
x= 10 y = 28
x= 11 y = 29
x= 11 y = 29
FRDM-KE17Z512
Hardware requirements
Micro USB cable
FRDM-KE17Z512 board
Personal Computer
Board settings
Make sure the FXLS8974CFR3(U12) on the board is installed to run this demo. No special settings are required.
Prepare the Demo
Connect a USB cable between the host PC and the MCU-LINK USB port on the target board.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
When the example runs successfully, you can see the similar information from the terminal as shown below.
Welcome to the BUBBLE example
You will see the change of angle data and LED brightness when change the angles of board
x= 6 y = 22
x= 8 y = 26
x= 10 y = 28
x= 10 y = 28
x= 11 y = 29
x= 11 y = 29
FRDM-MCXC242
Hardware requirements
USB-C cable
FRDM-MCXC242 board
Personal Computer
Board settings
No special settings are required.
Prepare the Demo
Connect a USB cable between the host PC and the OpenSDA USB port on the target board.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
When the example runs successfully, you can see the similar information from the terminal as shown below.
Welcome to the BUBBLE example
You will see the change of angle data in the console when change angles of board.
x= 6 y = 22 x= 8 y = 26 x= 10 y = 28 x= 10 y = 28 x= 11 y = 29 x= 11 y = 29
FRDM-MCXE247
Hardware requirements
USB-C cable
FRDM-MCXE247 board
Personal Computer
Board settings
No special settings are required.
Prepare the Demo
Connect a USB cable between the host PC and the MCU-LINK USB port on the target board.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Running the demo
When the example runs successfully, you can see the similar information from the terminal as shown below.
Welcome to the BUBBLE example
You will see the change of angle data in the console when change angles of board.
x= 6 y = 22 x= 8 y = 26 x= 10 y = 28 x= 10 y = 28 x= 11 y = 29 x= 11 y = 29
MC56F80000-EVK
Overview
The bubble level demo demonstrates basic usage of the on-board accelerometer to implement a bubble level. A bubble level utilizes two axes to visually show deviation from a level plane (0 degrees) on a given axis.
The following files are generated by MCUXpresso Config Tools:
peripheral.c/.h: These files are generated by MCUXpresso peripherals tool which could be imported back to the tool.
clock_config.c/.h: These files are generated by MCUXpresso clocks tool which could be imported back to the tool.
pin_mux.c/.h: These files are generated by MCUXpresso pins tool which could be imported back to the tool.
Hardware requirements
Micro USB cable
MC56F80000-EVK board
Personal Computer
Board hardware common setting
Power setting:
Connect J8 pin2 and pin3 Connect J6 pin1 and pin2 Connect J5 pin1 and pin2
Reset pin setting:
Connect J11 pin2 and pin3
Debugger setting:
Connect J13 pin 1-2, 3-4, 5-6, 7-8
Board settings
No special settings are required.
Prepare the Demo
Connect USB cable between the host PC and the J12 USB port on the target board. It setups Multilink and COM port in PC device manager.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board with Multilink debug configuration.
Launch the debugger in your IDE to begin running the demo.
Running the demo
When the example runs successfully, you can see the similar information from the terminal as shown below.
Welcome to the BUBBLE example
You will see the change of LED brightness when change angles of board
x= 6 y = 22
x= 8 y = 26
x= 10 y = 28
x= 10 y = 28
x= 11 y = 29
x= 11 y = 29
Note:
If the RED LED flashes constantly and the following message is printed on the console: Sensor device initialize failed!
Please check the sensor chip U18
please check if the combo sensor (U18) is presented on the board.
MC56F81000-EVK
Overview
The bubble level demo demonstrates basic usage of the on-board accelerometer to implement a bubble level. A bubble level utilizes two axes to visually show deviation from a level plane (0 degrees) on a given axis.
The following files are generated by MCUXpresso Config Tools:
peripheral.c/.h: These files are generated by MCUXpresso peripherals tool which could be imported back to the tool.
clock_config.c/.h: These files are generated by MCUXpresso clocks tool which could be imported back to the tool.
pin_mux.c/.h: These files are generated by MCUXpresso pins tool which could be imported back to the tool.
Hardware requirements
2 x Micro USB cable
MC56F81000-EVK board
Personal Computer
Board hardware common setting
Power setting:
Connect J8 pin2 and pin3 Connect J5 pin1 and pin2 Connect J6 pin1 and pin2
Onboard PnE U-MultiLink debugger setting:
Connet J11 pin2 and pin3 Connect J13 pin 1-2, 3-4, 5-6, 7-8, to setup onboard debugger PnE U-MultiLink. Note: when use external debugger(connected to J10), leave all J13 pins open.
Board settings
No special settings are required.
Prepare the Demo
Connect USB cable between the host PC and the USB(J26) port on the target board to setup USB to UART bridge.
Connect USB cable between the host PC and the USB(J12) port on the target baord to setup mulitlink debugger.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board with PnE U-MultiLink debug configuration.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo. Please be noted default FCF(flash configuration field) makes the MCU boot from flash.
Running the demo
When the example runs successfully, you can see the similar information from the terminal as shown below.
Welcome to the BUBBLE example
You will see the change of LED brightness when change angles of board
x= 6 y = 22
x= 8 y = 26
x= 10 y = 28
x= 10 y = 28
x= 11 y = 29
x= 11 y = 29
Note:
If the RED LED flashes constantly and the following message is printed on the console: Sensor device initialize failed!
Please check the sensor chip U14
please check if the combo sensor (U14) is presented on the board.
MC56F83000-EVK
Overview
The bubble level demo demonstrates basic usage of the on-board accelerometer to implement a bubble level. A bubble level utilizes two axes to visually show deviation from a level plane (0 degrees) on a given axis.
The following files are generated by MCUXpresso Config Tools:
peripheral.c/.h: These files are generated by MCUXpresso peripherals tool which could be imported back to the tool.
clock_config.c/.h: These files are generated by MCUXpresso clocks tool which could be imported back to the tool.
pin_mux.c/.h: These files are generated by MCUXpresso pins tool which could be imported back to the tool.
Hardware requirements
Micro USB cable
MC56F83000-EVK board
Personal Computer
Board hardware common setting
Power setting:
Connect J19 pin2 and pin3 Connect J12 pin1 and pin2 Connect J13 pin1 and pin2 Connect J15 pin1 and pin2 Connect J16 pin2 and pin3 Connect J17 pin1 and pin2
Onboard OSJTAG debugger setting:
Leave J5 open Leave J6 open Note: J6 is only used(connected) when firmware update for onboard debugger OSJTAG. Connect J11 pin 1-2, 3-4, 5-6, 7-8, to setup onboard debugger OSJTAG. Note: when use external debugger(connected to J10), leave all J11 pins open.
Board settings
No special settings are required.
Prepare the Demo
Connect USB cable between the host PC and the JM60 USB(J8) port on the target board. It setups OSJTAG and COM port in PC device manager.
Open a serial terminal with the following settings:
115200 baud rate
8 data bits
No parity
One stop bit
No flow control
Download the program to the target board with OSJTAG debug configuration.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo. Please be noted that default FCF(flash configuration field) setting makes MCU boot from bootloader. So after reset button press, it will wait 5s(wait in bootloader) to run the application code.
Running the demo
When the example runs successfully, you can see the similar information from the terminal as shown below.
Welcome to the BUBBLE example
You will see the change of LED brightness when change angles of board
x= 6 y = 22
x= 8 y = 26
x= 10 y = 28
x= 10 y = 28
x= 11 y = 29
x= 11 y = 29
Note:
If the RED LED flashes constantly and the following message is printed on the console: Sensor device initialize failed!
Please check the sensor chip U11
please check if the combo sensor (U11) is presented on the board.