Go Down

Topic: SPI on due board (Read 292 times) previous topic - next topic

herter

Hello,

I want to communicate with a chip via SPI.
So I wrote this test code and I visualize my signals on a oscilloscope.
Indeed, I display the MOSI, SLCK and the CS(/).
Code: [Select]

#include <SPI.h>
void setup(){
  // initialize the bus for a device on pin 10
  SPI.begin(10);
  SPI.setBitOrder(10, MSBFIRST);
  SPI.setDataMode(10, SPI_MODE0);
  SPI.setClockDivider(10, 84);
}
void loop (){
SPI.transfer(10, 0x0F,SPI_CONTINUE);
SPI.transfer(10, 0xF0);
}

In fact, I would like to send 16 bits but, on the one hand, I notice that the MOSI output is not equal at 3.3V and on the other hand that, between the two"spi.transfert()" my sclk is not uniforme and it misses one cycle.

Thank you for your help,
regards.

Go Up