This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Setting the SCLK of my SPI master

Hi, 

Sorry if my english isn't perfect but I have a quick question and I could't find a good answer for what I'm looking for. I'm using a FPGA Arty S7 as a SPI master and a nRF52840 as a SPI slave. I want to know if I can set my master SCLK as a value that isn't in the bank of the nRF52840 SPI (125k, 250k, ... 8mbps).

Since my SPI master is working on a 100MHz clock and I can only work with a clk_div as an integer for dividing the clock of the FPGA for my SCLK, I can't set a good value for 4MHz or 8mHz. For my project, I want to have the fastest I can get (closest to 8MHz). I tried to set my master with a clk_div of 8 which technically should get me a SCLK of 6.25MHz but it doesn't seem to work since I'm getting wrong data. When I set my clk_div to 25, I get a good 2MHz which make everything working fine and I get good data.

Thank you for your answer,

Keven

Parents
  • SCLK as a value that isn't in the bank of the nRF52840 SPI (125k, 250k, ... 8mbps)

    Surely, they only apply when the nRF is generating the clock; ie, when the nRF is Master?

    If the nRF is the slave, then it receives its clock from the Master; it doesn't have to generate it, so isn't constrained by that list.

    The only constraint would be that you don't exceed the maximum clock which the nRF can accept.

Reply
  • SCLK as a value that isn't in the bank of the nRF52840 SPI (125k, 250k, ... 8mbps)

    Surely, they only apply when the nRF is generating the clock; ie, when the nRF is Master?

    If the nRF is the slave, then it receives its clock from the Master; it doesn't have to generate it, so isn't constrained by that list.

    The only constraint would be that you don't exceed the maximum clock which the nRF can accept.

Children
Related