title: Can the NXP PN532 work on UART at a 38400 baud rate?
body: <p>I am trying to integrate an <a href="https://www.olimex.com/Products/Modules/RFID/MOD-RFID1356MIFARE/" rel="nofollow noreferrer">RFID1356MIFARE</a>, which uses NXP PN532, with an <a href="https://www.olimex.com/Products/IoT/ESP32/ESP32-EVB/open-source-hardware" rel="nofollow noreferrer">ESP32-EVB</a> using their UART capabilities.</p>
  <p>The <a href="https://www.nxp.com/docs/en/user-guide/141520.pdf" rel="nofollow noreferrer">NXP docs</a> states that the PN532 is able to communicate on High Speed UART.</p>
  <p>I am trying to use 38400 because that's the baud rate fixed by the reader that I'm using.</p>
  <p>I've found a <a href="https://github.com/elechouse/PN532" rel="nofollow noreferrer">modified Adafruit PN532 library</a> that added HSU support. This library states that <code>HSU uses 115200 baud rate</code>.</p>
  <p>Now, I've modified <code>PN532_HSU.cpp</code>, where we can find:</p>
  <pre><code>void PN532_HSU::begin()
  {
      _serial-&gt;begin(115200);
  }
  </code></pre>
  <p>into</p>
  <pre><code>void PN532_HSU::begin()
  {
      _serial-&gt;begin(38400, SERIAL_8N1, 36, 4);
  }
  </code></pre>
  <p>Unfortunately, I haven't been able to establish communication between the reader and the ESP using this method.</p>
  <p>I am able to get a readable output using normal <code>Serial.read()</code>, so UART communication works, but that's not how you read MIFARE cards.</p>
  <p>I don't know what the problem is.</p>
  <p>What do you think ?</p>