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 Name | Pin Config | Trigger Rate |
Signal 1 | ADC0_P2 | 50kHz |
Signal 2 | ADC0_P6 | 50kHz |
Signal 3 | ADC1_P6 | 40 kHz |
Signal 4 | ADC1_P7 | 40 kHz |
Signal 5 | ADC0_S14 | 40 kHz |
Signal 6 | ADC0_S15 | 40 kHz |
Signal 7 | ADC1_P4 | 40 kHz |
Signal 8 | ADC1_P5 | 40 kHz |
Signal 9 | ADC0_S10 | 40 kHz |
Signal 10 | ADC0_S16 | 40 kHz |
Signal 11 | ADC2_P3 | 2kHz |
Signal 12 | ADC2_P4 | 2kHz |
Signal 13 | ADC2_P5 | 2kHz |
Signal 14 | ADC2_P6 | 2kHz |
Signal 15 | ADC2_P7 | 2kHz |
Signal 16 | ADC2_P0 | 2kHz |
Signal 17 | ADC0_S17 | 200Hz |
Signal 18 | ADC1_S12 | 200Hz |
Signal 19 | ADC0_S19 | 200Hz |
Signal 20 | ADC1_S10 | 200Hz |
Signal 21 | ADC1_P1 | 200Hz |
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:
Based on the above my BCTU List looks like this:
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.
已解决! 转到解答。
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!
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?
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!
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.
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!