<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>S32KのトピックRe: S32K344 ADC data alignment and bit resolution</title>
    <link>https://community.nxp.com/t5/S32K/S32K344-ADC-data-alignment-and-bit-resolution/m-p/1573190#M19578</link>
    <description>&lt;P&gt;Or you may see it otherwise.&lt;/P&gt;
&lt;P&gt;RM says that data in the result registers are always 15-bit (although I am not sure why it is stated because user cannot choose 15-bit resolution, only 14-bit)&lt;BR /&gt;Right-aligned data occupies *CDR[14:0],&lt;BR /&gt;Left-aligned data occupies *CDR[15:1].&lt;/P&gt;
&lt;P&gt;For right aligned and&lt;BR /&gt;14 bit - 0 bits &lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;disappear&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; from right&lt;BR /&gt;12 bit - 2 bits &lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;disappear&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; from right&lt;BR /&gt;8 bit - 6 bits &lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;disappear&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; from right&lt;/P&gt;
&lt;P&gt;For left aligned and&lt;BR /&gt;14 bit - 2 bits (i.e. 16-14) &lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;disappear&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; from right&lt;BR /&gt;12 bit - 4 bits &lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;disappear&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; from right&lt;BR /&gt;8 bit - 8 bits &lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;disappear&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; from right&lt;/P&gt;
&lt;P&gt;If you application cannot use it in this format, you will have to perform shifts SW way or use different alignment.&lt;/P&gt;</description>
    <pubDate>Wed, 21 Dec 2022 14:37:44 GMT</pubDate>
    <dc:creator>davidtosenovjan</dc:creator>
    <dc:date>2022-12-21T14:37:44Z</dc:date>
    <item>
      <title>S32K344 ADC data alignment and bit resolution</title>
      <link>https://community.nxp.com/t5/S32K/S32K344-ADC-data-alignment-and-bit-resolution/m-p/1571229#M19484</link>
      <description>&lt;P&gt;Hello NXP team!&lt;/P&gt;&lt;P&gt;I need to know what happens regarding the data alignment of the ADC. I have done some tests and I've seen that in order to get the adc data from the regirster I have to consider the alignment AND the bit resolution in order to do the correct mask+shifting in order to get the data.&lt;BR /&gt;&lt;BR /&gt;I've also noticed that if I set the resolution to 8 bit I get some data in the non-significant bits that are probably rubbish and they are not related to the ADC data.&lt;BR /&gt;&lt;BR /&gt;I'm putting an image bellow that shows the adc data alignment in regard with the bit resolution at the PCDR0-&amp;gt;CDATA register and at the FIFO1DR-&amp;gt;ADC_DATA. I've noticed that the value in those registers are the same.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kyf_0-1671195146745.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/204717i524A878435C01FDD/image-size/large?v=v2&amp;amp;px=999" role="button" title="kyf_0-1671195146745.png" alt="kyf_0-1671195146745.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;kyf_0-1671195146745.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Is the above image correct ?&lt;/P&gt;&lt;P&gt;With resolution 8 bits and right alignment i was expecting to see this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kyf_1-1671195254078.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/204718i2DE38F6CA4AAEFDE/image-size/large?v=v2&amp;amp;px=999" role="button" title="kyf_1-1671195254078.png" alt="kyf_1-1671195254078.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;kyf_1-1671195254078.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;but instead I've seen this when I debugged the registers:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kyf_2-1671195343743.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/204719iD4628BEA10F16730/image-size/large?v=v2&amp;amp;px=999" role="button" title="kyf_2-1671195343743.png" alt="kyf_2-1671195343743.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;kyf_2-1671195343743.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;2. Are the ADC data being readden by making and shifting the registers data ?&lt;/P&gt;&lt;P&gt;3. Which is the correct format that the data are stored inside the registers ? I would like not to use the CPU in order to shift or mask the data because that would render the whole timerTrigg-&amp;gt;Bctu-&amp;gt;Dma transfer pointless if I have to use the CPU for such a reason.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've read the ADC, BCU and the AN13413 but I didn't understand how the registers store the ADC data. Bellow are some parts regarding the alignment and the resolution.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kyf_3-1671195664002.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/204720i1D3039AD1BE4BDF0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="kyf_3-1671195664002.png" alt="kyf_3-1671195664002.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;kyf_3-1671195664002.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kyf_0-1671195754602.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/204722i5E6FA41C7CE300DE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="kyf_0-1671195754602.png" alt="kyf_0-1671195754602.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;kyf_0-1671195754602.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kyf_1-1671196020845.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/204723iF1A48C68A3E71CE0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="kyf_1-1671196020845.png" alt="kyf_1-1671196020845.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;kyf_1-1671196020845.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Here it seems that the data are shifted according to the selected resolution.&lt;/P&gt;&lt;P&gt;A. This is the code regarding reading data from the ADC&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kyf_2-1671196141486.png" style="width: 200px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/204724iC76F4D4673072C89/image-size/small?v=v2&amp;amp;px=200" role="button" title="kyf_2-1671196141486.png" alt="kyf_2-1671196141486.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;kyf_2-1671196141486.png&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kyf_3-1671196218485.png" style="width: 200px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/204725iF6D9580E096AC4BF/image-size/small?v=v2&amp;amp;px=200" role="button" title="kyf_3-1671196218485.png" alt="kyf_3-1671196218485.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;kyf_3-1671196218485.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;B. This is the code regarding reading data from the FIFO1 of the BCTU&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kyf_4-1671196346044.png" style="width: 200px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/204727i5037132E81A068A7/image-size/small?v=v2&amp;amp;px=200" role="button" title="kyf_4-1671196346044.png" alt="kyf_4-1671196346044.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;kyf_4-1671196346044.png&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kyf_5-1671196362453.png" style="width: 200px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/204728i2EA209949E5B3D85/image-size/small?v=v2&amp;amp;px=200" role="button" title="kyf_5-1671196362453.png" alt="kyf_5-1671196362453.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;kyf_5-1671196362453.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;4. How should I handle the data if my assumptions are correct ?&lt;/P&gt;&lt;P&gt;I have to port code and the data are stored in a buffer array with DMA. Should I use right alignment and shift the data before used in the code ? is there anything else that I could try ?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Kind regards,&lt;/P&gt;&lt;P&gt;kyf&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Dec 2022 13:15:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K344-ADC-data-alignment-and-bit-resolution/m-p/1571229#M19484</guid>
      <dc:creator>kyf</dc:creator>
      <dc:date>2022-12-16T13:15:23Z</dc:date>
    </item>
    <item>
      <title>Re: S32K344 ADC data alignment and bit resolution</title>
      <link>https://community.nxp.com/t5/S32K/S32K344-ADC-data-alignment-and-bit-resolution/m-p/1571238#M19485</link>
      <description>&lt;P&gt;Here is a screenshot from the registers after a BCTU/Adc measurement.&lt;/P&gt;&lt;P&gt;The bellow image shows a RightAligned data with 8bit resolution.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kyf_0-1671197874093.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/204731iF48E825B11F86C23/image-size/medium?v=v2&amp;amp;px=400" role="button" title="kyf_0-1671197874093.png" alt="kyf_0-1671197874093.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;kyf_0-1671197874093.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My main query is: Where are my data stored ? Is my data stored at bit 13-6 ?? or are they somewhere else ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Dec 2022 13:40:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K344-ADC-data-alignment-and-bit-resolution/m-p/1571238#M19485</guid>
      <dc:creator>kyf</dc:creator>
      <dc:date>2022-12-16T13:40:12Z</dc:date>
    </item>
    <item>
      <title>Re: S32K344 ADC data alignment and bit resolution</title>
      <link>https://community.nxp.com/t5/S32K/S32K344-ADC-data-alignment-and-bit-resolution/m-p/1572647#M19545</link>
      <description>&lt;P&gt;It is expected. Result is displayed always with maximum resolution. In case resolution is smaller, then LSB bits are cut (considering right align). With left align it is the same, but from left side.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2022 16:41:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K344-ADC-data-alignment-and-bit-resolution/m-p/1572647#M19545</guid>
      <dc:creator>davidtosenovjan</dc:creator>
      <dc:date>2022-12-20T16:41:35Z</dc:date>
    </item>
    <item>
      <title>Re: S32K344 ADC data alignment and bit resolution</title>
      <link>https://community.nxp.com/t5/S32K/S32K344-ADC-data-alignment-and-bit-resolution/m-p/1572994#M19568</link>
      <description>&lt;P&gt;Hello &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/52613"&gt;@davidtosenovjan&lt;/a&gt; . Thank you for your reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The thing is that when I'm selecting right align the LSB are not cut. For example:&lt;/P&gt;&lt;P&gt;My settings are 12bits resolution + right aligned. After the ADC conversion the MSB (11th bit) of the result is located at bit 13 of the register like the image bellow and not at bit 11 of the register as the alignment settings suggest.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kyf_0-1671610562408.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/205110i600A9F2CD6843E7F/image-size/large?v=v2&amp;amp;px=999" role="button" title="kyf_0-1671610562408.png" alt="kyf_0-1671610562408.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;kyf_0-1671610562408.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;and in order to get the adc data I have to shift them right 3 times in the firmware.&lt;/P&gt;&lt;P&gt;Am I missing something ? Shouldn't the LSB be at bit 0 when I select right alignment settings ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;kyf&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2022 08:24:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K344-ADC-data-alignment-and-bit-resolution/m-p/1572994#M19568</guid>
      <dc:creator>kyf</dc:creator>
      <dc:date>2022-12-21T08:24:33Z</dc:date>
    </item>
    <item>
      <title>Re: S32K344 ADC data alignment and bit resolution</title>
      <link>https://community.nxp.com/t5/S32K/S32K344-ADC-data-alignment-and-bit-resolution/m-p/1573190#M19578</link>
      <description>&lt;P&gt;Or you may see it otherwise.&lt;/P&gt;
&lt;P&gt;RM says that data in the result registers are always 15-bit (although I am not sure why it is stated because user cannot choose 15-bit resolution, only 14-bit)&lt;BR /&gt;Right-aligned data occupies *CDR[14:0],&lt;BR /&gt;Left-aligned data occupies *CDR[15:1].&lt;/P&gt;
&lt;P&gt;For right aligned and&lt;BR /&gt;14 bit - 0 bits &lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;disappear&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; from right&lt;BR /&gt;12 bit - 2 bits &lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;disappear&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; from right&lt;BR /&gt;8 bit - 6 bits &lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;disappear&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; from right&lt;/P&gt;
&lt;P&gt;For left aligned and&lt;BR /&gt;14 bit - 2 bits (i.e. 16-14) &lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;disappear&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; from right&lt;BR /&gt;12 bit - 4 bits &lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;disappear&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; from right&lt;BR /&gt;8 bit - 8 bits &lt;SPAN class="HwtZe"&gt;&lt;SPAN class="jCAhz ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;disappear&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; from right&lt;/P&gt;
&lt;P&gt;If you application cannot use it in this format, you will have to perform shifts SW way or use different alignment.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2022 14:37:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K344-ADC-data-alignment-and-bit-resolution/m-p/1573190#M19578</guid>
      <dc:creator>davidtosenovjan</dc:creator>
      <dc:date>2022-12-21T14:37:44Z</dc:date>
    </item>
  </channel>
</rss>

