In general, you always need to connect grounds if you connect devices to a microprocessor, even if the device is separately powered.
The main exception is if you use something like an opto-coupler, then you don't connect the grounds. An opto-coupler is a device that has a LED and an light sensor bound together, so when one side powers the pin, the other side makes the connection, and there is no direct election connection between the two devices.
I don't use apa102/dotstars that much, but in the realm of ws2812b/neopixels, things have gotten more fuzzy. In the old days, you pretty much had to do voltage translation using a fast enough converter to get ws2812b leds to work. But along the way, a new manufacturer started make leds with the same protocol. These new leds often did not need the voltage translation, particularly if you used a 3.7-4.2 volt lipo battery to power the unit, and feed VIN to the LEDs for power. A 3.3v singal from the Teensy would be able to trigger a ws2812b led running at 3.7-4.2 volts. However, with some leds, sending 3.3v to a led powered with 5v, might not work.
The new ws2812b leds could also run at 3.3v (though it was officially out of spec), providing the total power was less than the Teensy 3.3v voltage regulator.
However, the usage guides have not always mentioned these updates.
So as I make new ws2812b projects, I often just connect things up directly, and test to see if it works. But at times I will do it 'officially' to use the same power source:
- I might use either a Teensy LC or Adafruit ItsyBitsy to skip doing the voltage conversion (they both have one pin that is converted), but that doesn't help apa102 leds, since they only have 1 pin converted;
- I would do appropriate voltage conversion from 3.3v to VIN voltage;
- For ws2812b leds, you need a fast converter such as the 74AHCT125 (https://www.adafruit.com/product/1787). For neopixels, I moved to a surface mount converter, but the part I used only converts 1 pin, and is now hard to get.
- In the past, I would sometimes use a Teensy prop shield, which does provide two voltage converters for pins 11 and 13.
- I would put place a 100 - 500 ohm resistor between the converted voltage and the data pin of the LED;
- I would attach a 500-1000uf 6.3 volt or higher capacitor as close to the ws2812b power/ground connection as possible;
- This is the Adafruit guide, but I do feel it is a little out of date: https://learn.adafruit.com/adafruit-...best-practices
- I even built up a rig to test if I needed doing all of the steps. I would plug in the power, ground, and data signal to the rig. I have various switches to use alternate power sources. I optionally do voltage level conversion. I optionally add the resistor. And I optionally used the capacitor. The funny thing is when I tried out the rig, I couldn't get the leds to fail, even if I didn't do any of the recommended guides. I've had grumpy leds in the past that needed to do all of the conversions, but I suspect over time, with things like solder accidents, I have weeded out those old strands.
Now, whether the apa102 leds also can be powered without needing voltage conversion, I dunno.
While pins 11 and 13 are hardware SPI pins, I know the normal Adafruit dotstar library doesn't use the SPI hardware. Maybe other libraries like FastLED does. In the past with Teensy 3.x processors, I did manage to run both neopixels and hardware SPI displays using the prop shield. I had to manually switch modes from SPI mode for the display to normal pin mode for the neopixels, and then switch back. But that is a lot of hassle, so nowadays, I use different pins for ws2812b leds than the SPI pins.