How to modify the frequency of the host to a desired value for 52832 SPI,such as 20M.

I am using SPI for communication (52832 as the master and esp323c as the slave). The spi frequency of esp323c is set to 20M, while the spi frequency of 52832 can only be set to 2,4,8,16,32 in the structure. Can I change the spi frequency of 52832 as the master to a specific value, such as 20M.

Please can someone give any suggestions? Thanks.

Parents
  • esp323c as a Slave surely accepts the nRF52 SCK whatever the SCK frequency generated by the nRF52 Master? Master Mode on the esp323c can additionally be set to any of the nRF52 frequencies, not just 20M, in case it has some unusual requirement, unless the esp323c code is not available ..

    Suggest just try nRF52 Master to esp323c Slave, it should just work regardless of SCK setting.

  • Thank you for your suggestion.You are right, Master Mode on the esp323c can additionally be set to any of the nRF52 frequencies,But when ESP323c was used as a slave, I didn't seem to find the communication frequency setting, and later learned that it was using the default 20M.And I need to send a data write request and read the register status of ESP323c, and receive 0X2 to prove that the slave can write data at this time before sending data to ESP323c (I captured the waveforms of each pin of ESP323c at this time, as shown in the figure above). However, at this time, ESP323c did not return the correct data. I suspect that the communication frequency between the two parties may be inconsistent, which may have caused the data received by the slave to be inaccurate.Please can you give any suggestions? Thanks.

Reply
  • Thank you for your suggestion.You are right, Master Mode on the esp323c can additionally be set to any of the nRF52 frequencies,But when ESP323c was used as a slave, I didn't seem to find the communication frequency setting, and later learned that it was using the default 20M.And I need to send a data write request and read the register status of ESP323c, and receive 0X2 to prove that the slave can write data at this time before sending data to ESP323c (I captured the waveforms of each pin of ESP323c at this time, as shown in the figure above). However, at this time, ESP323c did not return the correct data. I suspect that the communication frequency between the two parties may be inconsistent, which may have caused the data received by the slave to be inaccurate.Please can you give any suggestions? Thanks.

Children
  • There is no default 20M on Slave Mode. Forget the communication frequency, unless the nRF52 is using high frequencies in which case use High-Drive for CLK, MOSI and CS - in fact always start with H0H1 drive on those 3 signals output from the nRF52, silly not to. Start with a lowish frequency on the nRF52, say 4MHz, it can always be made higher later.

    Most likely issue is SPI format, LSB/MSB first and polarity stuff, all of which must match ESP323c settings and not be left to defaults on the nRF52. Code on the ESP323c is using specific settings which must be replicated on the nRF52 SPI, perhaps post a list of code for both ESP323c and nRF52 for review..

Related