Trinket M0 SPI minimum baudrate

Adafruit's tiny microcontroller platform. Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
g3cko
 
Posts: 1
Joined: Sun Oct 02, 2016 1:40 pm

Trinket M0 SPI minimum baudrate

Post by g3cko »

Does the M0 have a limited set of supported baudrates for SPI, or am I using this wrong or misunderstanding things?

I am using circuit python (7.x) and it seems like this param has a minimum supported value, but I can't quite understand "why" that is, or if there is a work around.

I am trying to interface with another device that uses a proprietary 3-wire SPI and need a slower rate here (roughly half the speed of this).

Code: Select all

import board
import busio
import digitalio
from adafruit_bus_device.spi_device import SPIDevice

SPI = busio.SPI(board.SCK, MOSI=board.MOSI)

while True:
    device = SPIDevice(SPI, cs, baudrate=2400)
    print('writing...', count)
    count += 1
    with device as spi:
        # 68 65 6C 6C 6F 20 77 6F 72 6C 64
        spi.write(b'hello world')
    time.sleep(2.0)

Code: Select all

# couple prints in spi_device.py
print(':', self.baudrate)
print(':', self.spi.frequency)

# example output 
writing... 0
: 2400
: 93750

Locked
Please be positive and constructive with your questions and comments.

Return to “Trinket ATTiny, Trinket M0”