Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 2 of 2

Thread: Spi devices with different clock speeds

  1. #1
    Junior Member
    Join Date
    May 2020
    Posts
    15

    Spi devices with different clock speeds

    Hi, im wondering how to handle spi when chips have diffrent max clock speeds.

    should i change clock speed between communicating with different chips?
    Or should i use two buses with diffrent clocks?
    Or, just use one bus and set the clock acording to max speed of the slowest chip?

    in my case i have a adc(17mhz), dac(50mhz), io expander(10mhz)

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,704
    Use SPI.beginTransaction() to set up the speed and other settings, and SPI.endTransaction() when you're done.

    This is standard on all Arduino boards (though it was originally developed on Teensy). Here's Arduino's documentation:

    https://www.arduino.cc/en/Reference/SPIbeginTransaction

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •