Skip to content

SPI data reading bug #492

Description

@adam-wojewoda

There's a bug on reading SPI bytes. I'm currently writing SPI communication for 6DoF IMU ISM330DHCX to the Adafruit_CircuitPython_LSM6DS on raspberry pi 4B 40 pin. The transfer function returns two entries first one is zero and second is the actual data. I've made some tests with the oscilloscope and my guess is that the first entry is 'measured' while MOSI is writing, the second is the MISO response. Now we are sending the zero as the output. Fixed by transposing the buffer.

buffer_in[i + in_start] = data[i+1]

After that the final buffer consists of 1. registry address 2. registry value

Also on calling I've had to modify the registry address and manually write the first bit high in order to send the reading command. My guess is that the function write_readinto should have it built in.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions