<?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>topic String through SPI in MBDT in Model-Based Design Toolbox (MBDT)</title>
    <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/String-through-SPI-in-MBDT/m-p/1738360#M8586</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am using S32k344 with MBDT.&lt;/P&gt;&lt;P&gt;I am able to send numerical value using SPI blocks.&lt;/P&gt;&lt;P&gt;But how send and receive strings like 'Hello' using SPI.&lt;/P&gt;&lt;P&gt;I am using example 'SPI Master Asynchronous Interrupt Transfer S32CT'&lt;/P&gt;&lt;P&gt;Please can you explain using images.&lt;/P&gt;</description>
    <pubDate>Thu, 12 Oct 2023 07:22:43 GMT</pubDate>
    <dc:creator>avinashstarkenn</dc:creator>
    <dc:date>2023-10-12T07:22:43Z</dc:date>
    <item>
      <title>String through SPI in MBDT</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/String-through-SPI-in-MBDT/m-p/1738360#M8586</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am using S32k344 with MBDT.&lt;/P&gt;&lt;P&gt;I am able to send numerical value using SPI blocks.&lt;/P&gt;&lt;P&gt;But how send and receive strings like 'Hello' using SPI.&lt;/P&gt;&lt;P&gt;I am using example 'SPI Master Asynchronous Interrupt Transfer S32CT'&lt;/P&gt;&lt;P&gt;Please can you explain using images.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2023 07:22:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/String-through-SPI-in-MBDT/m-p/1738360#M8586</guid>
      <dc:creator>avinashstarkenn</dc:creator>
      <dc:date>2023-10-12T07:22:43Z</dc:date>
    </item>
    <item>
      <title>Re: String through SPI in MBDT</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/String-through-SPI-in-MBDT/m-p/1743096#M8621</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/221165"&gt;@avinashstarkenn&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you were able to validate your numerical data transmission, there should be no issues when trying to send strings via SPI. You can see a string as an array of uint8 elements, since each character can be represented numerically on 8 bits. The &lt;STRONG&gt;Spi_SetupEB&lt;/STRONG&gt; function is the one that sets up the data to be transmitted for the selected &lt;STRONG&gt;Channel&amp;nbsp;&lt;/STRONG&gt;and it&amp;nbsp;expects a buffer of &lt;STRONG&gt;uint8&lt;/STRONG&gt; elements as its input.&lt;/P&gt;
&lt;P&gt;Hence, for transmitting the &lt;STRONG&gt;"hello"&lt;/STRONG&gt; string via SPI you could use a Simulink Constant block with the &lt;STRONG&gt;Value&lt;/STRONG&gt;&amp;nbsp;parameter set to &lt;STRONG&gt;uint8('hello')&lt;/STRONG&gt; and feed it to the Source Buffer input of the block, like illustrated in the image below.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Irina_Costachescu_1-1697734333372.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/245978iBD4E2B075297DECE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Irina_Costachescu_1-1697734333372.png" alt="Irina_Costachescu_1-1697734333372.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;If we setup the transmission buffer in this way, after deploying the application on target, you could connect a logic analyzer device to the target board on the pins of the instance corresponding to Channel0 used in the model, and you should see the &lt;STRONG&gt;"hello"&lt;/STRONG&gt; string on the MOSI line. (I have used Channel0 for this, which is associated to the LPSPI2 Master Instance, as described by the configuration project associated to the model &lt;EM&gt;modelName_Config.mex&lt;/EM&gt; file).&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Irina_Costachescu_2-1697734536410.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/245979i985F20C1110BBE9E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Irina_Costachescu_2-1697734536410.png" alt="Irina_Costachescu_2-1697734536410.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please let us know if this is the use case that you are interested in or if more details are required from our side.&lt;/P&gt;
&lt;P&gt;Thank you,&lt;BR /&gt;Irina&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2023 16:55:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/String-through-SPI-in-MBDT/m-p/1743096#M8621</guid>
      <dc:creator>Irina_Costachescu</dc:creator>
      <dc:date>2023-10-19T16:55:51Z</dc:date>
    </item>
  </channel>
</rss>

