I might as well continue in this thread, as what i'm making atm is for my next lightsaber
As you may have read in my other threads (http://www.stm32duino.com/viewtopic.php?f=27&t=862
), i've been hard at work at making dma libs for improved IO performance, so i can take my saber a few steps further
After tons of work, my code has finally surpassed the abilities of the first saber i made
. It's too early to build it into a saber, but i've got a proof of concept running that is finally bringing it all together
- I can load soundsamples from an SD card onto a flash chip, with a little 'filesystem' i made so i can easily read those samples from the chip.
- I can send data to the neopixels via the SPI port, which i address via DMA
- I can send 12bit soundsamples to an i2c dac, at a max sampling rate of 60khz (when overclocking the port to 1.2Mhz), but the samplingrate is variable (so the sound can react to motion
) (more info here: http://www.stm32duino.com/viewtopic.php?f=19&t=1048
- I can read an I2C motion sensor via DMA calls, and extract useful data from it (well, i think it'll be useful XD).
My current proof of concept is the first 3 combined and working perfectly
the soundsamples are going out steadily (at about 16khz atm). the sound is coming from the flash memorychip, which is streaming it in blocks of 128 bytes, and at the same time the 144leds neopixel string is updating about 200 times per second
. Both the I2C port for the dac and the SPI port of the neopixel string are sending data pretty much continuously, and when required the next block is requested from the flash chip
-> my first saber couldn't come close to that refreshrate of the neopixels, had to read the sound from its internal flash memory (so very limited in how much sounds i could have), had an 8bit parallel dac so i didn't have overhead of the serial protocols ( i just connected it to one of the ports of the maple and set the samples on this port), and when doing all this was completely swamped since it was doing all the timing manually
, and driving the neopixels via bitbanged code
TODO this weekend (maybe), try and also add the motion sensor so i've got my 4 devices running at the same time and doing what they should be doing
I think it's great how much IO you can get from this little maple mini
. When i started it seemed like a near impossible project, but i'm slowly getting there
(and for those wondering, the SD card is only used for filling the flash memory, streaming from an sd card felt slow & hard to work with).