Pages: [1]   Go Down
Author Topic: SPI on due board  (Read 286 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
#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.
Logged

Pages: [1]   Go Up
Jump to: