Bluefruit LE SPI friend with Feather M4 CAN

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
alanparks
 
Posts: 1
Joined: Wed Mar 09, 2022 7:17 pm

Bluefruit LE SPI friend with Feather M4 CAN

Post by alanparks »

I'm new to this, sorry if I'm missing something obvious.

I'm trying to interface a Bluefruit LE SPI friend with the Feather M4 CAN. Here are my connections:
  • Bluefruit SCK to Feather SCK
  • Bluefruit MISO to Feather MISO
  • Bluefruit MOSI to Feather MOSI
  • Bluefruit CS to Feather 10
  • Bluefruit IRQ to Feather 11
  • Bluefruit RST to Feather 12
The code on the feather is:

Code: Select all

import time
import busio
import board
import digitalio

from adafruit_bus_device.spi_device import SPIDevice

spi = busio.SPI(board.SCK, MOSI=board.MOSI, MISO=board.MISO)
cs = digitalio.DigitalInOut(board.D10)
device = SPIDevice(spi, cs, baudrate=5000000, polarity=0, phase=0)

cnt = 0

while True:
    cnt = cnt + 1
    
    with device:
        result = bytearray(4)
        spi.readinto(result)
    
    print(cnt, "0x"+"".join("{:02x}".format(x) for x in result))
I can connect using the Bluefruit Connect app. When I send a UART message I don't see the results in my codes output. All I see are lines like the following:

Code: Select all

1 0x00000000
2 0x00000000
3 0x00000000
4 0x00000000
5 0x00000000
6 0x00000000
Any help would be very appreciated, thanks!

User avatar
adafruit_support_mike
 
Posts: 67391
Joined: Thu Feb 11, 2010 2:51 pm

Re: Bluefruit LE SPI friend with Feather M4 CAN

Post by adafruit_support_mike »

Post a photo showing your hardware and connections and we'll take a look. 800x600 images usually work best.

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

Return to “Wireless: WiFi and Bluetooth”