Sensors, Electronics and Prototyping

UM6-LT SPI Troubles

Welcome to Redshift Labs Forums General Discussion UM6-LT SPI Troubles

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #821
    Eugene Katsevman
    Guest

    Hello 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 0

    clock 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 0

    #822

    What is the logic level of you Arduino Uno? (ie. 3.3V or 5V?)

    #824
    Eugene Katsevman
    Guest

    It is 5V, I think, for output pins, but 3.3v could be used and recognized for input.

    #826
    Eugene Katsevman
    Guest

    Hello?

    #827

    Hi 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”

    #839
    Manish Mittal
    Guest

    Hi Caleb,

    I would really appreciate if you could reply to this post:

    Matlab Communication

    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

Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.