I am facing an issue understanding the list of the BTCU. Currently, I can retrieve values in the DMA buffer, but they are not uniform. The values appear cyclic, making it difficult to map ADC values to specific indices. Additionally, the values vary, though some match the expected ADC values.
This issue primarily occurs when using two different ADC instances. In this example, I am using ADC1 and ADC0:
Question:
Q2. Regarding the values, they are not consistent, as I mentioned earlier. Can you explain how this works and how I can achieve stable and consistent values?
As you can see, even without changing the voltage, the values sometimes rotate and appear in a different order
Q3) I have encountered this issue of misinterpreting the BTCU list in multiple examples. For instance, I tested this example: [https://community.nxp.com/t5/S32K-Knowledge-Base/Example-S32K344-PIT-BTCU-ADC-DMA-DS3-4-RTD100/ta-p/...], which includes a BTCU list. I noticed that the same channel appears twice, but I don’t understand the reason for this or how it maps to the BctuDmaFifo1. Could you please explain?
Q4) Additionally, could you explain the significance of the 'Watermark Value'
Q5) A more detailed explanation of the BTCU list would be very helpful. In terms of configuration, I believe I have set it up correctly, but the values do not appear at the expected indexes and do not match the BTCU list.
Thanks a lot for this! I was missing that detail. It's working fine now—I updated the peripherals and code as per your recommendation. I hadn’t realized that the BCTU list[ADC0,ADC1,ADC0,ADC1] sequence maps directly to the ADC sequence.
Hi,
if 2 ADCs are triggered by BCTU (ADC0 and ADC1 in your case as target mask is 3) then a list should contain even number of items, ADCs are sampled parallelly as below
You should add another item for ADC1 conversion and mark it as last channel.
Moreover set watermark to 3.
BR, Petr
Can you consider only the below settings and provide comments based on that?
I have set up the ADC to obtain the following results:
However, is not appearing as expected.
I have reviewed the reference manual as you suggested. . I had some basic understanding issue regarding the same.
Regarding point 6 (the last point), does this mean I cannot sample ADC1 channels S8 and S21 simultaneously? Will the value update in the next trigger of BctuWatermarkNotification? Could this be the reason why the result is not updating as I expected?
I would appreciate it if you could clarify this behavior. If there are any corrections needed, please let me know. In my actual system, I have multiple ADCs, so I want to ensure I understand the behavior correctly with this basic example.
Rest of the configuration I think is okay.
Hi,
it looks pretty the same, sorry. Also why you show list with 3 item at first then with 6 items. What is your need in fact? Then, no picture shows BCTU trigger setting, is it for single ADC or more?
Rather share your simplified project or explain more.
BR, Petr
I have attached a higher-resolution image along with a .zip file containing my configuration, which is focused solely on this functionality.
Hi,
pictures are very blurred, hard to read anything.
But lets try...
1) the CL operation is clearly described in chapters 64.3.2.1-3 of the RM, regarding NEXT and LAST option. If multiple ADCs are triggered then list items are taken in pairs (triplets), see more in chapter 64.3.4
2-3) cannot comment here, share complete BCTU setting in visible form.
4) FIFO Watermark specifies the FIFO watermark levels. If the number of active FIFO entries exceeds the watermark level, a DMA or interrupt request can be generated. Usually set based on BCTU list entries, if for example contains 6 items, watermark is set to 5. Means once 6 results are stored in FIFO interrupt is called and you can read those 6 results in callback. In case of DMA, the DMA reads the RXFIFO and fill user buffer and callback is called again.
5) refer e.g to https://community.nxp.com/t5/S32K/How-BCTU-LIST-items-works/m-p/1570114#M19447
Or share your config/code in readable form, or simplified project.
BR, Petr