Page 1 of 1

SPI(2) interfering with DAC(2)

Posted: Sun May 27, 2018 12:26 pm
by mathieu
I'm using the following:
  • DAC.write_timed(buffer, 16000, mode=DAC.CIRCULAR) on pin X6 to generate an audio signal.
  • SPI-MOSI on pin Y8 to drive a NeoPixel strip with JanBednarik's ws2812 library
For some reason, my DAC becomes silent shortly after I call WS2812.send_buf(). I've checked that the DAC buffer is unaffected, it's just that the DAC becomes mute. Surprisingly (to me), the problem disappears if I use pin X8 for SPI.

Is there an obvious explanation to this behavior? If not, I'll try to build a minimal working example and post it here.

- Mathieu

Re: SPI(2) interfering with DAC(2)

Posted: Mon May 28, 2018 5:54 am
by pythoncoder
That sounds odd. Could it be related to timers? I'd try specifying a timer to write_timed rather than a frequency (which implies timer 6).

I think specifying a timer is the preferred way to call write_timed (and on ADC's read_timed and read_timed_multi).