PDA

View Full Version : Playing sound files from 4dSystems SOMO Module



RFEFX
- 10th January 2011, 10:43
Well, 4dsystems has done it again. another great product. talking about the nice and compact SOMO (http://www.4dsystems.com.au/prod.php?id=73) module. this little module is very simple to interface. 1 clock, 1 data, 3.3v, and ground and you got a killer sound effects module.

I just happened to have some busted headphones and ripped out one of the speakers. since all the parts i use is surface mount i had to get a breadboard adapter for my small components. The link above has all the information you need to wire up your somo module and recommend you follow the datasheets guidelines.

On my setup i had to created an adapter board which includes 3.3v regulator, 450 ohm resistors for clock, data, and busy signals interfacing with a 5v systems (very important). and also has a busy signal LED which indicates when the somo is playing a file.

in the project shown in the video below is one of my favorite people. if you dont know first person shooter games his name is FPS Doug. i chose this small clip so you can see the versatility of video and audio combined. however the longer the movie clip the more out of sync the audio will be so i kept this clip short.

Below is the code to run audio files from the somo if you would like detailed information about displaying video check out my article HERE (http://www.picbasic.co.uk/forum/content.php?r=257-Displaying-Videos-and-Images-on-4Dsystems-uOLED-Serially).

Note: that through trial and error only the file address is needed, if you send the command to play after you send the address your file will stop as play and stop share same command. Enjoy ! Boom Headshot !

- Gary D.



define OSC 20

MSB con $8000
'***************************** RF COMMUNICATION ********************

ADCON1=7
CMCON=7
TRISA.0 = 1 ' These lines of code setup my RF Button Link
TRISA.1 = 1
TRISA.2 = 1
TRISA.3 = 1
TRISA.4 = 1

Symbol Center = PORTA.0
symbol UP = PORTA.1
symbol Right = PORTA.2
Symbol Down = PORTA.3
symbol Left = PORTA.4

'************************************************* ***************

pause 1000

serout2 PORTC.0,84,[$55] ' uOLED Initialize

'************************************************* ***************

symbol PinClk = portc.4
Symbol PinData = portc.5
SYMBOL Pwrled = PORTB.2

TheFile var word
x var byte

'************************************************* ***************
high pwrled
Pause 2000

Main:
if center = 1 then play_headshot
goto main

play_Headshot:
if center = 1 then play_Headshot
pause 10
thefile = 0000
gosub SendData
pause 2000
goto main

SendData:
high pinclk
pause 300
low pinclk
pause 2

for x = 0 to 15
low pinclk
if (thefile & MSB) then
high pindata
else
low pindata
endif
thefile = thefile << 1
pauseus 200
high pinclk
pauseus 200
next x
low pindata
high pinclk
return




http://www.youtube.com/watch?v=qbnPuZG-OYE

tekart
- 25th September 2012, 03:53
Gary,
Thanks for posting this. I was struggling with getting commands to work - I was using SHIFTOUT, then I noticed how SLOOOW the SOMO is and found your post. Your bit bash shift out routine saved me some time. I was able to adapt it for sending volume commands as well.

gopalji123
- 16th October 2012, 09:23
Gary,
Thanks for posting this. I was struggling with getting commands to work - I was using SHIFTOUT, then I noticed how SLOOOW the SOMO is and found your post. Your bit bash shift out routine saved me some time. I was able to adapt it for sending volume commands a