2021-06-18 01:57 PM
I am communicating Nucleo H743 with several PN532s using SPI. I edited waveshare's stm32 codes, I didn't use DMA or interrupt. I am trying to reduce the SPI speed so that the reader can work when I extend the cable length. Since I could choose the SPI clock other than the bus speed, I thought I could run SPI at very low speeds while the processor was running at full speed. however, when I try to operate SPI1 at less than 1/128th of the bus speed and SPI5 at less than 1/256 of the bus speed, I have problems communicating with the PN532. When I reduce the processor speed, I can reduce the communication speed within the above rates. I don't have anything else working with SPI right now, I don't know if the problem will repeat on other devices. What I am encountering is a known issue? I plan to use ethernet communication in the same application. I don't want to reduce the processor speed. Is there a way to slow down the SPI speed without reducing the processor speed?
2021-06-18 02:11 PM
> I have problems communicating with the PN532
What problems are those?
> Is there a way to slow down the SPI speed without reducing the processor speed?
Both SPI1 and SPI5 have multiple clocks available as the source. You can use a different one and configure it accordingly.
2021-06-18 02:34 PM
Strangely, I have a communication problem when I set the spi prescaler for baud rate to 256 after reducing the spi speed from these settings. When I reduce the speed, sometimes the PN532 can read the card's ID, sometimes the wrong reading code is returned.
2021-06-18 08:59 PM
Have you seen this thread? Do you use counted transfer mode (EOT)?