I’m trying to implement DMX transmission on the Photon. See my older topic: Transmit DMX data with DMA
Since working with DMA, TIMERS and other GPIO stuff, is not really something I’m used to (and it seems to conflict pretty soon with Particle functions) I wanted to use SPI transfer which utilises DMA.
However I need a transferspeed of exactly 2Mhz (I use a byte array to represent the DMX bitstream. Memory is not really an issue). 2Mhz/8bit = 250.000Hz = 250kbps (baudrate of DMX).
However because the SPI1 speed is 30Mhz, I can’t reach that speed with the dividers (30/16 = 1,875Mhz.
Is there a way to modify the SPI1 speed and set it really precise?
Does anyone have other suggestions or ideas? It think bitbanging could be an option, although it think that can’t happen in the background (code examples are welcome though).