I am have this project that I would like to connect to two different SPI slave devices on an Arduino UNO. My datasheets for the two devices state the have different baud and bit rates.
It is look like:
Device 1 has a bitrate of 8 bit and will require clock divider of 16
Device 2 has a bitrate of 16 bit and will require clock divider of 128
In SPI Platform, bit rate refers to number of bits being transmitted/received in one second. If clock divider 16 is chosen, then for Device 1/Slave 1, the bit rate is 16 MHz/16 = 1 MBits/sec.
For Device 2/Slave 2, the bit rate is 16 MHz/128 = 125 KBits/sec.
True, the third-party code was actually snippets from Slave 1 and Slave 2 which I merged. The datasheet for Slave 2 actually states a data rate of 2MBaud, so I should be able to use clock divider the same as Slave 1 or even 8 if wanting maximum? It is strange that they chose such slow data rate in their code. I wonder what the reason is.
Any opportunity to see your full codes (Master and two Slaves) to test how they go with my setup composed of UNO1-SPI Master, NANO1-SPISLave1, and UNO2-SPISlave2.