8000 Initial SPI support not working at MicroPython layer · Issue #16 · adafruit/circuitpython · GitHub
[go: up one dir, main page]

Skip to content
Initial SPI support not working at MicroPython layer #16
Closed
@tdicola

Description

@tdicola

As a quick test I tried out SPI with the MAX31855 thermocouple sensor, but it looks like at least with read calls you only get back 0x00 value bytes.

Example usage:

import machine
spi = machine.SPI(baudrate=5000000, polarity=0, phase=0, MOSI=machine.Pin('MOSI'), MISO=machine.Pin('MISO'), clock=machine.Pin('SCK'))
spi.init()
cs = machine.Pin('D6', machine.Pin.OUT)
cs.high()
# Read a temp reading.
cs.low()
data = spi.read(4)  # Read 4 bytes
cs.high()
print('Received: {0}'.format(data)))

The result from spi.read(4) is a byte string with 4 zero values, however if you look at the trace on the wires with a Saleae we're actually receiving data from the chip (channel 0 is CS, channel 1 is clock, channel 2 is the data out / MISO line with the response data from the chip, it's not all zeros):
screen shot 2016-10-14 at 6 08 04 pm

Likely there's some plumbing to be done to get the MicroPython SPI interface working with what's supported internally for SPI flash. Opening bug as a reminder and example to test with later since SPI is still a work in progress.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0