![]() |
![]() |
|
|||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Senior Member
Join Date: Mar 2008
Location: Western Australia
Posts: 4,973
|
Thanks for the update Grogster.
I have updated post 1 with your data and that by picIt from another thread in the active forum area.
__________________
: westaust55 Hey Hamlet, 2B OR NOT 2B = $FF |
|
|
|
|
|
#2 |
|
Senior Member
Join Date: Feb 2009
Location: st albans
Posts: 356
|
Thank you for all this information Gentlemen. It has motivated me to buy a Somo!
I have it working on a breadboard in key mode and the results are pleasing. Interestingly enough, the Transcend card does not work but a cheap glee-bay one does. I now want to Picaxe it to produce fun phrases from the robot. I understand the code kindly given, but a couple of questions. Having looked at the assigned pins in the prog, I assume an 08m chip. Am I right? Considering this code snip Code:
For track = 0 to 30 dta = $FFF5 GOSUB Send2SOMO dta = track GOSUB Send2SOMO GOSUB Holdtilldone NEXT track I shall delete the track for / next loop ( and probably the volume instruction ), set a variable EVENT to a decimal number and then substitute dta=EVENT for dta=track above. I cant see any reason to change the Send2SOMO or holdtilldone routines. Am I on the right track ? Thanks, Russ |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Mar 2008
Location: Western Australia
Posts: 4,973
|
I was using an 18X at the time I wrote the program previously posted.
So happens that input 2 (pin2) is on the same side of the chip as outputs 0 to 3. Should work on the 08M or any other "M" series chip. Program space could be the sole determination if the "M" series chips are big enough. Otherwise, yes, what you propose should work.
__________________
: westaust55 Hey Hamlet, 2B OR NOT 2B = $FF |
|
|
|
|
|
#4 |
|
Senior Member
Join Date: Jan 1970
Location: Dunedin, NEW ZEALAND
Posts: 699
|
... and I was using a 14M PICAXE in my experiments.
Code:
'SOMO sound module controller interface
'Version: 2A - [29/11/2009] Original code
' 3A - [28/12/2009] Pre-requisite changed to <SOMO>
'CHIP: 14M PICAXE, Firmware version 9D or higher - won't work on 9B firmware.
' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'----------------
'PIN ASSIGNMENTS:
'----------------
'INPUT0 used for serial command input
'INPUT1,2,3 not used
'INPUT4 used for busy signal from SOMO module
'OUTPUT0 not used
'OUTPUT1 used for SOMO control(clock line)
'OUTPUT2 used for SOMO control(data line)
'OUTPUT3 used for SOMO control(reset line)
'OUTPUT4 used for 'Syntax Error' LED(not always used)
'OUTPUT5 used for piezo sounder(short beep for command acknowledge)
symbol control=b0 'Used for control bits - don't use for anything else
symbol dta=w6 'Data to module is a word(16-bit) value
symbol x=b5 'X marks the spot...
symbol mask=bit0 'Mask word for the shiftout proceedure
symbol MSB=$8000 'Most Significant Bit position is bit 16
symbol sda=2 'Serial data output is on pin2
symbol scl=1 'Serial clock output is on pin1
init:
high scl 'Set clock idle state high
low sda 'Set data idle state low
wait 3
gosub piezo
'dta=$015F
'gosub shiftout
high scl
low sda
start:
serin 0,N1200,("<SOMO>"),b1,b2,b3,b4'Pre-requisite bytes + command bytes
gosub piezo 'Sound piezo buzzer
b13 = b1 * 16 + b2
b12 = b3 * 16 + b4
gosub shiftout
high scl 'Set clock-line idle-high
low sda 'Set data-line idle-low
goto start 'Loop to start if no valid command byte
'================================
'CLOCK DATA TO MODULE SUBROUTINE:
'================================
shiftout:
gosub rst 'Reset module first
low scl 'Pull clock-line low
pause 2 'Start-bit time
for x = 1 to 16 'Start of shiftout code
mask = dta and MSB / MSB
low sda
if mask=0 then skipMSB
high sda
skipMSB:
if x = 16 then skippulse
pulsout scl,20 '100uS minimum pulse-width for clock or data lines
dta = dta * 2
skippulse:
next x 'End of shiftout code
high scl 'Pull clock-line high
pause 2 'End-bit time
return
rst:
low 3 'Reset module
pause 5 'Reset pulse-width as per manual ver 3.0
high 3 '"Release" reset
pause 300 'Reset to first bit wait time as per manual ver 3.0
return
'=======================
'BEEP PIEZO SUB-ROUTINE:
'=======================
piezo:
high 5 'Turn on piezo beeper
pause 150 'Wait some time
low 5 'Turn off piezo beeper
return
I've also attached my schematic for you to look at how I have things wired up. This circuit incorporates several ideas from this thread, and also the muting on the audio-out to stop clicks at the end of playback - the latter provided by 4D systems. I'm not sure if this suits your purposes, but should give you and others something to go on, and what has been proven to work(for me) with the exception of some uSD cards... |
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Mar 2008
Location: Western Australia
Posts: 4,973
|
@ Grogster,
I know that the early 14M's could only serout variables on pin 0 and could only pulsout on outputs 0,1 and 2 but can you clarify what to your knowledge prevents the use of a 14M at Ver B. Have recently been given a few Ver.B 14M's and aware of some of the limitations but though they might still be used.
__________________
: westaust55 Hey Hamlet, 2B OR NOT 2B = $FF |
|
|
|
|
|
#6 | |
|
Senior Member
Join Date: Jan 1970
Location: Dunedin, NEW ZEALAND
Posts: 699
|
Quote:
Technical or one of the other members here in the know, will no doubt be able to give you a better explanation then I on the precise reasons for this... This was the serout issue I was having: http://www.picaxeforum.co.uk/showthread.php?t=13119 Last edited by Grogster : 07-04-2010 at 01:42. |
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|