Can the NXP PN532 work on UART at a 38400 baud rate? - nfc

I am trying to integrate an RFID1356MIFARE, which uses NXP PN532, with an ESP32-EVB using their UART capabilities.
The NXP docs states that the PN532 is able to communicate on High Speed UART.
I am trying to use 38400 because that's the baud rate fixed by the reader that I'm using.
I've found a modified Adafruit PN532 library that added HSU support. This library states that HSU uses 115200 baud rate.
Now, I've modified PN532_HSU.cpp, where we can find:
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.
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.
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. the follow following steps:
Put device in UART/ USB CDC mode depending on how you connected device to computer. Exact method to do this is provided in operation section of documentation
Use picoterm / screen or other serial terminal (if you are using Linux) or just use Arduino serial monitor with correct baud rate to connect device.(115200 for USB and 38400 for UART)
Type in commands listed in COMMAND SET FOR CDC AND UART MODE section in documentation to check if module is working or not.
Place some cards over reader to check what response does module sends when card is detected.
Use this information to develop your own library for reader.
It will not work with regular PN532 libraries. 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. For HSU both pins must be pulled down. 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? 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

Related

USB stack confusion/serial emulator

I am looking at implementing USB communication on a MCU which has a USB engine built into it. Basically you have access to the pipes/endpoints.
I am a little bit confused on the USB stack now. It appears that drivers operate on another level above the pipe/endpoint setup, so the pipe/endpoint is like a middle level layer that drivers are built on. Is this correct?
Secondly, I am interested in simulating serial communication over USB. It appears windows has a premade driver so on the computer side I do not need to program the pipe level.
How do I find out what I need to implement on the MCU to make it behave correctly with the generic serial driver?
This is an answer to your second question regarding the serial communication.
The USB standard defines a communication device class (CDC) for serial communication. The required drivers on the host side are implemented by Windows, macOS, Linux and many more operation systems.
The relevant CDC subclass is PSTN. The relevant documents are found in Class definition for Communication Devices 1.2.
The device basically implements four endpoints:
Control endpoint for configuration requests (baud rate, DTR state etc.). Have a look at SetLineCodeing, GetLineCoding and SetControlLineState.
Bulk endpoint for USB to serial transmission
Bulk endpoint for serial to USB transmission
Interrupt endpoint for notifications (DCD state, errors). See SerialState.
And of course you need to get the device descriptor right.
On top of that, you need to implement all the standard USB requests.
Chances are high that this has already been written for your MCU, both the standard requests and the serial communication. So why not use the existing code?

UART C/C++ code in wxWidgets for raspberryPI

I want to connect the module HC05 (with UART protocol) to Raspberry pi and see the receiving result on wxwidgets (code-blocks GUI).
where can i write UART code in wxwidgets?
How can i write each protocol in wxwidgets?
wxWidgets doesn't provide a uniform API for communicating with serial ports, as explained here.
The Raspberry Pi is typically running a Linux distribution where serial ports are exposed as special device files such as /dev/stty0. Consult your favorite Linux/Raspberry Pi documentation for information on how to configure serial port parameters. Once configured, just read/write to the file in order to communicate with whatever devices is attached to the port.

M210 DJI drone can't find UART pins

I am currently working on the serial communication on the M210 drone from DJI and I would like to test a programm using the serial communication. I know there are UART pins on the expansion ports but I cant find the documentation on the constructor's website to know which pins belong to Rx and Tx.
If someone has the information or knows where to find it.
Ps: I looked all the documentation on DJI's website about M210 and found nothing
Page 40 of the user manual you'll find this pin description:
I hope this helps

How can send speech with STM32F401 nucleo boards?

I am working on stm32f401 nucleo boards and I want to communicate 2 boards each others with uart for sending speech.
I am using Nucleo-CCA02M1 mems microphone kits. Should I use which one? RS422 or RS485 for a full dublex communication? Are there any example about that for helping?
Thank you.
If you want to use RS422 or RS485, you will need converter board to change uart to RS422 or RS485. Also, you do not need make any modification on your uart code to use any of them. These communication protocals are related with hardware. Uart, RS232, RS422 and RS485 are all serial communication. You can use any uart code for them.

How to find the device is connected to whether USB port 2.0 or USB port 3.00 ?

I just want to know how to find a usb device is connected to USB3.0 or USB2.0 port in window . I am using c++ and win32 API. please let me know your thoughts.
Based on how your question is phrased, I assume that you know when a device is connected, and need to know if the port it's connected is capable of USB 3.0 speeds.
Take a look at the USB_NODE_CONNECTION_INFORMATION_EX structure, and specifically the field Speed in it, which could correspond to a value defined in the enum USB_DEVICE_SPEED. For USB 3.0, the value of Speed would be UsbSuperSpeed.
The documentation page says that you could use IOCTL_USB_GET_NODE_CONNECTION_INFORMATION_EX request to obtain information about the connection associated with the indicated USB port.
You may also find the following remarks from the documentation helpful:
If there is no device connected, IOCTL_USB_GET_NODE_CONNECTION_INFORMATION_EX just returns information about the port.
If a device is connected to the port IOCTL_USB_GET_NODE_CONNECTION_INFORMATION_EX returns information about both the port and the connected device.
The USB_NODE_CONNECTION_INFORMATION_EX structure is an extended version of USB_NODE_CONNECTION_INFORMATION. The two structures are identical, except for one member. In the extended structure, the Speed member indicates the device speed.
I'd also encourage you to single-step through the usbview project which is part of the windows driver samples available in Github.

Resources