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

Dynamic SPI Baut Rate

Hello,

Is it possible to change SPI baud rate whenever we want?

For example:

The initial SPI baud rate is set to 4M. We want to change the baud rate to "2M" to get some special data then set it back to the initial baud rate 4M.

Thanks,

Sara

Parents
  • Hello sara

    It is not possible to change the baud rate of the SPI while it is running. The Baud rate is set on SPI initialize for the specific SPI instance. To change the baud rate the SPI instance must therefore first be uninitialized, and then reinitialized with the new baud rate.

    EDIT 06.04.17: Based on the link provided by Jeff in the comments it seems it might actually be possible to change the frequency without reinitializing the SPI-instance by writing to the peripheral register when not transmitting. We currently have no documentation on this, so I can't really comment further on it without doing some tests myself.

    Best regards

    Jørn Frøysa

Reply
  • Hello sara

    It is not possible to change the baud rate of the SPI while it is running. The Baud rate is set on SPI initialize for the specific SPI instance. To change the baud rate the SPI instance must therefore first be uninitialized, and then reinitialized with the new baud rate.

    EDIT 06.04.17: Based on the link provided by Jeff in the comments it seems it might actually be possible to change the frequency without reinitializing the SPI-instance by writing to the peripheral register when not transmitting. We currently have no documentation on this, so I can't really comment further on it without doing some tests myself.

    Best regards

    Jørn Frøysa

Children
Related