Mostly newbie here, doing my best to understand this stuff.
I've learned, through experience and research, that controlling servos while playing audio through the DAC of various microcontrollers can be problematic if both systems are trying to use the same timer.
I just got an Adafruit Itsy Bitsy M0 Express around which I want to (re)build a PKE Meter prop. It has to chase some LEDs, drive two servos, and play two sound files. The sound files would be stored on the 2MB SPI flash chip built into the board, played through the DAC into Adafruit's 2.5 W amp.
Should this all work as-is, or am I likely to run into conflicts due to shared timers? If a conflict is likely how can I mitigate the issue? When I had this all running on a Teensy 3.2 (sadly impacted by the chip shortage) I had to change some elements in the Teensy servo library to make the servos use the LPTMR timer, rather than the default PDB timer.
If there's a conflict can the appropriate timers of SAMD21G18 be assigned to specific tasks (by changing code in a library or sketch)?
You're unlikely to run into difficulties due to shared timers on the M0 (SAMD21). The Arduino timing delay(), micros() and millis() functions use the microcontroller's systick (system tick) timer. This leaves the TCC and TC timers free to use as you wish.
The TCC timers: TCC0, TCC1 and TCC2 are 24/24/16-bit respectively and are more fully featured for control applications than the TC timers.
The TC timers: TC3, TC4 and TC5 are general purpose 16-bit timers, however TC4 and TC5 can be chained to create a 32-bit one.
The SAMD21 also has an on-chip RTC (Real Time Clock/Counter) and WDT (Watchdog Timer) as well.
If there is a conflict, it's usually possible to work around any issues.
Thanks for taking the time to reply; I greatly appreciate it. I'd about given up hope anyone would respond.
I guess I'll just work up a sketch that combines a servo test (like the Servo Sweep) and something that plays audio through the DAC and see whether it all works simultaneously by default. If it does my coding friend and I will work to adapt the sketch he worked up for our Teensy 3.2 version of this to the Adafruit Itsy Bitsy.