[英]Can the NXP PN532 work on UART at a 38400 baud rate?
I am trying to integrate an RFID1356MIFARE , which uses NXP PN532, with an ESP32-EVB using their UART capabilities.我正在尝试将使用 NXP PN532的 RFID1356MIFARE 与使用其 UART 功能的ESP32-EVB集成。
The NXP docs states that the PN532 is able to communicate on High Speed UART. NXP 文档指出 PN532 能够在高速 UART 上进行通信。
I am trying to use 38400 because that's the baud rate fixed by the reader that I'm using.我正在尝试使用 38400,因为这是我正在使用的阅读器固定的波特率。
I've found a modified Adafruit PN532 library that added HSU support.我发现了一个修改后的 Adafruit PN532 库,它添加了 HSU 支持。 This library states that
HSU uses 115200 baud rate
.该库声明
HSU uses 115200 baud rate
。
Now, I've modified PN532_HSU.cpp
, where we can find:现在,我修改
PN532_HSU.cpp
,我们可以在其中找到:
void PN532_HSU::begin()
{
_serial->begin(115200);
}
into进入
void PN532_HSU::begin()
{
_serial->begin(38400, SERIAL_8N1, 36, 4);
}
Unfortunately, I haven't been able to establish communication between the reader and the ESP using this method.不幸的是,我无法使用这种方法在阅读器和 ESP 之间建立通信。
I am able to get a readable output using normal Serial.read()
, so UART communication works, but that's not how you read MIFARE cards.我可以使用普通的 Serial.read
Serial.read()
获得可读的 output ,因此 UART 通信有效,但这不是您阅读 MIFARE 卡的方式。
I don't know what the problem is.我不知道问题是什么。
What do you think?你怎么看?
[EDIT] [编辑]
I went through the documentation and here is what i suggest: If you have a USB to serial device use it to directly connect reader module to computer else connect it directly using mini USB port in module.我浏览了文档,这是我的建议:如果你有一个 USB 到串行设备,使用它直接将读卡器模块连接到计算机,否则使用模块中的迷你 USB 端口直接连接它。 the follow following steps:
请执行以下步骤:
It will not work with regular PN532 libraries.它不适用于常规 PN532 库。 Instead you'll need to use regular Serial read and write to communicate.
相反,您需要使用常规的串行读写进行通信。
[Original] [原来的]
PN532 datasheet says host interface is selected by pulling up/down I0, I1 pins of device. PN532 数据表中说主机接口是通过上拉/下拉设备的 I0、I1 引脚来选择的。 For HSU both pins must be pulled down.
对于 HSU,两个引脚都必须拉低。 This is implemented in hardware so you need to verify if the mode you want to use is set.
这是在硬件中实现的,因此您需要验证是否设置了要使用的模式。
Looking into the link you posted for module, it says that it uses another micro-controller on board to extend communication capabilities, so maybe you need to use driver for that specific controller firmware?查看您为模块发布的链接,它说它使用板上的另一个微控制器来扩展通信能力,所以也许您需要使用特定 controller 固件的驱动程序? The link seems to have document explaining how to setup different communication system in Document section, please have a look there and check if it works.
该链接似乎有文档说明如何在文档部分设置不同的通信系统,请查看并检查它是否有效。 Link: https://www.olimex.com/wiki/MOD-RFID1356MIFARE
链接: https://www.olimex.com/wiki/MOD-RFID1356MIFARE
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.