Go Down

Topic: digiPot and IMU not compatible on SPI bus (Read 307 times) previous topic - next topic


Arduino Uno
IMU - http://www.jebobrow.com/
digiPot - https://www.arduino.cc/en/Tutorial/SPIDigitalPot

IMU data goes erratic just as soon as digiPot SPI.transfer(address) command is used.

void digitalPotWrite(int address, int value) {
  digitalWrite(slaveSelectPin,LOW);    // select the chip:

--> here //  SPI.transfer(address);  // send address and value via SPI:

//  SPI.transfer(value);
  digitalWrite(slaveSelectPin,HIGH);   // de-select the chip:

If I leave the comments in on that line, the IMU gives good data.  If I uncomment that line, the data from the IMU is incorrect.  Do I need to use beginTransaction () or some such?  Why doesn't this work?

SPI bus?


circuit is clk common to both, spi (in) common to both and digiPot chip select to arduino 7 and IMU CS to Arduiono 8

Go Up