The purpose of this demo is to present a usage of the SAR ADC and BCTU modules, BCTU software trigger is implemented to perform conversions on ADC channels using the RTD high-level drivers, commonly known as MCAL drivers.
The BCTU is in control mode assuming complete control over the ADC module using SW triggered to complete ADC samplings. The sampling channels do not actually use external pin inputs, but collect the bandgap and VREFH values (typically 1.2 V and 5 V).
This example was developed using the FRDM Automotive Bundle for S32K3 + S32M27. To download and install the complete software and tools ecosystem, use the following link:
- Type-C USB cable
- Personal Computer
- FRDM-A-S32K312
-
Open S32 Design Studio IDE, in the Dashboard Panel, choose Import project from Application Code Hub.
-
You can find the demo you need by searching for the name directly "ADC sampling controlled by BCTU". Open the project, click the GitHub link from this window, S32 Design Studio IDE will automatically retrieve project attributes then click Next>.
-
Select main branch and then click Next>.
-
Select your local path for the repo in Destination->Directory window. The S32 Design Studio IDE will clone the repo into this path, click Next>.
-
Select Import existing Eclipse projects then click Next>.
-
Select the project in this repo (only one project in this repo) then click Finish.
-
In Project Explorer, right-click the project and select Update Code and Build Project. This will generate the configuration (Pins, Clocks, Peripherals), update the source code and build the project using the active configuration (e.g. Debug_FLASH). Make sure the build completes successfully and the *.elf file is generated without errors.
Press Yes in the SDK Component Management pop-up window to continue. -
Go to Debug and select Debug Configurations. There will be a debug configuration for this project:
Configuration Name Description ------------------------------- ----------------------- $(example)_debug_flash_pemicro Debug the FLASH configuration using PEmicro probeSelect the desired debug configuration and click on Debug. Now the perspective will change to the Debug Perspective. Use the controls to control the program flow.
The demo is divided into 3 parts:
Part 1: BCTU control mode, using list mode for conversion on all ADC instances in series, data conversion is updated by DMA.
Part 2: BCTU control mode for parallel conversions from all ADC instances using list mode, data conversion is updated by DMA.
Part 3: Verify that the data transmitted to the larger buffers through DMA is correct.
When you suspend the debugging session, in Expressions tab you can observe the results: BctuDmaFifo1 and BctuDmaFifo2, which are used to store raw data from BCTU FIFOs according to the trigger and BCTU List, then all of them are transferred to DmaCh1_DestinationBuffer and DmaCh7_DestinationBuffer which will store all the corresponding measurements for each BCTU FIFO, after that a check is performed to see if the results transferred to both buffers are correct.
Verification criteria for a successful example run is bStatus being TRUE at the end of the example. An example check file was included that is used to automatically test examples, this writes a pass or fail status in the memory at a certain address.
For general technical questions related to NXP microcontrollers, please use the NXP Community Forum.
Questions regarding the content/correctness of this example can be entered as Issues within this GitHub repository.
Note: For more general technical questions regarding NXP Microcontrollers and the difference in expected functionality, enter your questions on the NXP Community Forum
| Version | Description / Update | Date |
|---|---|---|
| 1.0 | Initial release on Application Code Hub | September 18th 2026 |







