UM6-LT SPI Troubles
Welcome to Redshift Labs › Forums › General Discussion › UM6-LT SPI Troubles
- This topic has 5 replies, 2 voices, and was last updated 8 years, 3 months ago by
Manish Mittal.
-
AuthorPosts
-
7 August 2015 at 3:06 am #821
Eugene Katsevman
GuestHello everybody!
Not sure where to put it, since you don’t have support forum for the 6.
I’m trying to connect old UM6-LT to my Arduino UNO with SPI bus. I do get some data, but it is complete gibberish for me. Please, have a look, and tell me what you think about it.CODE: SELECT ALL EXPAND
#include <SPI.h>void setup() {
Serial.begin(9600);SPI.begin();
delay(100);
}void loop() {
delay(100);
unsigned char data[6];
readRegister(0, (unsigned char *)&data);
for (int i = 0; i < 6; i ++ ){
Serial.print(data[i]);
Serial.print(‘ ‘);
}
Serial.println();
}void readRegister(byte thisRegister, unsigned char * data) {
unsigned char tosend[6] = {0,thisRegister,0,0,0,0};
SPI.beginTransaction(SPISettings(340000, MSBFIRST, SPI_MODE0));
digitalWrite(SS, LOW);
delayMicroseconds(100);SPI.transfer(tosend, 6);
for (int i = 0; i< 6; i++)
data[i] = tosend[i];digitalWrite(SS, HIGH);
SPI.endTransaction();}
void writeRegister(byte thisRegister, byte thisValue) {
}
0 0 0 0 0 0
126 0 0 0 8 15
126 0 0 0 8 15
126 0 0 0 8 15
63 100 221 94 0 0
0 0 0 0 8 15
126 0 0 0 8 15
126 0 0 0 8 15
126 0 0 0 8 15
126 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 8 15
126 0 0 0 8 15
126 0 0 0 8 15
126 0 0 0 8 15
126 0 0 0 8 15
126 0 0 0 8 15
126 0 0 0 8 15
126 0 0 0 8 15
126 0 0 0 8 15
126 0 0 0 8 15
126 0 0 0 0 0
0 0 0 0 8 15
63 100 221 94 0 0
0 0 0 0 8 15
126 0 0 0 8 64
0 0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 8 64
0 0 0 0 0 0
0 0 0 0 8 64
0 0 0 0 8 15
126 0 0 0 8 15
126 0 0 0 0 0
0 0 0 0 8 15
126 0 0 0 8 15
63 100 221 94 0 0
0 0 0 0 0 0
0 0 0 0 8 64
0 0 0 0 8 15
63 100 221 94 0 0clock is connected to pin 13, mosi is 11, miso is 12, ss is 10.
If I change SPI_MODE to 1, output becomes stabilized like that
0 128 64 128 85 0
0 128 64 128 85 0
0 128 64 128 85 0
0 128 64 128 85 0
0 128 64 128 85 0
0 128 64 128 85 0
0 128 64 128 85 07 August 2015 at 9:16 am #822Caleb Chamberlain
MemberWhat is the logic level of you Arduino Uno? (ie. 3.3V or 5V?)
7 August 2015 at 1:39 pm #824Eugene Katsevman
GuestIt is 5V, I think, for output pins, but 3.3v could be used and recognized for input.
10 August 2015 at 5:10 am #826Eugene Katsevman
GuestHello?
10 August 2015 at 8:16 am #827Caleb Chamberlain
MemberHi Eugene,
The SPI pins on the UM7 are not 5V tolerant, and operating above their absolute maximum rating could damage them (See page 10 of the datasheet, here: http://www.chrobotics.com/docs/UM7_Datasheet.pdf). The pins do have built-in ESD protection, so they may be OK. But it’s possible that the protection circuitry was burnt out, since they aren’t designed to handle sustained overvoltage conditions.
Also, make sure that the timing constraints described in the datasheet aren’t being violated. To wit,
“The maximum SPI clock rate is 10 MHz. However the UM7 needs at least 5 microseconds between bytes to copy the next byte into the SPI transmit register. For high clock rates, this means that a delay must be added between consecutive bytes for correct operation”
15 August 2015 at 8:52 pm #839Manish Mittal
GuestHi Caleb,
I would really appreciate if you could reply to this post:
It’s really necessary for my thesis work. I couldn’t find any other way to contact you. Please reply as soon as you can.
Regards,
Manish Mittal
University of Houston -
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.