<?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>NFCのトピックRe: NHS3152: Code not running in passive mode (disconnected from power)</title>
    <link>https://community.nxp.com/t5/NFC/NHS3152-Code-not-running-in-passive-mode-disconnected-from-power/m-p/1378212#M9024</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is likely caused by the order of operations as implemented. Only in the call to &lt;FONT face="courier new,courier"&gt;MsgHandler_Init&lt;/FONT&gt; the NFC memory is populated with an NDEF message, which is too late.&lt;/P&gt;
&lt;P&gt;When the IC starts due to the presence of an NFC field, it must create an NDEF message and write it to the NFC memory before the phone starts reading the NFC memory. The time between detecting a tag and starting to read differs greatly from phone to phone and can be as low as 14 ms. That gives your program ~11 ms (minus ~3 ms boot time) to initialize and create a first NDEF message. That NDEF message may be anything, but is nonetheless important, as it ensures the tag is classified as an NDEF tag, and not as an NDEF Formattable tag.&lt;/P&gt;
&lt;P&gt;A fast and easy change would be to call &lt;FONT face="courier new,courier"&gt;MsgHandler_Init&lt;/FONT&gt; directly from &lt;FONT face="courier new,courier"&gt;main&lt;/FONT&gt; instead of from within &lt;FONT face="courier new,courier"&gt;MsgHandler_NFCCommunication&lt;/FONT&gt;. I'm assuming you use an app? The Android default handling of text data in tags is to read teh data once, and then never again. To have an update of the changing data, you need to app to re-trigger reading of the NFC memory.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(Note: since you are using a passive setup, it doesn't make sense to go to sleep. There is a risk in doing so, as &lt;FONT face="courier new,courier"&gt;CT16B0_IRQHandler&lt;/FONT&gt; may be called after testing &lt;FONT face="courier new,courier"&gt;while (sCommunicating)&lt;/FONT&gt; and before actually entering sleep mode. Just removing &lt;FONT face="courier new,courier"&gt;Chip_PMU_PowerMode_EnterSleep&lt;/FONT&gt; would be OK here.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;BR /&gt;Dries.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 29 Nov 2021 13:04:01 GMT</pubDate>
    <dc:creator>driesmoors</dc:creator>
    <dc:date>2021-11-29T13:04:01Z</dc:date>
    <item>
      <title>NHS3152: Code not running in passive mode (disconnected from power)</title>
      <link>https://community.nxp.com/t5/NFC/NHS3152-Code-not-running-in-passive-mode-disconnected-from-power/m-p/1375729#M9015</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi everyone,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am using NXP's NHS3152 NTAG NFC to take a temperature reading using the built-in temperature sensor of the IC, switch ON an LED and measure the optical current of an externally connected photodiode using I2D settings.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;My code seems to work perfectly fine when the development board is connected to a power source (USB or battery). However, no matter what I try, I cannot make the code work in passive mode (without connected to any power source). Instead of reading the expected values I get an 'empty message' NDEF message when&amp;nbsp;the board is not connected to a power source.&lt;/P&gt;&lt;P&gt;I followed the solutions of the following posts but they do not seem to work in my case:&lt;/P&gt;&lt;P&gt;1)&amp;nbsp;&lt;A href="https://community.nxp.com/t5/LPC-Microcontrollers/NHS3152-Write-NDEF-message-containing-integer-values-from-ADC/m-p/1207514" target="_blank"&gt;https://community.nxp.com/t5/LPC-Microcontrollers/NHS3152-Write-NDEF-message-containing-integer-values-from-ADC/m-p/1207514&lt;/A&gt;&lt;/P&gt;&lt;P&gt;2)&amp;nbsp;&lt;A href="https://community.nxp.com/t5/LPC-Microcontrollers/NHS3152-Program-will-only-run-while-connected-to-LPC-link-2-amp/m-p/1186515#M42953" target="_blank"&gt;https://community.nxp.com/t5/LPC-Microcontrollers/NHS3152-Program-will-only-run-while-connected-to-LPC-link-2-amp/m-p/1186515#M42953&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Attached is my code.&lt;/P&gt;&lt;P&gt;Any idea how I can fix this?&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Nov 2021 15:23:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/NFC/NHS3152-Code-not-running-in-passive-mode-disconnected-from-power/m-p/1375729#M9015</guid>
      <dc:creator>pavlospbr</dc:creator>
      <dc:date>2021-11-23T15:23:57Z</dc:date>
    </item>
    <item>
      <title>Re: NHS3152: Code not running in passive mode (disconnected from power)</title>
      <link>https://community.nxp.com/t5/NFC/NHS3152-Code-not-running-in-passive-mode-disconnected-from-power/m-p/1378212#M9024</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is likely caused by the order of operations as implemented. Only in the call to &lt;FONT face="courier new,courier"&gt;MsgHandler_Init&lt;/FONT&gt; the NFC memory is populated with an NDEF message, which is too late.&lt;/P&gt;
&lt;P&gt;When the IC starts due to the presence of an NFC field, it must create an NDEF message and write it to the NFC memory before the phone starts reading the NFC memory. The time between detecting a tag and starting to read differs greatly from phone to phone and can be as low as 14 ms. That gives your program ~11 ms (minus ~3 ms boot time) to initialize and create a first NDEF message. That NDEF message may be anything, but is nonetheless important, as it ensures the tag is classified as an NDEF tag, and not as an NDEF Formattable tag.&lt;/P&gt;
&lt;P&gt;A fast and easy change would be to call &lt;FONT face="courier new,courier"&gt;MsgHandler_Init&lt;/FONT&gt; directly from &lt;FONT face="courier new,courier"&gt;main&lt;/FONT&gt; instead of from within &lt;FONT face="courier new,courier"&gt;MsgHandler_NFCCommunication&lt;/FONT&gt;. I'm assuming you use an app? The Android default handling of text data in tags is to read teh data once, and then never again. To have an update of the changing data, you need to app to re-trigger reading of the NFC memory.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(Note: since you are using a passive setup, it doesn't make sense to go to sleep. There is a risk in doing so, as &lt;FONT face="courier new,courier"&gt;CT16B0_IRQHandler&lt;/FONT&gt; may be called after testing &lt;FONT face="courier new,courier"&gt;while (sCommunicating)&lt;/FONT&gt; and before actually entering sleep mode. Just removing &lt;FONT face="courier new,courier"&gt;Chip_PMU_PowerMode_EnterSleep&lt;/FONT&gt; would be OK here.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;BR /&gt;Dries.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Nov 2021 13:04:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/NFC/NHS3152-Code-not-running-in-passive-mode-disconnected-from-power/m-p/1378212#M9024</guid>
      <dc:creator>driesmoors</dc:creator>
      <dc:date>2021-11-29T13:04:01Z</dc:date>
    </item>
  </channel>
</rss>

