SPI(2) interfering with DAC(2)

The official pyboard running MicroPython.
This is the reference design and main target board for MicroPython.
You can buy one at the store.
Target audience: Users with a pyboard.
Post Reply
User avatar
mathieu
Posts: 88
Joined: Fri Nov 10, 2017 9:57 pm

SPI(2) interfering with DAC(2)

Post by mathieu » Sun May 27, 2018 12:26 pm

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

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

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

Post by pythoncoder » Mon May 28, 2018 5:54 am

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).
Peter Hinch
Index to my micropython libraries.

Post Reply