Hi,
I’m having some problems making the spi working, I’ve enabled the spi following this
1. Run Jetson IO
$ sudo /opt/nvidia/jetson-io/jetson-io.py
2. Configure SPI1 Configure Jetson 40pin Header => Configure header pins manually => Select "spi1" => Back -> Save pin changes => Save and reboot to reconfigure pins
and I test the spi loopback with the spi_test up to this point is working
$ sudo ./spidev_test -D /dev/spidev0.0 -O -H -v -p “HelloWorld123456789abcdef”spi mode: 0x3bits per word: 8max speed: 500000 Hz (500 KHz)TX | 48 65 6C 6C 6F 57 6F 72 6C 64 31 32 33 34 35 36 37 38 39 61 62 63 64 65 66 __ __ __ __ __ __ __ | HelloWorld123456789abcdefRX | 48 65 6C 6C 6F 57 6F 72 6C 64 31 32 33 34 35 36 37 38 39 61 62 63 64 65 66 __ __ __ __ __ __ __ | HelloWorld123456789abcdef
So I connect the LSM6DSL board to the orin nano e I wrote a python code to read the WHO_AM_I register of the chip and I get always 0xff.
With the help of a logic analyzer I captured the signals
No one is correct… the chip select is toggling and not stay low, the clock is not constant.
the code that I used:
spi = spidev.SpiDev()
spi.open(0, 0)
spi.mode = 3
spi.bits_per_word = 8
spi.threewire = False
spi.max_speed_hz = 500000
whoAmI = read_register(spi, 0x0F)
print("Testing \"Who Am I\" register {}".format( hex(whoAmI) ))
def read_register(spi, register):
response = spi.xfer2([register | 0x80, 0x00])
return response[1]
I’m missing something?
