SOMO-14D Embedded Audio-Sound Module
I decided to look into the SOMO-14D as an alternative to the ISD2560 sound recorder chip, which I have used successfully in the past for a sailboat race countdown start timer. It may also prove to be a useful unit for model sound effects, commanded by a spare RC receiver channel.
I am new to 2-wire serial communications, and am having some difficulty understanding it.
From the datasheet, it appears to require a rather slow data transmission - a 2.5kHz clock frequency. It also reqires a minimum 2ms start and stop bit pulse width. I therefore conclude that using SPIOUT (or HSPIOUT) would be much too fast for the SOMO-14D. Is that correct?
How fast is SPIOUT? I could not find any mention in the manuals. Perhaps underclocking could make it slow enough?
I decided to try my hand at some bit-banged SPI code:
Code:
'Countdown timer using PICAXE-28X1 and SOMO-14D Embedded Audio-Sound Module
setfreq m8
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 start bit)
for b4=1 to 16 'Loop through all 16 bits
W0=W1&%1000000000000000 'Mask MSB
pin1=bit15 'Set data to MSB
if b4=16 then
high 0 'Clock high (needs >2ms stop bit)
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
next b4
Return
I would appreciate it if someone could do a sanity check to see if I am on the right track. I can't try anything yet since I ordered the unit only today.