<?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: SIUL write pin time</title>
    <link>https://community.nxp.com/t5/S32K/SIUL-write-pin-time/m-p/1944330#M40384</link>
    <description>&lt;P&gt;Ok, I removed the LOCK/UNLOCK section of the&amp;nbsp;Siul2_Dio_Ip_WritePin function and now it takes 265ns.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you said if each instruction takes 5 cycles and REGISTER SET section needs 10 instructions it must be 400ns, which more or less matches with the 265ns measured.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the support!&lt;/P&gt;</description>
    <pubDate>Fri, 30 Aug 2024 08:37:07 GMT</pubDate>
    <dc:creator>JCastro</dc:creator>
    <dc:date>2024-08-30T08:37:07Z</dc:date>
    <item>
      <title>SIUL write pin time</title>
      <link>https://community.nxp.com/t5/S32K/SIUL-write-pin-time/m-p/1942391#M40252</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I'm trying to measure my function time using a pin configured as SIUL output, but I realize that running a pin HIGH and LOW takes between 1.8us and 2.2us (measured using an oscilloscope). I'm using the function&amp;nbsp;Siul2_Dio_Ip_WritePin defined in the RTD drivers. The MCU is the S32K311 running at 160MHz and SIUL peripheral at 30MHz.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The datasheet specifies that the pin rising/falling time (hw) is between 1 and 18ns, so the rest of time must be in consumed by the RTD driver, checking the disassembly it doesn't seem that this function needs too much time. Am I missing something? Why does the MCU need ~2us to run a write pin command?&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2024 15:04:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/SIUL-write-pin-time/m-p/1942391#M40252</guid>
      <dc:creator>JCastro</dc:creator>
      <dc:date>2024-08-28T15:04:34Z</dc:date>
    </item>
    <item>
      <title>Re: SIUL write pin time</title>
      <link>https://community.nxp.com/t5/S32K/SIUL-write-pin-time/m-p/1943061#M40265</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;The datasheet specifies that the pin rising/falling time (hw) is between 1 and 18ns&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This is the switch of pin level time when your SW ask for it and the micro deliver the signal to the port pin.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="petervlna_0-1724909114892.png" style="width: 898px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/295960i20F89F94E7E32475/image-dimensions/898x180?v=v2" width="898" height="180" role="button" title="petervlna_0-1724909114892.png" alt="petervlna_0-1724909114892.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also it depends how do you measure the event. Fastest way is to simply which it via GPDO in debugger which will do the direct write to the register.&lt;/P&gt;
&lt;P&gt;RTDs are not efficient, and if you are running the switch in interrupt or in some OS task is even worse.&lt;/P&gt;
&lt;P&gt;I would say, that 2us is reasonable time, considering all that added SW and measurement delay.&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Peter&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2024 05:25:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/SIUL-write-pin-time/m-p/1943061#M40265</guid>
      <dc:creator>petervlna</dc:creator>
      <dc:date>2024-08-29T05:25:31Z</dc:date>
    </item>
    <item>
      <title>Re: SIUL write pin time</title>
      <link>https://community.nxp.com/t5/S32K/SIUL-write-pin-time/m-p/1943298#M40289</link>
      <description>&lt;P&gt;Assuming the following code:&lt;/P&gt;&lt;PRE&gt;while(1) {&lt;BR /&gt;    Siul2_Dio_Ip_WritePin(DEBUG_1_PORT, DEBUG_1_PIN, 0);&lt;BR /&gt;    Siul2_Dio_Ip_WritePin(DEBUG_1_PORT, DEBUG_1_PIN, 1);&lt;BR /&gt;}&lt;/PRE&gt;&lt;P&gt;Stepping into the Siul RTD drivers:&lt;/P&gt;&lt;PRE&gt;void Siul2_Dio_Ip_WritePin(... args ...) {&lt;BR /&gt;    ...&lt;BR /&gt;    empty asserts&lt;BR /&gt;    ...&lt;BR /&gt;&lt;BR /&gt;/* LOCK code */&lt;BR /&gt;    SchM_Enter_Dio_DIO_EXCLUSIVE_AREA_01();&lt;BR /&gt;/* End LOCK code&lt;BR /&gt;&lt;BR /&gt;/* REGISTER SET code&lt;BR /&gt;    Siul2_Dio_Ip_PinsChannelType pinsValues = (Siul2_Dio_Ip_PinsChannelType)base-&amp;gt;PGPDO;&lt;BR /&gt;    pinsValues &amp;amp;= (Siul2_Dio_Ip_PinsChannelType)(~((Siul2_Dio_Ip_PinsChannelType)1U &amp;lt;&amp;lt; (15U - pin)));&lt;BR /&gt;    pinsValues |= (Siul2_Dio_Ip_PinsChannelType)(((Siul2_Dio_Ip_PinsChannelType)value &amp;amp; 1U) &amp;lt;&amp;lt; (15U - pin));&lt;BR /&gt;    base-&amp;gt;PGPDO = pinsValues;&lt;BR /&gt;/* End REGISTER SET code&lt;BR /&gt;&lt;BR /&gt;/* UNLOCK code */&lt;BR /&gt;    SchM_Exit_Dio_DIO_EXCLUSIVE_AREA_01();&lt;BR /&gt;/* End UNLOCK code */&lt;BR /&gt;}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I split into 3 sections, LOCK + REGISTER SET + UNLOCK, if I list the operations done during REGISTER SET:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;1 x memory read&lt;/LI&gt;&lt;LI&gt;2 x substractions&lt;/LI&gt;&lt;LI&gt;2 x bit shift&lt;/LI&gt;&lt;LI&gt;4 x logic operations&lt;/LI&gt;&lt;LI&gt;1 x memory write&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Using a Cortex M7 (S32K311) I assume one cycle per operation will take aprox 10 cycles, at 120MHz core clock == 83ns&amp;nbsp;(correct me if I'm wrong).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I assume that most of that 2us time I see comes from the LOCK/UNLOCK sections.&lt;/P&gt;&lt;P&gt;Can I remove theLOCK/UNLOCK sections from RTD assuming the code is as simple as shown above?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2024 08:55:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/SIUL-write-pin-time/m-p/1943298#M40289</guid>
      <dc:creator>JCastro</dc:creator>
      <dc:date>2024-08-29T08:55:43Z</dc:date>
    </item>
    <item>
      <title>Re: SIUL write pin time</title>
      <link>https://community.nxp.com/t5/S32K/SIUL-write-pin-time/m-p/1944131#M40366</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;Well, even if you do it in OPCODE you will need some load /store instructions executed.&lt;/P&gt;
&lt;P&gt;So it will be like:&lt;/P&gt;
&lt;P&gt;1. load data into core registers&lt;/P&gt;
&lt;P&gt;2. load address of periphery&lt;/P&gt;
&lt;P&gt;3.. store the data into periphery register&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So you will need approximately 5 instructions with average of 5 cycles each.&lt;/P&gt;
&lt;P&gt;so in final 5x5 = 25 cycles.&lt;/P&gt;
&lt;P&gt;For exact calculations refer to the core programming manual where instruction cycles are explained.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But since you are using RTD drivers, you wont mix them with custom code, as you will have hard time doing so.&lt;/P&gt;
&lt;P&gt;Simply there is too much overhead as people these days do not want to understand the device from low level and optimize the code. They want simple and fast way how to program their application and therefore it creates such overhead and require us to create more and more powerful devices to be able handle such overhead.&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Peter&lt;/P&gt;</description>
      <pubDate>Fri, 30 Aug 2024 05:50:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/SIUL-write-pin-time/m-p/1944131#M40366</guid>
      <dc:creator>petervlna</dc:creator>
      <dc:date>2024-08-30T05:50:47Z</dc:date>
    </item>
    <item>
      <title>Re: SIUL write pin time</title>
      <link>https://community.nxp.com/t5/S32K/SIUL-write-pin-time/m-p/1944330#M40384</link>
      <description>&lt;P&gt;Ok, I removed the LOCK/UNLOCK section of the&amp;nbsp;Siul2_Dio_Ip_WritePin function and now it takes 265ns.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you said if each instruction takes 5 cycles and REGISTER SET section needs 10 instructions it must be 400ns, which more or less matches with the 265ns measured.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the support!&lt;/P&gt;</description>
      <pubDate>Fri, 30 Aug 2024 08:37:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/SIUL-write-pin-time/m-p/1944330#M40384</guid>
      <dc:creator>JCastro</dc:creator>
      <dc:date>2024-08-30T08:37:07Z</dc:date>
    </item>
  </channel>
</rss>

