<?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 Re: SECTOR_SELECT command with PN532 in Other NXP Products</title>
    <link>https://community.nxp.com/t5/Other-NXP-Products/SECTOR-SELECT-command-with-PN532/m-p/796560#M6119</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm sorry but I stopped working on that project a year ago, and as far as I remember I was not able to solve it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 30 Jan 2020 10:30:18 GMT</pubDate>
    <dc:creator>nkose13</dc:creator>
    <dc:date>2020-01-30T10:30:18Z</dc:date>
    <item>
      <title>SECTOR_SELECT command with PN532</title>
      <link>https://community.nxp.com/t5/Other-NXP-Products/SECTOR-SELECT-command-with-PN532/m-p/796555#M6114</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="padding: 0px;"&gt;Hello,&lt;/P&gt;&lt;P style="padding: 0px;"&gt;&lt;/P&gt;&lt;P style="padding: 0px;"&gt;I am trying to read the session registers in an NXP NTAG I2C 1k with a PN532 using an Arduino board to eventually communicate in Pass-through mode. I downloaded an NFC library for Arduino that includes most of the functions like "Read Page" or "Write Page". For example, WritePage command looks like this:&lt;/P&gt;&lt;P style="padding: 0px;"&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro" style="background: none #f6f6f6; border-left: 2px solid #cccccc; margin: 10px 0px; padding: 10px 20px;"&gt;&lt;P style="padding: 0px;"&gt;uint8_t PN532::mifareultralight_WritePage (uint8_t page, uint8_t *buffer)&lt;BR /&gt;{&lt;BR /&gt;/* Prepare the first command */&lt;BR /&gt;pn532_packetbuffer[0] = PN532_COMMAND_INDATAEXCHANGE;&lt;BR /&gt;pn532_packetbuffer[1] = 1; /* Card number */&lt;BR /&gt;pn532_packetbuffer[2] = MIFARE_CMD_WRITE_ULTRALIGHT; /* Mifare UL Write cmd = 0xA2 */&lt;BR /&gt;pn532_packetbuffer[3] = page; /* page Number (0..63) */&lt;BR /&gt;memcpy (pn532_packetbuffer + 4, buffer, 4); /* Data Payload */&lt;/P&gt;&lt;P style="padding: 0px;"&gt;/* Send the command */&lt;BR /&gt;if (HAL(writeCommand)(pn532_packetbuffer, 8)) {&lt;BR /&gt;return 0;&lt;BR /&gt;}&lt;/P&gt;&lt;P style="padding: 0px;"&gt;/* Read the response packet */&lt;BR /&gt;return (0 &amp;lt; HAL(readResponse)(pn532_packetbuffer, sizeof(pn532_packetbuffer)));&lt;BR /&gt;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P style="padding: 0px;"&gt;&lt;/P&gt;&lt;P style="padding: 0px;"&gt;So I added a SectorSelect command based on the WritePage function. I used PN532_COMMAND_INCOMMUNICATETHRU instead of INDATAEXCHANGE, and the function expects a timeout after the second command instead of an ACK response:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro" style="background: none #f6f6f6; border-left: 2px solid #cccccc; margin: 10px 0px; padding: 10px 20px;"&gt;&lt;P style="padding: 0px;"&gt;&lt;/P&gt;&lt;P style="padding: 0px;"&gt;uint8_t PN532::SectorSelect (uint8_t sectorNumber)&lt;BR /&gt;{&lt;BR /&gt;/* Prepare the command */&lt;BR /&gt;pn532_packetbuffer[0] = PN532_COMMAND_INCOMMUNICATETHRU; //(0x42)&lt;BR /&gt;pn532_packetbuffer[1] = 1; /* Card number */&lt;BR /&gt;pn532_packetbuffer[2] = PN532_CMD_SECTOR_SELECT;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;pn532_packetbuffer[3] = 0xFF;&lt;/P&gt;&lt;P style="padding: 0px;"&gt;/* Send the command */&lt;BR /&gt;if (HAL(writeCommand)(pn532_packetbuffer, 4)) {&lt;BR /&gt;Serial.print("\n1st Sector Select Command Failed");&lt;BR /&gt;return 0;&lt;BR /&gt;}&lt;/P&gt;&lt;P style="padding: 0px;"&gt;/* Read the response packet */&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;HAL(readResponse)(pn532_packetbuffer, sizeof(pn532_packetbuffer));&lt;/P&gt;&lt;P style="padding: 0px;"&gt;/* Prepare the 2nd command */&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;pn532_packetbuffer[0] = PN532_COMMAND_INCOMMUNICATETHRU; //(0x42)&lt;BR /&gt;pn532_packetbuffer[1] = 1; /* Card number */&lt;BR /&gt;pn532_packetbuffer[2] = sectorNumber;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;pn532_packetbuffer[3] = 0x00;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;pn532_packetbuffer[4] = 0x00;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;BR /&gt;pn532_packetbuffer[5] = 0x00;&lt;/P&gt;&lt;P style="padding: 0px;"&gt;/* Send the 2nd command */&lt;BR /&gt;if (HAL(writeCommand)(pn532_packetbuffer, 6) &amp;gt; -2 ){&lt;BR /&gt;Serial.print("\n2nd Sector Select Command Failed");&lt;BR /&gt;return 0;&lt;BR /&gt;}&lt;/P&gt;&lt;P style="padding: 0px;"&gt;/* Read the response packet */&lt;BR /&gt;HAL(readResponse)(pn532_packetbuffer, sizeof(pn532_packetbuffer));&lt;/P&gt;&lt;P style="padding: 0px;"&gt;Serial.print("\n2nd Sector Select Command Successful");&lt;BR /&gt;// Return OK signal&lt;BR /&gt;return 1;&lt;BR /&gt;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P style="padding: 0px;"&gt;I have a few questions regarding this piece of code I wrote.&amp;nbsp;&lt;/P&gt;&lt;P style="padding: 0px;"&gt;1) The timeout duration defined in this library is 10 ms, however the datasheet says that 1 ms of no response is enough for a Passive ACK. So at the beginning, I only waited for 1 ms and did not get any response so the function returned the OK signal. However,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;when I try&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;sending a ReadPage command after a sector select command I got an error with the read function even though it works normally before a sector select.&lt;/P&gt;&lt;P style="padding: 0px;"&gt;&lt;/P&gt;&lt;P style="padding: 0px;"&gt;2) After that I tried waiting for 10 ms for the Passive ACK signal, but weird enough instead of getting no response or a NACK response, I eventually get an ACK response after the second sector_select command as well, so the function gives an error, and a ReadPage command does not work afterwards either.&lt;/P&gt;&lt;P style="padding: 0px;"&gt;&lt;/P&gt;&lt;P style="padding: 0px;"&gt;Any advice or comment would be much appreciated.&lt;/P&gt;&lt;P style="padding: 0px;"&gt;&lt;/P&gt;&lt;P style="padding: 0px;"&gt;&lt;/P&gt;&lt;P style="padding: 0px;"&gt;*** The library I originally used and changed is at :&amp;nbsp;&lt;SPAN style="font-size: 11.0pt;"&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=https%3A%2F%2Fgithub.com%2FSeeed-Studio%2FPN532" rel="nofollow" target="_blank"&gt;https://github.com/Seeed-Studio/PN532&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Oct 2018 12:22:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Other-NXP-Products/SECTOR-SELECT-command-with-PN532/m-p/796555#M6114</guid>
      <dc:creator>nkose13</dc:creator>
      <dc:date>2018-10-16T12:22:37Z</dc:date>
    </item>
    <item>
      <title>Re: SECTOR_SELECT command with PN532</title>
      <link>https://community.nxp.com/t5/Other-NXP-Products/SECTOR-SELECT-command-with-PN532/m-p/796556#M6115</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am sorry, but which data sheet you referred to? I didn't find the "1 ms" statement you mentioned. Please kindly clarify.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your patience！&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Kan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Oct 2018 07:26:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Other-NXP-Products/SECTOR-SELECT-command-with-PN532/m-p/796556#M6115</guid>
      <dc:creator>Kan_Li</dc:creator>
      <dc:date>2018-10-18T07:26:08Z</dc:date>
    </item>
    <item>
      <title>Re: SECTOR_SELECT command with PN532</title>
      <link>https://community.nxp.com/t5/Other-NXP-Products/SECTOR-SELECT-command-with-PN532/m-p/796557#M6116</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="sectorselect.PNG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/76398i992045722F33BB2C/image-size/large?v=v2&amp;amp;px=999" role="button" title="sectorselect.PNG" alt="sectorselect.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This is the SECTOR SELECT command explained in the datasheet of&amp;nbsp;NT3H1101&lt;/P&gt;&lt;P&gt;(you can find it here: &lt;A class="link-titled" href="https://www.mouser.com/ds/2/302/NT3H1101_1201-1127167.pdf" title="https://www.mouser.com/ds/2/302/NT3H1101_1201-1127167.pdf"&gt;https://www.mouser.com/ds/2/302/NT3H1101_1201-1127167.pdf&lt;/A&gt;&amp;nbsp;)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Oct 2018 09:27:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Other-NXP-Products/SECTOR-SELECT-command-with-PN532/m-p/796557#M6116</guid>
      <dc:creator>nkose13</dc:creator>
      <dc:date>2018-10-26T09:27:32Z</dc:date>
    </item>
    <item>
      <title>Re: SECTOR_SELECT command with PN532</title>
      <link>https://community.nxp.com/t5/Other-NXP-Products/SECTOR-SELECT-command-with-PN532/m-p/796558#M6117</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the information!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but maybe you have some misunderstanding with the data sheet, referring to the following info from the data sheet of NT3H1101, you have to wait for 10 ms for the Passive ACK.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/65997iC19D19A8D057FE48/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Kan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Oct 2018 03:20:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Other-NXP-Products/SECTOR-SELECT-command-with-PN532/m-p/796558#M6117</guid>
      <dc:creator>Kan_Li</dc:creator>
      <dc:date>2018-10-29T03:20:05Z</dc:date>
    </item>
    <item>
      <title>Re: SECTOR_SELECT command with PN532</title>
      <link>https://community.nxp.com/t5/Other-NXP-Products/SECTOR-SELECT-command-with-PN532/m-p/796559#M6118</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;did you solve the problem?&lt;/P&gt;&lt;P&gt;I have the same hardware (Arduino and&amp;nbsp;PN532)&amp;nbsp;here and want to read some pages from the sector 1 of an NT3H2211.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jan 2020 08:53:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Other-NXP-Products/SECTOR-SELECT-command-with-PN532/m-p/796559#M6118</guid>
      <dc:creator>sebastian_matt</dc:creator>
      <dc:date>2020-01-29T08:53:55Z</dc:date>
    </item>
    <item>
      <title>Re: SECTOR_SELECT command with PN532</title>
      <link>https://community.nxp.com/t5/Other-NXP-Products/SECTOR-SELECT-command-with-PN532/m-p/796560#M6119</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm sorry but I stopped working on that project a year ago, and as far as I remember I was not able to solve it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jan 2020 10:30:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Other-NXP-Products/SECTOR-SELECT-command-with-PN532/m-p/796560#M6119</guid>
      <dc:creator>nkose13</dc:creator>
      <dc:date>2020-01-30T10:30:18Z</dc:date>
    </item>
  </channel>
</rss>

