Need help with speakjet project
I am basically using a bs2, speakjet chip, an lm386 op amp, and an 8 ohm speaker.
This is the circuit I'm using straight from the user's manual:

(ignore the picaxe comment)
This the op-amp circuit I am using:

I am having issues with this circuit. When I flip the on switch of the board of education, the speaker will play the first two serout commands and then just pause after that. I can still hear that the speaker has power so I'm thinking it may be an issue with the BS2. Maybe too much power is being drained by the op-amp? How can I fix this? Your input is greatly appreciated.
Thanks,
Sam
This is the circuit I'm using straight from the user's manual:

(ignore the picaxe comment)
This the op-amp circuit I am using:

I am having issues with this circuit. When I flip the on switch of the board of education, the speaker will play the first two serout commands and then just pause after that. I can still hear that the speaker has power so I'm thinking it may be an issue with the BS2. Maybe too much power is being drained by the op-amp? How can I fix this? Your input is greatly appreciated.
Thanks,
Sam
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
' {$STAMP BS2} ' {$PBASIC 2.5} #SELECT $stamp #CASE BS2, BS2E, BS2PE T2400 CON 396 T4800 CON 188 T9600 CON 84 T19K2 CON 32 #CASE BS2SX, BS2P T2400 CON 1021 T4800 CON 500 T9600 CON 240 T19K2 CON 110 #ENDSELECT Inverted CON $4000 Baud CON T9600 PA0 CON 0 ' pauses PA1 CON 1 PA2 CON 2 PA3 CON 3 PA4 CON 4 PA5 CON 5 PA6 CON 6 Fast CON 7 Slow CON 8 Stress CON 14 Relax CON 15 _Wait CON 16 ' note underscore Soft CON 18 Volume CON 20 Speed CON 21 Pitch CON 22 Bend CON 23 PortCtr CON 24 Port CON 25 Repeat CON 26 CallPhr CON 28 GotoPhr CON 29 Delay CON 30 Reset CON 31 IY CON 128 IH CON 129 EY CON 130 EH CON 131 AY CON 132 AX CON 133 UX CON 134 OH CON 135 AW CON 136 OW CON 137 UH CON 138 UW CON 139 MM CON 140 NE CON 141 NO CON 142 NGE CON 143 NGO CON 144 LE CON 145 LO CON 146 WW CON 147 RR CON 148 IYRR CON 149 EYRR CON 150 AXRR CON 151 AWRR CON 152 OWRR CON 153 EYIY CON 154 OHIY CON 155 OWIY CON 156 OHIH CON 157 IYEH CON 158 EHLL CON 159 IYUW CON 160 AXUW CON 161 IHWW CON 162 AYWW CON 163 OWWW CON 164 JH CON 165 VV CON 166 ZZ CON 167 ZH CON 168 DH CON 169 BE CON 170 BO CON 171 EB CON 172 OB CON 173 DE CON 174 _DO CON 175 ' note underscore ED CON 176 OD CON 177 GE CON 178 GO CON 179 EG CON 180 OG CON 181 CH CON 182 HE CON 183 HO CON 184 WH CON 185 FF CON 186 SE CON 187 SO CON 188 SH CON 189 TH CON 190 TT CON 191 TU CON 192 TS CON 193 KE CON 194 KO CON 195 EK CON 196 OK CON 197 PE CON 198 PO CON 199 RO CON 200 R1 CON 201 R2 CON 202 R3 CON 203 R4 CON 204 R5 CON 205 R6 CON 206 R7 CON 207 R8 CON 208 R9 CON 209 A0 CON 210 A1 CON 211 A2 CON 212 A3 CON 213 A4 CON 214 A5 CON 215 A6 CON 216 A7 CON 217 A8 CON 218 A9 CON 219 _B0 CON 220 ' note underscore _B1 CON 221 _B2 CON 222 _B3 CON 223 _B4 CON 224 _B5 CON 225 _B6 CON 226 _B7 CON 227 _B8 CON 228 _B9 CON 229 C0 CON 230 C1 CON 231 C2 CON 232 C3 CON 233 C4 CON 234 C5 CON 235 C6 CON 236 C7 CON 237 C8 CON 238 C9 CON 239 D0 CON 240 ' DTMF tones D1 CON 241 D2 CON 242 D3 CON 243 D4 CON 244 D5 CON 245 D6 CON 246 D7 CON 247 D8 CON 248 D9 CON 249 D10 CON 250 D11 CON 251 M0 CON 252 ' sonar pin M1 CON 253 ' pistol shot M2 CON 254 ' WOW EOS CON 255 ' end of string ' -----[noparse][[/noparse] Variables ]------------------------------------------------------- eeAddr VAR Word ' address of speech element element VAR Byte ' speech element / code idx VAR Word tx PIN 15 rdy PIN 4 DO 'ONE VOLT SEROUT TX, $0054, [noparse][[/noparse]WW,UX,NO,VV,OW,LO,TT] 'ANOTHER NAIL IN YOUR COFFIN SEROUT tx, $0054, [noparse][[/noparse]21,110,M1,M1,M1,21,110,UX,22,105,NO,21,100,22,110,UX,21,127,22, 100,TH,AXRR,0,21,120,ne,eyiy,LO,0,IH,NO,0,21,125,IYUW,OWRR,0,21,110,KE,AW,FF,IH,NE] 'SAM SEROUT tx, $0054, [noparse][[/noparse]20,127,188, 22, 174,21,25,22,180,132,140] PAUSE 5000 LOOP
It looks like you're just sending a bunch of phonemes to the SpeakJet (open loop) without checking for any feedback from the SpeakJet. It has a 64-byte buffer so you should be ok for the first pass case but it would be a problem if you start sending a lot of text to the chip. You can use the buffer half full signal from the SpeakJet as a way to throttle the amount of data you send to it.
From the original description there really isn't any way to tell for sure what the issue is. To start I would connect an LED to one of the other un-used pins and within your code you can toggle that pin. At least that way you can tell if the Stamp is still processing. You'll need to start testing otherwise it is all purely speculation. If you have a meter I would also measure the current draw of the whole circuit and if it seems high try to pinpoint the issue by removing power to your amp circuit first and then the SpeakJet. Are you powering everything from a 5V supply?
I've used the SpeakJet quite a bit and it is a good chip. You can find out some more about how that chip is used if you pickup the December 2007 issue of SERVO. It has an article on using the SpeakJet to replace an older SC-01 speech chip.
Good luck,
Robert
http://www.techlib.com/electronics/audioamps.html
http://www.rason.org/Projects/icamps/icamps.htm
Try to·download this code to your BS2, the code that I have attached here, is a·Parallax demonstration·code, for SpeakJet Demo Borard's.
You may have to change some of the·Pins·connections at your BS2 to SpeakJets circuit.··
Time to tackle the next pieces of my project: data logging, ir detection, motor control, and LCD.
·At your code, you have declared·the flow control Pin (rdy PIN 4),·but you are not using·it,·at the SEROUT line!
part of your code:
tx·PIN·15
rdy·PIN·4· '<
flow control Pin
SEROUT·TX,·$0054,·[noparse][[/noparse]WW,UX,NO,VV,OW,LO,TT]
In the other codes for -SpeakJet-·(as the one I have attached before) the SEROUT line looks like this:
SEROUT Tx\Rdy, Baud, [noparse][[/noparse]element]
Wouldn't be a problem, with·no·flow control at the SEROUT line?
SEROUT Tx\rdy,
·
Functions explained as Tpin and Fpin
in·SpeakJet case, Tpin=Tx and Fpin= rdy
·
Sam
here's the code if you don't want to download it:
' {$STAMP BS2e} ' {$PBASIC 2.5} #SELECT $stamp #CASE BS2, BS2E, BS2PE T2400 CON 396 T4800 CON 188 T9600 CON 84 T19K2 CON 32 #CASE BS2SX, BS2P T2400 CON 1021 T4800 CON 500 T9600 CON 240 T19K2 CON 110 #ENDSELECT Inverted CON $4000 Baud CON T9600 PA0 CON 0 ' pauses PA1 CON 1 PA2 CON 2 PA3 CON 3 PA4 CON 4 PA5 CON 5 PA6 CON 6 Fast CON 7 Slow CON 8 Stress CON 14 Relax CON 15 _Wait CON 16 ' note underscore Soft CON 18 Volume CON 20 Speed CON 21 Pitch CON 22 Bend CON 23 PortCtr CON 24 Port CON 25 Repeat CON 26 CallPhr CON 28 GotoPhr CON 29 Delay CON 30 Reset CON 31 IY CON 128 IH CON 129 EY CON 130 EH CON 131 AY CON 132 AX CON 133 UX CON 134 OH CON 135 AW CON 136 OW CON 137 UH CON 138 UW CON 139 MM CON 140 NE CON 141 NO CON 142 NGE CON 143 NGO CON 144 LE CON 145 LO CON 146 WW CON 147 RR CON 148 IYRR CON 149 EYRR CON 150 AXRR CON 151 AWRR CON 152 OWRR CON 153 EYIY CON 154 OHIY CON 155 OWIY CON 156 OHIH CON 157 IYEH CON 158 EHLL CON 159 IYUW CON 160 AXUW CON 161 IHWW CON 162 AYWW CON 163 OWWW CON 164 JH CON 165 VV CON 166 ZZ CON 167 ZH CON 168 DH CON 169 BE CON 170 BO CON 171 EB CON 172 OB CON 173 DE CON 174 _DO CON 175 ' note underscore ED CON 176 OD CON 177 GE CON 178 GO CON 179 EG CON 180 OG CON 181 CH CON 182 HE CON 183 HO CON 184 WH CON 185 FF CON 186 SE CON 187 SO CON 188 SH CON 189 TH CON 190 TT CON 191 TU CON 192 TS CON 193 KE CON 194 KO CON 195 EK CON 196 OK CON 197 PE CON 198 PO CON 199 RO CON 200 R1 CON 201 R2 CON 202 R3 CON 203 R4 CON 204 R5 CON 205 R6 CON 206 R7 CON 207 R8 CON 208 R9 CON 209 A0 CON 210 A1 CON 211 A2 CON 212 A3 CON 213 A4 CON 214 A5 CON 215 A6 CON 216 A7 CON 217 A8 CON 218 A9 CON 219 _B0 CON 220 ' note underscore _B1 CON 221 _B2 CON 222 _B3 CON 223 _B4 CON 224 _B5 CON 225 _B6 CON 226 _B7 CON 227 _B8 CON 228 _B9 CON 229 C0 CON 230 C1 CON 231 C2 CON 232 C3 CON 233 C4 CON 234 C5 CON 235 C6 CON 236 C7 CON 237 C8 CON 238 C9 CON 239 D0 CON 240 ' DTMF tones D1 CON 241 D2 CON 242 D3 CON 243 D4 CON 244 D5 CON 245 D6 CON 246 D7 CON 247 D8 CON 248 D9 CON 249 D10 CON 250 D11 CON 251 M0 CON 252 ' sonar pin M1 CON 253 ' pistol shot M2 CON 254 ' WOW EOS CON 255 ' end of string button1 PIN 0 ' button pin button2 PIN 2 lcdTX PIN 3 ' serial output to LCD LcdBaud CON 32 ' LCD baudrate = 19,200 LcdCls CON $0C ' clear LCD (use PAUSE 5 after) LcdBLon CON $11 ' backlight on LcdBLoff CON $12 ' backlight off LcdOff CON $15 ' LCD off LcdOn1 CON $16 ' LCD on; cursor off, blink off LcdCC0 CON $F8 ' define custom char 0 LcdCC1 CON $F9 ' define custom char 1 LcdCC2 CON $FA ' define custom char 2 LcdLine1 CON $80 ' move to line 1, column 0 LcdLine2 CON $94 ' move to line 2, column 0 PhotoCircuit PIN 1 ' -----[noparse][[/noparse] Variables ]------------------------------------------------------- ' -----[noparse][[/noparse] Variables ]------------------------------------------------------- eeAddr VAR Word ' address of speech element element VAR Byte ' speech element / code PhotoVal VAR Word calibrate VAR Word COUNTER VAR Byte TABLEIDX VAR Byte PHRASE VAR Byte dollar VAR Byte cents VAR Byte tx PIN 15 rdy PIN 14 'speakjet phrases SHOT DATA ro,r1,r2,r3,r2,r1,ro, eos COFFIN DATA 21,110,M1,M1,M1,21,110,UX,22,105,NO,21,100,22,110,UX,21,127,22, 100,TH,AXRR,0,21,120,ne,eyiy,LO,0,IH,NO,0,21,125,IYUW,OWRR,0,21,110,KE,AW,FF,IH,NE, EOS ANOTHER DATA SO,MM,OW,EK,UX,NO,UX,TH,AXRR,WW,UX,NO,EOS KILLING DATA IYUW,FAST,OwRr,KE,FAST,IH,FAST,LO,FAST,LE,FAST,IY,NGE,IYUW,FAST,OWRR,SO,EH,LO,FF,SE,SLOW,AY,MM,EOS ASHTRAY DATA IYUW,SO,MM,EH,LO,LE,OHIH,OK,AY,NO,AY,SH,TU,RR,EYIY,EOS SMOKING DATA SE,TU,AW,PO,SE,MM,OW,KE,IY,NGO,TH,AY,TU,KE,RR,AY,PO,EOS DIE DATA 22,50,IYUW,DE,OW,NO,TU,AW,LE,WW,FAST,EYIY,SO,DE,OHIH,FF,RR,UX,MM,TU,UX,SLOW,BE,SLOW,AY,KE,SLOW,OW,OW,OW,OW,OW,OW,EOS BIOTCH DATA 22,75,MM,MM,MM,MM,WW,UX,TU,IYUW,WW,UX,NO,TU,PA5,BE,IY,AW,AW,AW,TU,CH,EOS 'display data with intro message PAUSE 1000 READ 0, counter cents = ((counter) // 4)*25 READ 1, dollar SEROUT Tx, Baud, [noparse][[/noparse]21,120,20,127,22,200,he,eh,eh,le,le,lo,ow,ow,ow,SE,AY,AY,AY,MM,PA2,WW,UH,LO,DE,IYUW,LE,OHIH,KO,EYIY,KE,AY,NO,SE,AXRR,SE,TU,IH,OK,eos ] SEROUT lcdtx,lcdbaud, [noparse][[/noparse]lcdblon,(lcdline1), " Money Spent",(lcdline2)," $",DEC dollar,".",DEC2 cents] HIGH PhotoCircuit ' Set to output PAUSE 3 ' Pause for 3 ms to charge RCTIME PhotoCircuit,1,PhotoVal 'measure rctime calibrate = photoval 'calibrate light setting before starting DO IF button1 = 0 THEN 'if button is pressed, reset data WRITE 0,0 READ 0, counter WRITE 1,0 READ 1, dollar 'display zeros on LCD SEROUT lcdTX, LcdBaud, [noparse][[/noparse]lcdblon,(lcdline1), " Money Spent",(lcdline2)," $","0",".","00"] ENDIF 'DEBUG ? button2 'IF button2 = 0 THEN 'SEROUT lcdTX, LcdBaud, [noparse][[/noparse](lcdline1),"# of Cigarettes",(lcdline2)," ",DEC counter] 'ENDIF GOSUB charge GOSUB detect LOOP charge: ' Measure RC time HIGH PhotoCircuit ' Set to output PAUSE 3 ' Pause for 3 ms to charge RCTIME PhotoCircuit,1,PhotoVal ' measure rctime detect: DEBUG HOME, DEC4 photoval ,CR, DEC4 calibrate,CR, DEC3 COUNTER IF photoval > calibrate + 125 THEN SEROUT lcdtx, lcdbaud, [noparse][[/noparse]lcdcls,lcdblon] 'SEROUT lcdTX, LcdBaud, [noparse][[/noparse](lcdline1),"# of Cigarretes",(lcdline2),DEC counter] cents = ((counter+1) // 4)*25 'create decimal place for cents 'LCD: display money spent on cigarretes SEROUT lcdTX, LcdBaud, [noparse][[/noparse](lcdline1), " Money Spent",(lcdline2)," $",DEC dollar,".",DEC2 cents] 'Set volume and pitch for speakjet SEROUT Tx\RDY,84,[noparse][[/noparse]volume,127,pitch,100] 'lookup phrase LOOKUP TABLEIDX, [noparse][[/noparse]SHOT, COFFIN,ANOTHER,KILLING,ASHTRAY,SMOKING, DIE, BIOTCH ], PHRASE 'set address to phrase eeAddr = PHRASE 'play phrase GOSUB Play_String PAUSE 1000 'math to hold dollars place IF cents = 75 THEN dollar = dollar + 1 ENDIF 'update counter COUNTER = COUNTER + 1 'write values to eeprom for storage WRITE 0 , counter WRITE 1 , dollar ENDIF RETURN Play_String: 'run a loop to play phrase and exit at end of phrase DO READ eeAddr, element ' get phrase element from eeprom eeAddr = eeAddr + 1 ' point to next IF (element = EOS) THEN EXIT ' end? if yes we're done SEROUT Tx, Baud, [noparse][[/noparse]element] ' send element to SpeakJet LOOP 'get ready to play next phrase TABLEIDX = TABLEIDX + 1 'if at end of table go to beginning IF TABLEIDX = 9 THEN TABLEIDX = 0 ENDIF RETURN
Post Edited (kicknitinkc) : 5/7/2010 2:50:06 AM GMT
I think I'll try your progeram codes, first the part you have write for the SpeakJet,
then I may go further and try the rest, who knows, maybe it could stop me to smoke!
Don't you want to put your project at the Completed Projects?
Keep the Good work
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔