BasicAtomPro IDE version 8.0.1.2 BETA

Hi Nathan,

If you relook at the samples I sent you, I think you may not have noticed where the red and blue lines were at the same location. That is why I said, I was not sure what you saw…

I will resend it to you in email, in case you lost it.

Kurt

If the signals turn out to be correct for inverted/non inverted, then I can only guess that something might be wrong with my BAP. One thing is for certain, the BS2 works without any problems. This tells me that there is clearly an issue with the BAP. The question remains: is it a faulty BAP? or is it a firmware issue?

The mystery continues…

Should I assume the BAP is faulty? :question:

Hi Mike, I know that I am not an expert here on the speakerjet, but if it were me, I would try some more experiments.

For example, I am not sure what is expected when you output a value of 262 (106h) to the speakerjet. If it is what I assume, then it is the same as simply outputing a value of 6 hex. What I wonder is if you have somewhere transposed it from the value 226 which is a beep in the speakerjet manual.

I would play around trying to output different values, like from 200 to 255 with a pause and see if anything comes out.

Just a thought

Kurt

Yes, I have tried that very thing and with no luck. For some reason, the BAP is not able to send clear values. It’s pretty straight forward, the BAP is supposed to send “262” to the SJ and the SJ responds with the proper sound.

It’s ok, I plan to use the BS2px anyway. I would have liked to get the BAP to work with the SJ but it doesn’t look promising.

There may be something to this that is worth examining in detail Mike. 262 is a word value. Remember the servo parameter thing we found awhile back, I bet the servo does. The point is the serout command may be interpreting the list differently on the different BA modules. Does the BAP truncate the value to a byte? does it send two bytes and if it does do they go low then high byte or high then low byte?

To be honest, I really don’t know. I’m not sure what actually is going on except that the BAP is suposed to send a three digit constant value to the speakjet, whether its a two byte, high byte, or low byte is beyond me.

I do know that the BAP worked fine at one time once I used N9600 baud rate but it did not have flow control. Since flow control now works, I can’t get the BAP to work like it once did. My code has not changed but now the BAP will not work with the SJ.

It’s almost like it’s sending currupt serial data to the speakjet.

I have looked at this on both the Atom Pro and the BS2. I will try to post an image from my Parallax USB Oscilloscope to show the output from the current pro:http://img236.imageshack.us/img236/7812/bapn9600262ea9.png

If you look at this image, the blue lines is the actual output from the serout command. The red line is simply is a high and low command that brackets the serout command, so I can see where it is if nothing happens. As you probably know the serial output is Start, LSB … MSB, STOP. So this trace shows a Start, 0, 1, 1, 0, 0… Or the value 6. As I found out from AcidTech(Nathan), if the value is truncated to one byte.

Now if you look at the output for the BS2:
http://img152.imageshack.us/img152/7619/bs2n9600262bw4.png

You will note that output is more or less identical. The only real difference is that the red bracketing takes a longer time.

Looking at the speakerjet manual, it looks to me like the 6 command is a pause. So I am not sure much would come out.

At this point it might be worth rechecking out the problem. Do you have a real simple BS2 program that says something or makes a couple of different sounds? If so you might want to post the code here. Then you might want to post the equivelent code for the PRo that does not work. Also you might want to verify that it is wired in properly to the pro. Ie make sure that you have the transmit line hooked up to the right pin and a common ground…

Not sure what else to suggest.

Kurt

Thanks Kurt,

I will give it one more try and make sure every detail is carefully checked, rechecked and checked again.

If it turns out the stamp is able to work and the BAP does not, then I am left to think that the BAP is damaged.

I will write one or two lines of code for each to test, and I will use the actual codes provided in the SJ manual instead of defining them as constants.

I assume our results are based off a known good BAP but I wonder what those results would be if hooked up to my suspected damaged BAP.

I will run the test and post the code used for each MCU, and let you know what my results are.

Um, wait a second, it is supposed to send characters ‘2’, ‘6’, and ‘2’ and not the value “262”? Did I mis-understand that?

I belive it sends the entire value ‘262’ in one shot. Here is the line of code that sends the value ‘262’ to the SJ serial pin:

Serout TX\RDY, N9600, [262] <— no quotes are used

^-----This one line of code should work with the BAP without any problems.

Serout TX\RDY, $0054, [262] <— This should work with the BS2 and it does.

I have not tried to retest the BAP yet, I will do this after work today.

Looking at the online users guide for the speakjet (link on page 2 of this thread), I am not sure what sending 262 is supposed to do. Looking at page 16 where the MSA sounds are defined, they only go up to 254 (which fits in one byte). You mention that it should beep, which is why I thought that you maybe transcribed it wrong ant it was supposed to be 226, which fits in one byte and shows up in their table as a beep. It would be good to see a complete small program, so maybe we can see what else is being sent or not sent to the speakjet.

Kurt

Well here’s my boggle… where does 262 come from? And I mean why are you sending 262? I d/l the .pdf manual you linked for the SJ and searched for 262 and only got 1 hit on page 16 (Table E, MSA sound effects component list) where the value 262 is the duration in mS of the beep phoneme type for code 229 (aka the phoneme named B9.) I was trying to find “262” so I could figure out what the SJ was expecting and therefore what is any modifiers were needed on the serout command. But yet you say sending 262 on the other module works. So now I am really confused… :confused:

see now if only I had not gone back and fixed them spelling typos it wouldhave been my observation first instead of kurte’s. :unamused:

Mmmm, My bad! The code is 229 and not 262, the 262 is the time in milliseconds the beep is to sound.

I will try the proper code in my test tonight but it will likely not be the problem since I have tried the same code that works with the stamp with he exception of changing the baud rate only.

As for more code examples, I think sticking with a simple one line of code is best for troubleshooting because if I can get it to work with the simple line of code, I can get it to work with a more complex program.

EDDIE> the 229 (262 is not correct, my mistake) is the preprogram code in the SJ memory, when the value 229 is sent to the SJ serial pin, it is commanding the SJ to play beep sound #229 on page 16 of this manual magnevation.com/pdfs/speakjetusermanual.pdf Table E list all preprogrammed sounds.

EDIT

To further emphasize, I made a mistake with the 262 error but with many of the other test that produce speech that works with the BS2 was copied and only the baud rate changed to N9600. 262 will not work with either the BS2 or the BAP. I made this error by recalling 262 from memory. :unamused:

yeah but this is possibly different problems. having it work with single byte commands indicates polarity and framing is in place. having the pacing work properly with the handshake is something else to test. If you know the single byte part is working then you could always change the code to put the desired commands in a string and then write a loop in basic to pace the output manually by polling the handshake yourself and sending each byte from the string.

I don’t know how I could do this. I plan to record the results of the audio outputs tonight and post it here as a .wav file and let you guys hear what it is doing.

Something like this perhaps… typos not withstanding I have no idea if this will compile but it should be sort of close and put you on the path.

[code]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 ping
M1 CON 253 ’ pistol shot
M2 CON 254 ’ WOW
EOS CON 255

; nice names for I/O pins
TX CON P2 ; pin we talk to the SJ with
RDY CON P0 ; goes high when “ready”

; define a table of phonemes, the first element in the table is the number of phonemes
TestPhrase ByteTable 22,VV,AXRR,SH,SH,EY,NE,PA5,WW,WW,UX,NE,PO,OWIY,NE,TT,TT,PA5,OWWW,PA2,PA2,PA2,PA2

; get some loop control variables to make things snappy
MyPin var byte
pCount var byte
pIndex var byte

; make a beep
Do
MyPin = RDY ; read the state of the ready pin
If MyPin = 1 Then ; if SJ is ready to accept a byte
SEROUT TX, N9600, [_B9] ; Sound BEEP phoneme
While MyPin <> 1 ; Otherwise loop again

; now set out limit to the number of phonemes plus 1
pCount = TestPhrase(0) + 1

; now step through each phoneme starting at the SECOND entry in the table
For pIndex = 1 to pCount
Do
MyPin = RDY ; read the state of the ready pin
If MyPin = 1 Then ; if SJ is ready to accept a byte
SEROUT TX, N9600, [TestPhrase(pIndex)] ; send the phoneme
While MyPin <> 1 ; otherwise loop again

Pause 20 ; value depends on how long SJ takes to reset ready pin after receiving a character
Next ; increments pIndex and loops until it reaches pCount

; all done.

END
[/code]

Thanks Ed,

I will give this a shot.

Be careful of the comment(s) that wrapped if you do the cut and paste thing. :wink: