SOMO 14D Sound module

1968neil

Senior Member
Has anybody any experience of the SOMO 14D from 4D systems ?
I have had a play with the module using the recommended switches etc and it appears to be VERY GOOD !
I need to address it with a PICAXE : ie press switch and it will play the sound stored etc.
It appears to use an SPI bus and i have little or no experience here. RS232 im ok with.
Could anyone give me an example code just to get it to play ?
also it runs from a 2.7 to 3.6 v supply thats not a problem, however do i need to protect the inputs from the picaxe ? It says you need 470R series resistors ? no pull ups or downs is this normal ?
this module could be ideal for speech applications using high quality audio rather than the old allophone methods ! Goodnight speekjet ?
prefered Axe = 08M
Thanks for any help. (keeping it simple !)
Glad this forum is here id be lost !

Regards

Neil
 

goom

Senior Member
Here is my basic code so far for sending data from the PICAXE to the sound module. Bear in mind that it is untested since my SOMO-14D has not yet arrived. It does seem to perform correctly in the simulator.
Code:
setfreq m8
high 0 'make sure clock line is high initially (idles high)
Start:
W0=65527 '=%1111111111110111, set volume to max
gosub Send_Data
W0=500 '=%0000000111110100, play sound file 0500.ad4
gosub Send_Data
end
Send_Data:
  low 0
  pulsout 2,400 'Pause 2ms by pulsing dummy pin (needs >2ms low start clock pulse)
  for b4=1 to 16 'Loop through all 16 bits
 pin1=bit15  'Set data to MSB
 if b4=16 then
   high 0  'Clock high (needs >2ms stop clock pulse, idles high)
   else
   pulsout 0,40 'Clock high for 200us to latch data on pin1
   pulsout 2,40 'Pause 200us by pulsing dummy pin (low clock)
 endif
 W0=W0<<1  'Shift left to get next significant bit
'Note that the above command is only available for X1 and X2 PICAXES.
'For a -08M you could shift left by multiplying by 2, but you would need to deal with the posible overflow of the 16 bit word variable.
  next b4
Return
 

goom

Senior Member
Better? Bit-Banged SPI

Here is some new code for bit-banging which avoids the << (shift left) command, so should work on all PICAXE variants. Two possible routines, both seem to wory OK in the simulator.
Code:
setfreq m8
high 0 'make sure clock line is high initially (idles high)
W0=%1100111000110011 'The 16 bit data to send
gosub Send_Data1  'or gosub Send_Data2
end
 
Send_Data1:
  low 0
  pulsout 2,400 'Pause 2ms by pulsing dummy pin (needs >2ms low start clock pulse)
  for b4=1 to 16 'Loop through all 16 bits
    pin1=bit15  'Set data to MSB
    if b4=16 then
      high 0'Clock high (needs >2ms stop clock pulse, idles high)
   else
     pulsout 0,40 'Clock high for 200us to latch data on pin1
     pulsout 2,40 'Pause 200us by pulsing dummy pin (low clock)
   endif
   if W0>32767 then
   W0=W0-32768 'Prevent overflow of W0
   endif
   W0=W0*2  'Shift left to get next significant bit
  next b4
 
Send_Data2:
  low 0
  pulsout 2,400 'Pause 2ms by pulsing dummy pin (needs >2ms low start clock pulse)
  for b4=1 to 8 'Loop through 8 bits of b1
    pin1=bit15   'Set data to MSB
    pulsout 0,40 'Clock high for 200us to latch data on pin1
    pulsout 2,40 'Pause 200us by pulsing dummy pin (low clock)
    b1=b1*2  'Shift left
  next b4
  for b4=1 to 8 'Loop through 8 bits of b0
    pin1=bit7   'Set data to MSB
    if b4=8 then
     high 0'Clock high (needs >2ms stop clock pulse, idles high)
   else
     pulsout 0,40 'Clock high for 200us to latch data on pin1
     pulsout 2,40 'Pause 200us by pulsing dummy pin (low clock)
   endif 
   b0=b0*2  'Shift left
  next b4
Return
 

1968neil

Senior Member
Wow

Thats outstanding Goom.
Many Thanks for that, ill give it a go at the weekend and get back to you.

Many Thanks again

Neil
 
Top