RGB lightsaber

What are you developing?
racemaniac
Posts: 621
Joined: Sat Nov 07, 2015 9:09 am

Re: RGB lightsaber

Post by racemaniac » Sun Apr 23, 2017 4:12 pm

A further update:
- everything seems to be working on the board (sound is ok, microcontroller is ok, motion sensor acknowledges on its i2c address, sd card works on its 4 datalines, and the led works :) )

so i've designed some new boards to test with:
- the same board with the error & some annoyances fixed
- a board with slightly increased functionality (a mosfet to switch of powerhungry (=sd card & DAC) parts of the board & a micro usb port iso just a plain usart port), and smaller formfactor (33 x 18 mm)
- a board about equally large (48x18 mm) as the original one, also containing the above improvements, and additionally a high power part where the pam8403 amplifier is also on the board, +3 mosfets that should be able to switch on/off the ledstring (on the same channel as the mosfet for switching of the other parts).
And sent these of to china yesterday to have produced :).

I'm wondering how those boards will turn out

besides that, i'm now returning to writing code for the current board to get a working lightsaber system on this board. So far i've already adapted the HAL I2S driver to work how i need it (it fetches samples under interrupt), so i've got a working sound layer (supports 8 a 16 bit sound at 8, 16, 24 & 48khz. The DAC is a 16 bit DAC running at 48 Khz). Now starting writing code to read FAT32 under DMA, similar to my streaming system i had on my previous saber that was streaming data from an SPI flash chip. and then i'll port my mpu6050 code to this project, and slowly come to a working saber again :).

zmemw16
Posts: 1486
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: RGB lightsaber

Post by zmemw16 » Sun Apr 23, 2017 7:48 pm

then it'll be time for combat sound testing, one in each hand :?: :lol:
srp

racemaniac
Posts: 621
Joined: Sat Nov 07, 2015 9:09 am

Re: RGB lightsaber

Post by racemaniac » Mon Apr 24, 2017 7:28 am

zmemw16 wrote:then it'll be time for combat sound testing, one in each hand :?: :lol:
srp
maybe best, the holes are still in the wall when i was hitting it to see if the polycarbonate blade was strong enough (it was, the wall wasn't :p)

racemaniac
Posts: 621
Joined: Sat Nov 07, 2015 9:09 am

Re: RGB lightsaber

Post by racemaniac » Fri Apr 28, 2017 8:37 am

racemaniac wrote:so i've designed some new boards to test with:
- the same board with the error & some annoyances fixed
- a board with slightly increased functionality (a mosfet to switch of powerhungry (=sd card & DAC) parts of the board & a micro usb port iso just a plain usart port), and smaller formfactor (33 x 18 mm)
- a board about equally large (48x18 mm) as the original one, also containing the above improvements, and additionally a high power part where the pam8403 amplifier is also on the board, +3 mosfets that should be able to switch on/off the ledstring (on the same channel as the mosfet for switching of the other parts).
And sent these of to china yesterday to have produced :).
Ok, very curious to the results XD. my pcb's got shipped today :). it was a panellized 2 layer pcb of 10x10 cm's with in total 13 sub pcb's (connected via tabs & mousebites). 9 of those are the mentioned above (as complex as i could make them given their design rules) (the other 4 are just some very simple pcb's with room for capacitors. they're for putting between the ledstring & the logic board since the ledstrings generate a LOT of noise on the power supply lines). So if this works out, if you have small pcb's you want to produce in volume, dirtypcb would be awesome. 130 small pcb's for 25$ incl shipping, what a deal XD.

racemaniac
Posts: 621
Joined: Sat Nov 07, 2015 9:09 am

Re: RGB lightsaber

Post by racemaniac » Sat Apr 29, 2017 1:53 pm

continued working on the software: i'm now streaming wav files from the SD card, and playing them via the I2S DAC :). a lot of improvements still to be done to this, but i'm pretty amazed it's actually working already XD.
the streaming from SD is done via DMA in blocks of 2kb, sending to the I2S is via interrupts :).

*small edit*
continued a bit on it (it was still a bit noisy), fixed all the errors in the code, and i've now got very good playback :D.
this thing is working XD.

racemaniac
Posts: 621
Joined: Sat Nov 07, 2015 9:09 am

Re: RGB lightsaber

Post by racemaniac » Sat May 06, 2017 12:59 pm

basic sound code is ok now :)
just ported the mpu code to HAL, and got that now working too :)
the pieces are slowly coming together :D

racemaniac
Posts: 621
Joined: Sat Nov 07, 2015 9:09 am

Re: RGB lightsaber

Post by racemaniac » Sun May 07, 2017 1:29 pm

Wrote the code to address neopixels via SPI DMA, that now also works, and made a simple testprogram that uses everything at the same time (streaming music + reading motion and showing the intensity of the motion on a neopixel ledstring), and that's all working :).
that's a good basic program to start from for developing a nice lightsaber program :).
and that also means everything on the first pcb i made is working XD
wheeee :D

User avatar
RogerClark
Posts: 7474
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: RGB lightsaber

Post by RogerClark » Fri Jun 09, 2017 11:01 pm

Did you post your neopixels DMA code anywhere?

Or know of any neopixels code that works OK?

I've been trying to use a port ( https://github.com/ANDnXOR/Adafruit_NeoPixel-ANDnXOR ) , but it seems to have a lot of problems, with the pixel data generation, where it ends up just turning every LED to 255,255,255 or 0,0,0 rather than the value I requested.

I guess perhaps it could also be a problem with the LED strip, as I bought it from a local supplier on eBay, who probably imported it from China as cheaply as possible.

racemaniac
Posts: 621
Joined: Sat Nov 07, 2015 9:09 am

Re: RGB lightsaber

Post by racemaniac » Sat Jun 10, 2017 5:58 am

RogerClark wrote:Did you post your neopixels DMA code anywhere?

Or know of any neopixels code that works OK?

I've been trying to use a port ( https://github.com/ANDnXOR/Adafruit_NeoPixel-ANDnXOR ) , but it seems to have a lot of problems, with the pixel data generation, where it ends up just turning every LED to 255,255,255 or 0,0,0 rather than the value I requested.

I guess perhaps it could also be a problem with the LED strip, as I bought it from a local supplier on eBay, who probably imported it from China as cheaply as possible.
don't think i have posted it anywhere yet.
i'll have a look at how i can post it later today :). and i also use cheap chinese neopixel strips ^^

User avatar
RogerClark
Posts: 7474
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: RGB lightsaber

Post by RogerClark » Sat Jun 10, 2017 8:24 am

Thanks

I've modified the maple port of the Adafruit lib,and it now works OK.

I have also now tried to use SPI, but I'm having problems with the first pixel :-(

Post Reply