0

Music Maker FeatherWing - no Bluetooth?
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Music Maker FeatherWing - no Bluetooth?

by twrackers on Thu Jul 01, 2021 5:21 pm

On the tutorial for the Music Maker FeatherWing, why does it say:

Also, if you're using Bluefruit 32u4/M0 or LoRa or RFM69 Feather, make sure to disable the radio with a pinMode(8, INPUT_PULLUP); in setup()


Does this mean I have AGAIN ordered the wrong Feather to support this Wing? I have a Feather M0 Bluefruit LE being overnight-shipped to me specifically for this wing, after getting a Feather M0 Express (CircuitPython) this week, and finding out yesterday that CircuitPython doesn't support this Wing.

Why does the FeatherWing require that the BLE be disabled?

twrackers
 
Posts: 118
Joined: Fri Jan 18, 2013 7:42 pm

Re: Music Maker FeatherWing - no Bluetooth?

by twrackers on Thu Jul 01, 2021 5:24 pm

So which Feathers WILL support the Music Maker FeatherWing without requiring that I disable features on the Feather? Being a Thursday afternoon before the July 4 weekend, it looks like there's no way I can get a Feather I can use before middle of next week.

twrackers
 
Posts: 118
Joined: Fri Jan 18, 2013 7:42 pm

Re: Music Maker FeatherWing - no Bluetooth?

by adafruit_support_mike on Fri Jul 02, 2021 10:19 pm

It's not a compatibility issue so much as a basic fact of using SPI devices.

Only one SPI device can use the MOSI and MISO pins at a given time. The BLE and Packet Radio modules are SPI devices, and on boards where they're built in, their CS pins are connected to GPIO 8. They also have a pull-down resistor so they work by default.

When you want to talk to the VS1053, you have to send GPIO 8 high to disable the radio before you pull the VS1053's CS pin low. That's hardly exotic though.. you also have to send the SD card's CS pin high before you pull the VS1053's CS pin low, and vice versa.

You can still use the BLE or Packet Radio modules if you want, you'll just need to set the radio, SD, and VS1053 CS pins appropriately.

You'll also have to pay attention to the timing though. The microcontroller needs to copy data from the SD card to the VS1053's input buffer often enough to avoid audio skipping while you're playing a track, and if you're using interrupt-driven code for the radio /and/ the VS1053, you'll have to deal with the possibility of timing collisions.

adafruit_support_mike
 
Posts: 63701
Joined: Thu Feb 11, 2010 2:51 pm

Re: Music Maker FeatherWing - no Bluetooth?

by rafikii on Tue Jul 27, 2021 10:15 pm

Does the adafruit VS1053 library automatically handle turning the CS pins for the SD card and VS1053 on and off when a command like musicplayer.playFullFile("/filename.wav") is run? If not, which CS pin should be high and low in that situation since it seems like the VS1053 and SD card would both need to be active

rafikii
 
Posts: 57
Joined: Sat Jan 30, 2021 1:18 pm

Re: Music Maker FeatherWing - no Bluetooth?

by adafruit_support_mike on Sun Aug 01, 2021 2:25 am

The code does handle CS switching for the SD card and the VS1053. There are two options:

The first is to use interrupts. The VS1053 has a pin that toggles when its input buffer has enough room for more data, and that pin is connected to one of the microcontroller’s GPIO pins. When the VS1053 toggles its interrupt pin, the microcontroller suspends whatever code it’s executing at the moment and runs a function that copies ipdata from the SD card to the VS1053. Then it picks up the suspended code and continues where it left off.

That’s convenient, but means your main code has absolutely no idea when the VS1053 will call for more data, or what other code will be running at the time.

The second option is to read the interrupt pin explicitly in your main code, and do the data transfers based on the state of that pin.

That takes slightly more work, but gives you predictable control over the timing.

BLE radios also use interrupts to talk to the microcontroller, and there’s no option to check things manually.

Trying to make two interrupt-driven systems work at the same time is tough. The only real solution is to write a common interrupt manager that listens to both systems and keeps them from tripping each other. Then you have to adapt both systems to work with the common manager. It’s a lot of work and requires a solid understanding of both systems.

Integrating an interrupt-driven system and a manually-controlled system is tricky, but easier. It’s basically a matter of making them take turns: disable interrupts while you’re doing anything time-critical with the manual system, and don’t let the manual system do anything time-critical while interrupts are enabled. That usually involves testing to find the tradeoffs that work best.. if a time consuming operation on the manual side starts to cause problems for the interrupt code, you might have to break it into a sequence of shorter operations.

Ultimately it’s a matter of working with mostly non-negotiable constraints. In most cases, you have to give up some X to get more Y.

adafruit_support_mike
 
Posts: 63701
Joined: Thu Feb 11, 2010 2:51 pm

Re: Music Maker FeatherWing - no Bluetooth?

by Sticks50 on Sun Aug 15, 2021 9:53 pm

I too am trying to do a project using the Feather 32u4 LoRa and Music Maker wing. I watched the "Remote-effects-trigger" video and read the pdf about it. Although the LoRa and Music Maker are referrenced as a project, it is not broken down as a stand alone project like the trigger/transmitters are. Is there a video or pdf strictly related to putting these two together and making them work together?

Sticks50
 
Posts: 5
Joined: Sun Dec 13, 2020 9:27 pm

Please be positive and constructive with your questions and comments.