PDA

View Full Version : Quadravox QV356M4 problems



alexe
08-07-2005, 07:49 AM
Hello everybody,

I have a Quadravox QV356M4 sound module and a BS2P40 for a robotic project.
I also have the software from quadravox: QV300S2.

The thing with the software it that you cand load you own sound files from you pc, and you can play them with the qv board. The thing is, it's not working. When I double-click a file nothing happens, the board won't play it. Also, i have a sample code from parallax, wich allows you to play pre-recorded standard words from the board. It won't work either, but if you want to play a sentence then it works. If anyone has any ideas about what's going on, please let me know. I know i'm not too clear, but if you want any info, il give it to you.

Thanks a lot.

Jon Williams
08-07-2005, 07:59 AM
Make sure that your baudmode value is correct for the BS2p.· Our docs tend to use BS2 values and many forget to modify SEROUT and SERIN commands.

I use this section of code in my standard programming template so that I never have to worry about SEROUT and SERIN:

#SELECT $STAMP
· #CASE BS2, BS2E, BS2PE
··· T1200······ CON···· 813
··· T2400······ CON···· 396
··· T4800······ CON···· 188
··· T9600······ CON···· 84
··· T19K2······ CON···· 32
··· TMidi······ CON···· 12
··· T38K4······ CON···· 6
· #CASE BS2SX, BS2P
··· T1200······ CON···· 2063
··· T2400······ CON···· 1021
··· T4800······ CON···· 500
··· T9600······ CON···· 240
··· T19K2······ CON···· 110
··· TMidi······ CON···· 60
··· T38K4······ CON···· 45
· #CASE BS2PX
··· T1200······ CON···· 3313
··· T2400······ CON···· 1646
··· T4800······ CON···· 813
··· T9600······ CON···· 396
··· T19K2······ CON···· 188
··· TMidi······ CON···· 108
··· T38K4······ CON···· 84
#ENDSELECT
SevenBit······· CON···· $2000
Inverted······· CON···· $4000
Open··········· CON···· $8000
Baud··········· CON···· T9600

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax

alexe
08-07-2005, 08:41 AM
Hi and thanks for answering,


Actually I did the correction from the beggining. It doesn't work. I have a sample program from parallax, I'll post it tomorrow, I don't have it on this PC, and I will explain to you what works and what not. The strange thing is that when i firs tried the sofware from Quadravox, it worked. I was clicking on the files on the program and the card was playing the file. At some point it stopped working. I must have changed a parameter and forgot what it was. I tried resetting the card, but it did't gave any result.
Thanks again,
have a nice evening.

alexe
08-07-2005, 07:00 PM
Hi,

Here is the program I was talking about. When you run it, it pops a menu on a debug window and you have three choices: Play a sentence, play sounds from the stamp, play the vocabulary word you select. The first two options work, but when it comes to play a vocab word, it does nothing. You don't hear a sound. As you see the serial parameters are set for the stamp.

·················································· ················ ' ================================================== ============================
' {$PBASIC 2.0}
'
' File...... QV356_SPEECH.BS2
' Purpose... QV356M4 Speech & Sound Demonstration
' Author.... Parallax
' E-mail.... stamptech@parallax.com (mailto:stamptech@parallax.com)
' Started...
' Updated... 01 MAY 2002
'
' {$STAMP BS2p}
'
' ================================================== ============================
' ------------------------------------------------------------------------------
' Program Description
' ------------------------------------------------------------------------------
' This program demonstrates the basic speech and sound capabilities of the
' QV356M4 BOE-Bot Speech Board.
' ------------------------------------------------------------------------------
' Revision History
' ------------------------------------------------------------------------------
' ------------------------------------------------------------------------------
' I/O Definitions
' ------------------------------------------------------------------------------
Term_SIO CON 16 ' DEBUG terminal I/O
QV_SIO CON 11 ' serial I/O for QV356
QV_Busy VAR IN11 ' high when QV356 is busy
Mix_Out CON 10 ' output to QV356 mixer
' ------------------------------------------------------------------------------
' Constants
' ------------------------------------------------------------------------------
QV_Direct CON $F0 ' play mode
QV_MixOn CON $F1 ' enable mix of pin 10 sounds
QV_SetRate CON $F2 ' set sample rate (0..3)
QV_MixOff CON $F3 ' disable mix of pin 10 sounds
QV_Record CON $F4 ' record mode (do not use)
QV_PlayUsr CON $F5 ' play user message
QV_Stop CON $F6 ' stop playback
QV_RecUsr CON $F7 ' record user message
QV_Sleep CON $F8 ' power down
QV_OpenStr CON $F9 ' open string
QV_CloseStr CON $FA ' close string
QV_PlayStr CON $FB ' play string
QV_Volume CON $FC ' set volume (0..7)
QV_Reset CON $FD ' software reset
QV_80k CON $00 ' - 8.0 kHz (best quality)
QV_64k CON $01 ' - 6.4 kHz
QV_53k CON $02 ' - 5.3 kHz
QV_40k CON $03 ' - 4.0 kHz
QV_RecOn CON $01 ' start recording
QV_RecOff CON $00 ' stop recording
N2400 CON 17405 ' 2400-8-N-1, inverted (QV356)
T9600 CON 240 ' 9600-8-N-1 (matches DEBUG)
MoveTo CON 2 ' move cursor to x,y
LF CON 10 ' line feed
ClrRt CON 11 ' clear to right
ClrDown CON 12 ' clear down
Std_Volume CON 5 ' good volume for QV356
' ------------------------------------------------------------------------------
' QV356M4 Standard Vocabulary
' ------------------------------------------------------------------------------
LastPhrase······ CON 219
_calibrating···· CON 96
_primary········ CON 98
_sensors········ CON 99
_all············ CON 95
_systems········ CON 94
_functioning···· CON 92
_properly······· CON 171
_attempting····· CON· 47
_to············· CON· 205
_locate········· CON· 131
_objects········ CON· 151
_object········· CON· 150
_turning········ CON· 209
_track·········· CON· 207
_moving········· CON· 145
_target········· CON· 204
_30············· CON· 21
_9·············· CON· 9
_located········ CON· 132
_will_i_dream··· CON· 217
' ------------------------------------------------------------------------------
' Variables
' ------------------------------------------------------------------------------
response VAR Word ' menu response
qvData VAR Byte ' data for module
idx VAR Byte ' loop counter
eeAddr VAR Word ' ee address of word
freq VAR Word ' tone for sound fx
' ------------------------------------------------------------------------------
' EEPROM Data
' ------------------------------------------------------------------------------
Sent1 DATA _calibrating, _primary, _sensors, $FF
Sent2 DATA _all, _systems, _functioning, _properly, $FF
Sent3 DATA _attempting, _to, _locate, _objects, $FF
Sent4 DATA _turning, _to, _track, _moving, _target, $FF
Sent5 DATA _object, _30, _9, _located, $FF
' ----------------------------------------------------------.--------------------
' Initialization
' ------------------------------------------------------------------------------
Initialize:
PAUSE 250 ' let DEBUG open
DEBUG CLS
DEBUG "Initializing QV356M4", CR
SEROUT QV_SIO, N2400, [QV_Reset] ' reset sound board
PAUSE 100 ' required -- do not change
SEROUT QV_SIO, N2400, [QV_Volume, Std_Volume] ' set initial volume
' ------------------------------------------------------------------------------
' Program Code
' ------------------------------------------------------------------------------
Main:
DEBUG CLS
DEBUG "===========================================", CR
DEBUG " QV356M4 BOE-Bot Speech Board Demonstration ", CR
DEBUG "===========================================", CR
DEBUG CR
DEBUG "[1] Play Selected Vocabulary Word", CR
DEBUG "[2] Sentence Demonstration Using String Buffer", CR
DEBUG "[3] Mixer demo -- Plays Sounds from Stamp", CR
DEBUG CR
DEBUG "--> "
SERIN Term_SIO, T9600, [response]
PAUSE 500
LOOKDOWN response, ["123"], response
BRANCH response, [Vocab, Sentences, Mixer]
GOTO Main
Vocab:
DEBUG CLS
DEBUG "QV356M4 Vocabulary Demonstration", CR, CR
SEROUT QV_SIO, N2400, [QV_Direct] ' reset direct file mode
PAUSE 5
DEBUG "Enter phrase # (999 to Exit) -> "
SERIN Term_SIO, T9600, [DEC response] ' get phrase #
IF (response = 999) THEN Main ' check for quit value
IF (response > LastPhrase) THEN Vocab ' check for in range
qvData = response
GOSUB Say_Word
GOSUB Wait_Until_Not_Busy
GOTO Vocab
Sentences:
DEBUG CLS
DEBUG "QV356M4 Queuing Demonstration", CR
DEBUG "-- sentences are stored in DATA table", CR, CR
FOR idx = 1 TO 5
' get sentence address
LOOKUP (idx - 1), [Sent1, Sent2, Sent3, Sent4, Sent5], eeAddr
DEBUG MoveTo, 0, 3, "Sentence #", DEC idx
GOSUB Say_Sentence
GOSUB Wait_Until_Not_Busy
PAUSE 1000
NEXT
GOTO Main
Mixer:
DEBUG CLS
DEBUG "QV356 Mixer Demonstration", CR
DEBUG "-- sounds are generated by BASIC Stamp", CR, CR
SEROUT QV_SIO, N2400, [QV_MixOn] ' enable Stamp sounds
PAUSE 5
SEROUT QV_SIO, N2400, [QV_Volume, 6] ' crank up volume
PAUSE 5
DEBUG "Dial tone", CR
FREQOUT Mix_Out, 35, 35 ' "click"
PAUSE 100
FREQOUT Mix_Out, 2000, 350, 440 ' combine 350 Hz & 440 Hz
DEBUG "Dialing", CR
DTMFOUT Mix_Out, [1,9,1,6,6,2,4,8,3,3,3] ' "call" Parallax
DEBUG " - ringing", CR
FOR idx = 1 TO 2
FREQOUT Mix_Out, 2000, 440, 480 ' combine 440 Hz and 480 Hz
PAUSE 4000
NEXT
DEBUG "Howler -- watch out!!!",CR
FOR idx = 1 TO 4
FREQOUT Mix_Out, 1000, 1400, 2060 ' combine 1400 Hz and 2060 Hz
FREQOUT Mix_Out, 1000, 2450, 2600 ' combine 2450 Hz and 2600 Hz
NEXT
DEBUG "1950's Sci-Fi Computer", CR
FOR idx = 1 TO 50 ' run about 5 seconds
RANDOM freq ' create random note
freq = freq // 2500 ' don't let note go to high
FREQOUT Mix_Out, 50, freq ' play it
PAUSE 100 ' short pause between notes
NEXT
DEBUG "Spaceship Transporter"
FOR freq = 5 TO 5000 STEP 5 ' frequency sweep up
FREQOUT Mix_Out, 10, freq, freq */ 323 ' simple chord (1st + 3rd)
NEXT
DEBUG " - with QV356 voice", CR
SEROUT QV_SIO, N2400, [QV_Volume, 3] ' lower volume for mix
PAUSE 5
qvData = _will_i_dream ' say word with sound
GOSUB Say_Word
FOR freq = 5000 TO 5 STEP 25 ' frequency sweep down
FREQOUT Mix_Out, 10, freq ' single note
NEXT
INPUT Mix_Out ' float Stamp sound pin
SEROUT QV_SIO, N2400, [QV_MixOff] ' turn mixer off
PAUSE 5
SEROUT QV_SIO, N2400, [QV_Volume, Std_Volume] ' reset volume
PAUSE 5
GOTO Main
END
' ------------------------------------------------------------------------------
' Subroutines
' ------------------------------------------------------------------------------
' ************************************************** **
' Makes serial line an input and checks for Busy state
' -- this line will be low when not busy
' ************************************************** **
Wait_Until_Not_Busy:
INPUT QV_SIO ' make comm an input
IF QV_Busy THEN Wait_Until_Not_Busy ' wait until busy goes low
RETURN
' ************************************
' Say a single word
' -- make sure QV356 is in Direct Mode
' before calling this routine
' ************************************
Say_Word:
GOSUB Wait_Until_Not_Busy
IF (qvData > LastPhrase) THEN Say_Word_Exit ' say only valid words
SEROUT QV_SIO, N2400, [qvData] ' say word
Say_Word_Exit:
RETURN
' **************************************
' Say a sentence
' -- point to sentence in EE with eeAddr
' -- limit is 40 words (no checking)
' **************************************
Say_Sentence:
GOSUB Wait_Until_Not_Busy
SEROUT QV_SIO, N2400, [QV_OpenStr] ' open string buffer
PAUSE 5
Get_Word:
READ eeAddr, qvData ' read word from sentence data
IF (qvData = $FF) THEN Play_Buffer ' sentence done?
IF (qvData > LastPhrase) THEN Get_Word ' no -- is word valid?
SEROUT QV_SIO, N2400, [qvData] ' yes, send word to buffer
PAUSE 5
eeAddr = eeAddr + 1 ' increment word address
GOTO Get_Word ' get next word
Play_Buffer:
SEROUT QV_SIO, N2400, [QV_CloseStr] ' close string buffer
PAUSE 5
SEROUT QV_SIO, N2400, [QV_PlayStr] ' play the buffer
Say_Sentence_Exit:
RETURN