Hello. I'm dealing with some problems conecting multiple devices to Arduino Uno via its SPI. - First device is PS021 by Acam, ADC, SPI: Data order: MSB first, Clock Phase Bit =1, Clock Polarity Bit =0. Already connected, works fine and is the key element in my design, so changing this IC is not an option. - New device I'm trying to implement in my design is bluetooth. I've found Nordic Semiconductor nRF8001 and nRF8002. SPI: Data order: LSB first, Clock polarity: 0(base value for the clock is zero), clock phase: 0(data is read on the clock’s rising edge). So, right here lies my problem, different clock and phase polarity. Can I change SPI_mode in the middle of code? For instance:
digital.write(select_PS021, LOW); SPI.setDataMode(SPI_MODE1); ... digital.write(select_PS021, HIGH)
and then change SPI mode for second device:
digital.write(select_nRF8001, LOW); SPI.setDataMode(SPI_MODE0); ... digital.write(select_nRF8001, HIGH)
How fast is this reconfiguration? Could there be any problems calling this function couple hundreds per seconds(I could try...)? I've got some kind of real time operating system, and time determined code is very important.
If changing SPI mode is not an option... What is simpler? Choose some other AVR with dual SPI interface, or find some other bluetooth device? If anyone know where to find some bluetooth ICs, please help, I did ask uncle Google, but this time he didn't participate... Standard bluetooth modules like HC-05 is not an option(two large) - I'm searching something, that could later be used for mass production... Even better is bluetooth IC with UART interface, but I couldn't find any.