MarkT:
That's a good point - SPI.transfer will work for both master and slave I think (master mode doesn't require the SPDR to be read, but transfer does this anyway).
Dear Sir
Thanks a lot for your kind support. Kindly go through the post Reply #23 on: Today at 05:15:07 PM and please suggest for the modification on the code.
Graynomad:
The Arduino has an 8-bit SPI peripheral and therefore only transmits 8 bits at a time.
However you can just transmit two bytes in a row, the end result is the same.
Rob
Thanks a lot Sir for your kind reply.
I have done like this only , I am sending SPI.transfer(0x3B); SPI.transfer(0x2C); together in a row, and I am happy that it is transmitting both the data and generating 16 clock cycles on Oscilloscope but Sir, between these two consecutive 8 bit data there is a gap or delay on the Oscilloscope. So, for implementation like IMU(ADIS16405) chip where we need to send 16 bit command, how it will work.
The gap/delay between these two 8 bit data will be considered as 0.
After receiving data as data[1] = Slave_receive(); data[2] = Slave_receive(); which are suppose 0x3b and 0x34, Can we concatenate this and display as 0x3b34 on Serial.println(data*, HEX); is it possible to do this.* I am getting two separate data as 0x3b and 0x34 but want to display together as 0x3b34. Can you please guide me how to do this. Thanks and Regards...!!!
Why this following code is not generating 16 clock cycle continuously. Here I am using two continuous SPI.transfre(); but it is not giving 16 clock cycle.
ranjeetray:
Why this following code is not generating 16 clock cycle continuously. Here I am using two continuous SPI.transfre(); but it is not giving 16 clock cycle.
I am seeing the output on Oscilloscope, Tektronix TDS2024C, 200MHz 2GS/s.
Thanks & Regards...
Respected Sir
With the following code Arduino board is not able to generate its own clock it takes another boards when connected with MISO, MOSI, CS and SCK.
I found that once SPI_SlaveReceive(); function is initialized it is not able to generate the clock, if I comment this function or send the data or use SPI.transfer(); before SPI_SlaveReceive(); then it is able to generate the clock.
What would be the reason and how to overcome this problem.