Example S32K312 PIT BTCU ADC-1 BCTU_ADC_DATA_REG DMA DS3.5 RTD300

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

Example S32K312 PIT BTCU ADC-1 BCTU_ADC_DATA_REG DMA DS3.5 RTD300

Example S32K312 PIT BTCU ADC-1 BCTU_ADC_DATA_REG DMA DS3.5 RTD300

*******************************************************************************

 The purpose of this demo application is to present a usage of the
 ADC_SAR and BCTU IP Driver for the S32K3xx MCU.

 The example uses the PIT0 trigger to trigger BCTU conversion list to
 perform  conversions on ADC1.  ADC channels
 are selected to be converted on  ADC-1:
 ADC1: P0, p1, p2, p3, p4, p5, p6, S10
 Converted results from  BCTU_ADC_DATA_REG are moved by DMA into result array.

 ADC channel S10 is connected to board's potentiometer.


 ------------------------------------------------------------------------------
* Test HW: S32K3X2EVB-Q172
* MCU: S32K312
* Compiler: S32DS3.5
* SDK release: RTD 3.0.0
* Debugger: PE micro
* Target: internal_FLASH
********************************************************************************

Set PIT Freeze Enable :---

Dinesh_Guleria_0-1707202447324.png

All channels are for ADC-1 , in BCTU list :--

Dinesh_Guleria_0-1707204286126.png

 

Dinesh_Guleria_0-1705043828719.png

 

"NEW DATA DMA enable mask" :--
controls These bit field in MCR register

Dinesh_Guleria_0-1707203759290.png

 

 

"ADC target mask" :--

It controls "ADC_SEL " bit field in "Trigger Configuration (TRGCFG_0 - TRGCFG_71)"

for single conversions you can enable only one instance
so the possible values for target mask:
1 (0b001) ADC0
2 (0b010) ADC1
3 (0b100) ADC2|

for list of conversions we can enable also parallel con version
for example
3 (0b011) parallel conversion of ADC0 and ADC1


The trigger is configured as a list of parallel conversions ADC0, ADC1 in “Adc Target Mask”.
List of ADC channels is defined in “BCTU List Items” while order is given by the “Adc Target Mask”: BctuListItems_0 is ADC0, BctuListItems_1 is ADC1 etc.

 

Dinesh_Guleria_3-1707204011310.png



Dinesh_Guleria_4-1707204043898.png

 

Dinesh_Guleria_2-1707203974137.png

 

Attachments
Comments

ADC convertion time

Using TriggerMux and Testpoints inserted in the DmaCh0_Callback function I tried to measure the time elapsed between the trigger (PIT CH0) and the reading of the data via DMA.

To make sure I measured the time of only one conversion I checked the "Next channel wait on trigger" option on all elements of the BCTU list. I left the other settings in the example (clocks, adc sampling durations = 220, ...).

The duration of the acquisition is about 13 us, which seems to me to be a VERY long time.

Can anyone help me understand how to get me on the 2 us to acquisition?

Thanks,

Gionatha

No ratings
Version history
Last update:
‎02-06-2024 12:26 AM
Updated by: