Go Down

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

pc_john


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?
http://www.dorkbotpdx.org/blog/paul/better_spi_bus_design_in_3_steps

pc_john

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
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy