eMIOS triggered BCTU ADC: Configuration of BCTU List

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

eMIOS triggered BCTU ADC: Configuration of BCTU List

跳至解决方案
966 次查看
Samuel_DCosta
Contributor III

Hi,

I am using the S32K344 --> S32K3X4EVB-T172 evaluation board and I need to make the following configuration for the ADC which is triggered by the eMIOS via the BCTU.

Sinal NamePin ConfigTrigger Rate
Signal 1ADC0_P250kHz
Signal 2ADC0_P650kHz
Signal 3ADC1_P640 kHz
Signal 4ADC1_P740 kHz
Signal 5ADC0_S1440 kHz
Signal 6ADC0_S1540 kHz
Signal 7ADC1_P440 kHz
Signal 8ADC1_P540 kHz
Signal 9ADC0_S1040 kHz
Signal 10ADC0_S1640 kHz
Signal 11ADC2_P32kHz
Signal 12ADC2_P42kHz
Signal 13ADC2_P52kHz
Signal 14ADC2_P62kHz
Signal 15ADC2_P72kHz
Signal 16ADC2_P02kHz
Signal 17ADC0_S17200Hz
Signal 18ADC1_S12200Hz
Signal 19ADC0_S19200Hz
Signal 20ADC1_S10200Hz
Signal 21ADC1_P1200Hz


Following is my configuration:
EMIOS Config
eMIOS0_CH0 to eMIOS0_CH2: Configured @ 50kHz

eMIOS0_CH3 to eMIOS0_CH5: Configured @ 40kHz

eMIOS0_CH6 to eMIOS0_CH8: Configured @ 2kHz

eMIOS0_CH16 eMIOS0_CH22 and eMIOS0_CH23: Configured @ 200Hz

I am a little confused with the configuration of the BCTU Internal triggers and its mapping to the BCTU List. Here is my configuration:

  1. I categorized my BCTU List based on ADC0, ADC1 and ADC2
  2. Another category I made was to have BCTU triggers based on trigger rate
  3. For each signal in the BCTU list the appropriate ADC channel ID was selected based on the table above. Eg: P6_ChanNum6

Based on the above my BCTU List looks like this:

  • BCTU List 1: Contains signals triggered at 50kHz and ADC0
  • BCTU List 2: Contains signals triggered at 40kHz and ADC0
  • BCTU List 3: Contains signals triggered at 2kHz and ADC0
  • BCTU List 4: Contains signals triggered at 200Hz and ADC0
  • BCTU List 5: Contains signals triggered at 50kHz and ADC1
  • BCTU List 6: Contains signals triggered at 40kHz and ADC1
  • BCTU List 7: Contains signals triggered at 2kHz and ADC1
  • BCTU List 8: Contains signals triggered at 200Hz and ADC1
  • BCTU List 9: Contains signals triggered at 50kHz and ADC2
  • BCTU List 10: Contains signals triggered at 40kHz and ADC2
  • BCTU List 11: Contains signals triggered at 2kHz and ADC2
  • BCTU List 12: Contains signals triggered at 200Hz and ADC2

And then based on the above, I would have 12 internal triggers to trigger each list.
I want to make sure that each signal is sampled only at the given trigger rate once.

Eg:

BCTU List 1 will be triggered by eMIOS_CH0 with ADC target mask as 1 << 0 (for ADC 0)

BCTU List 12 will be triggered by eMIOS0_CH23 with ADC target mask as 1 << 2 (for ADC 2)
__________________________________________________________________________________

Is this the right way to configure the BCTU list? I want to ensure that each signal is triggered only once during the trigger period. Hence I am choosing to NOT select a cross-trigger (eg: ADC target mask  = 3)

I would like to have your input if the configuration can be optimised.

标记 (3)
0 项奖励
回复
1 解答
855 次查看
_Leo_
NXP TechSupport
NXP TechSupport

Hi again,

Your approach is quite interesting but makes me noise that you want trigger multiple channels from the same ADC module at different frequencies.

I recommend you to trigger all channels from a single ADC module to a single frequency to simplify.

And if you need a fourth trigger rate, you can use a trigger rate value which is a multiple of two desired trigger rates. In this way you will have dummy measurement that you can skip.

Have a nice day!

在原帖中查看解决方案

0 项奖励
回复
4 回复数
873 次查看
Samuel_DCosta
Contributor III

Hi @_Leo_ ,

Thank you for your reply. I see the example uses a similar configuration except for a cross-trigger. Here we are trying to avoid a cross trigger as we would have results in the FIFO which we would not use. That would also cause the FIFO interrupts (once the number of entries in the FIFO exceeds the watermark value) to be generated more frequently which is not desirable. 

Let me explain it with an example:

From the above table let's say we enable cross-triggers, and we have 3 triggers, namely A, B and C to trigger channel 6 of ADC0, ADC1 and ADC2 (Target Mask = 0b111 for all 3 triggers)

Trigger A = 50 kHz
Trigger B = 40 kHz
Trigger C = 2 kHz

ADC0_P6 --> Needs to be triggered @ 50 kHz --> Signal 2
ADC1_P6 --> Needs to be triggered @ 40 kHz --> Signal 3
ADC2_P6 --> Needs to be triggered @ 2 kHz --> Signal 14

That means the FIFO will be filled with sampled results of SIgnal 2, 3 and 14 at 50 kHz, 40 kHz and 2 kHz each.
I only need Signal 14 at 2 kHz and NOT at 40 kHz and 50 kHz.
But having cross triggers enabled the FIFO buffers will be filled with Signal 14 at 40 kHz and 50 kHz anyway, which I will have to discard once read. This is why my preference of having a trigger specific to a ADC at a particular rate and not cross trigger.

Is my understanding correct? Or can this approach be simplified?

0 项奖励
回复
856 次查看
_Leo_
NXP TechSupport
NXP TechSupport

Hi again,

Your approach is quite interesting but makes me noise that you want trigger multiple channels from the same ADC module at different frequencies.

I recommend you to trigger all channels from a single ADC module to a single frequency to simplify.

And if you need a fourth trigger rate, you can use a trigger rate value which is a multiple of two desired trigger rates. In this way you will have dummy measurement that you can skip.

Have a nice day!

0 项奖励
回复
840 次查看
Samuel_DCosta
Contributor III

Hi @_Leo_ ,

I came to the same conclusion as you mentioned. Hence I have reduced the trigger rate to 2 frequencies. Unfortunately, the signal mapping to the pin config is fixed for now. So that means we are still working with 3 ADCs (0, 1 and 2).

To consider this change I have 6 triggers (One per trigger rate per ADC).
Eg:
Trigger 1: 50 kHz for ADC0
Trigger 2: 50 kHz for ADC1
Trigger 3: 50 kHz for ADC2
Trigger 4: 5 kHz for ADC0
Trigger 5: 5 kHz for ADC1
Trigger 6: 5 kHz for ADC2

This approach saves me from sampling signals at unwanted rates thereby having no unwanted signals in the FIFO. This in turn reduces the number of CPU interrupts when the BCTU FIFO is full (or crosses the watermark value) compared to the case where we have unwanted samples in the FIFO that would be discarded.

But thank you for your recommendation. It validates my thinking regarding the BCTU and ADC configuration.

0 项奖励
回复
930 次查看
_Leo_
NXP TechSupport
NXP TechSupport

Hi,

Thank you so much for your interest in our products and for using our community.

The 4.2.4. Analogue data capturing section from AN13767 describes an EMIOS + BCTU + ADC configuration just like you are working and can be taken as reference.

Hope it helps you. Please let me know if you have more questions about it.

Have a nice day!

0 项奖励
回复