Giter Site home page Giter Site logo

serial speed for pn532 about libnfc HOT 5 OPEN

paweljasinski avatar paweljasinski commented on July 18, 2024
serial speed for pn532

from libnfc.

Comments (5)

NFC-funs avatar NFC-funs commented on July 18, 2024

hi,paweljasinski:
Speed value must be one of these constants: 9600 (default), 19200, 38400, 57600, 115200, 230400 or 460800.", uiPortSpeed); It's in the file β€œuart.c”.
But 115200 is the PN532's default value. If you want to use other baud, you must use "SetSerialBaudRate" command first.
image

from libnfc.

paweljasinski avatar paweljasinski commented on July 18, 2024

To be sure I am not misunderstanding anything.

  • establish communication with the default 115200,
  • issue the SetSerialBaudRate
  • re-establish communication with a new speed

from libnfc.

NFC-funs avatar NFC-funs commented on July 18, 2024

Please refer to the diagram:
image
To be sure that the baud rate-"Real HSU Freq" error is not greater than 4%:
image

PN532 User Manual V0.2.pdf
PN532_C1.pdf

from libnfc.

paweljasinski avatar paweljasinski commented on July 18, 2024

already have a basic communication with 230.4.

To be sure that the baud rate-"Real HSU Freq" error is not greater than 4%:
Do I have to adjust registers value (HSU_CNT and HSU_PRE) myself, or it happens as part of SetSerialBaudRate?

I have another question:
Once the comm speed is changed from default, it is persistent until reset or power cycle.
For now I am coding with assumption that libnfc works with the board after reset and starts with 115200 and changes to requested speed. The code is not trying to reestablished communication after program terminated but board did not get reset and is still using the altered speed.
Is this something you would considered to be acceptable in PR?

from libnfc.

NFC-funs avatar NFC-funs commented on July 18, 2024

Poll the command "SAMConfiguration" at different baud rates before communication, such as: 55 55 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF 03 FD D4 14 01 17 00, and receive the right ACK.

from libnfc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.