AXE171 feedback communication

picaxehama0013

New Member
Hello,
I have received my ordered AXE171 Audio Kit and was very happy to investigate the functions. It works well by sending commands to the MP3 module fom 14M2. But after hours of testing I'm not able to get any feedback information from the MP3-module, described in the manuals. I can measure signals on pin C.3 at 14M2, that seems to be the response of the sent commands. But the 14M2 will not interpret this bytes. I'm more confused, now, because I have found a notice in the command description for "serin":

*****************************
All 8 and 14 pin chips
Due to the internal structure of input3 (C.3) on these chips, a 1N4148 diode is required between the pin and V+ for serin to work on this particular pin ('bar' end of diode to V+) with this circuit. All other pins have an internal diode.
*****************************

I have not found this diode at the AXE171 Audio Kit. The schematic shows a direct line from Tx(SPE035) to the C.3(14M2). But I had no success, too, by implementation of this diode. What am I doing wrong? Is there a sample code available for reading the responses (not just checking busy pin)?

here is my simple code modification, that should work from my understanding for just one byte of response...(modified from Play Sequential.bas)

Send:
SetFreq BAUD_FREQ
Pause 10
SerOut TX, BAUD, ( $7E, $FF, $06, cmd, $00, arg.msb, arg.lsb, $EF )
SerIn RX, BAUD, #b9
Pause 10
SetFreq MDEFAULT
Pause 10
SerTxd( #b9,CR, LF )
arg = 0
Return

Thanks for answering...
 

rossko57

Senior Member
SerIn RX, BAUD, #b9
This probably won't do what you expect; a # in SERIN expects to be sent some ASCII numerical digits, terminating with a non-numeric character (like an alpha or a CR), and will then assemble those into a number value in the target byte. It's not going to work with a one-byte response. Just drop the #
 

picaxehama0013

New Member
This probably won't do what you expect; a # in SERIN expects to be sent some ASCII numerical digits, terminating with a non-numeric character (like an alpha or a CR), and will then assemble those into a number value in the target byte. It's not going to work with a one-byte response. Just drop the #
...tried with or without before - nothing happens. The problem is, that the 14M2 will not receive any data from the MP3 module, at all (except the busy bin). But the MP3 player will send out something. I have connected a LED at the communication line C.3. It blinks and shows that something will be sent out from MP3.
With my modification the program stands still at the "serin" command. I can use the timeout parameter. But then it will succeed the timeout and reads nothing.

I think I have to connect a oscilloscope to check the behaviour.

A sample code, that shows, how this will work (MP3 -> 14M2 serial com. at C.3) will be helpful. Is there anybody who has tried out this?

Thanks!
 

inglewoodpete

Senior Member
I think I have to connect a oscilloscope to check the behaviour.
That's what I'm thinking too. I'm fortunate that I have an oscilloscope I can use.

If you don't have an oscilloscope you could use your computer's sound card for data rates up to 9,600 baud. You can download some free oscilloscope software available from the internet. Note that you would need to use a resistor voltage divider to reduce the 5-volt logic level to around 100mV.
 

hippy

Ex-Staff (retired)
I do not have complete example code for reading the serial responses but the code below is taken from a test program used while developing other code. It is slightly modified from what was used there so untested as such but should work. I have not got an AXE171 + SPE035 to hand to test it.

The response is a multi-byte packet returned immediately after sending and you will probably need to increase operating speed to 16 MHz to run quickly enough to capture all data returned and need to adjust the baud rate to reflect that.

There is no need for any clamping diode on the serial input to C.3 because the signal voltage never exceeds the PICAXE supply. A clamping diode is only required when used with RS232 signals or a current limited voltage greater than PICAXE supply.

Code:
Symbol BAUD_FREQ = M16
Symbol BAUD      = T9600_16
Code:
Send:
  SetFreq BAUD_FREQ
  Pause 10
  SerOut TX, BAUD,                ( $7E,   $FF, $06, cmd, $00, arg.msb, arg.lsb, $EF )
  SetFreq MDEFAULT
  Return

SendAndGetResponse:
  SetFreq BAUD_FREQ
  Pause 10
  SerOut TX, BAUD,                ( $7E,   $FF, $06, cmd, $00, arg.msb, arg.lsb, $EF )
  SerIn [4000,TimedOut],RX, BAUD, ( $7E ), b11, b12, b13, b14, b15,     b16,     b17
  SetFreq MDEFAULT
  SerTxd( "RX: " )
  b0 = $7E : Gosub Dump
  b0 = b11 : Gosub Dump
  b0 = b12 : Gosub Dump 
  b0 = b13 : Gosub Dump
  b0 = b14 : Gosub Dump
  b0 = b15 : Gosub Dump
  b0 = b16 : Gosub Dump
  b0 = b17 : Gosub Dump
  If b17 = $EF Then
    SerTxd( "OKAY",  CR, LF )
  Else
    SerTxd( "ERROR", CR, LF )
  End If
  Return
  
TimedOut:
  SetFreq MDEFAULT
  SerTxd( "RX: Timedout",CR,LF )
  Return

Dump:
  b1 = b0 / 16 + "0" : If b1 > "9" Then : b1 = b1 + 7 : End If
  b0 = b0 & 15 + "0" : If b0 > "9" Then : b0 = b0 + 7 : End If
  SerTxd( b1, b0, " " )
  Return
 

picaxehama0013

New Member
Hi,
thanks to all for the fast answers!
Hippy, now I understood a little bit more about the diode...

I've tested your code but same bahaviour - MP3 will understood the command, sends back the response but 14M2 always timedout...

Here is a small program where I have added your code:
View attachment Serial Axe171 Response.bas

It will start track 01 every 10 seconds.

Here is the Respose with Terminal:
terminal.JPG

Thanks for your help - possibly you'll have another idea why it will not work...
 

picaxehama0013

New Member
...I have removed the timeout functionality at the serin command. While the program is running, I have removed and inserted again the microSD-card with this results:
terminal2.JPG

I wondering because of the last byte: FE

Regarding document "SPE035.pdf" the result should be: "7E FF 06 3B 00 00 02 EF"
But here it is "7E FF 06 3B 00 00 02 FE" !?!

And where are the codes described for 40 00 01 ...

I'm totally confused, now!
 

picaxehama0013

New Member
Problem solved!

Hello,
success!!!

Thanks to Hippy - with his tips I've solved the problem. But there are some things that has to be noticed:

- response telegrams will alwas end with "$FE" not "$EF" as described in the documentation
- The "feedback" command in the send string has to be set to "1". If it is set to "0", the serin command will detect a timeout though the MP3 module will send back a response. To avoid the timeout, it's enough to remove the timeout jump address at the serin command (strange behaviour!! Timing Problem??) But the response in that case is just 7E 00 00 00 00 00 00 00.
- The response for a sent command is a typical "reply"-string : 7E FF 06 41 00 00 00 FE
- The query commands are described in document "spe033.pdf", but there must be available more, I think !?!

I've added my working code here:
View attachment AXE171 - Play Sequential Response.bas
 

hippy

Ex-Staff (retired)
- response telegrams will alwas end with "$FE" not "$EF" as described in the documentation
Pass. There may be a checksum which I am not reading back in the code example earlier. Read two more bytes and it will either hang forever waiting for data which is never sent, or read the checksum bytes and hopefully it will end with $EF as expected.

- The "feedback" command in the send string has to be set to "1".
Not all commands echo back responses so timeouts are expected. To avoid timeouts only call SendAndGetResponse when a response is expected, otherwise call Send.

If you set 'feedback' then every command with 'feedback' set echoes a 'got it' response, but, if you read that, you miss any actual response unless you also grab the second packets of data.

To avoid the timeout, it's enough to remove the timeout jump address at the serin command (strange behaviour!! Timing Problem??) But the response in that case is just 7E 00 00 00 00 00 00 00.
Don't do that; leave the timeout label in. If you take it out the code falls through into the dump routine, prints data which was not actually received. Timeout is a correct response and what you want to see when there is a timeout.
 

max.well

New Member
on ebay one can pay $4 and get a similar mp3 player as the 035. its ' Catalex player manual' had on p.5 the byte code value to get 'feedback' . its 0x01
this was tried with the 171 audio kit sample code 'play-pause-resume'. by editing line 67 , the fifth byte was chg'd from 00 to 01.
then was connected a scope probe onto the 14m2 b.4 pin first then on the next run the c.3 pin.
the data streams to and from wereaxe035 b.4 serout.jpgaxe035 c.3 serin.jpg captured
and -232 decoded for 9600 baud

the 035 module received 8 bytes on its rx pin via line 67 in the bas code and gave 10 bytes back via the 5'th byte 01 value in that same line 67.
no 'serin' command line was used. the feedback bits came out of the 035's tx pin.

these 10 bytes are the 'feedback'. only now that i have it no further info is known for how
to make use of it. or if the assumption here that a feedback code for the ebay 5200 ic is good with the spe035 5300 ic.

so i'm writing this to ask if one of you can shed any light on this matter

note that the 1'st byte of the 8-byte image is shown as FE when 7E was sent. this is a scope/decoding error

also no data for the ebay mp3 player feedback is available at this time. the module was fried when a 12v battery not 5v was applied.
more are on the way. then it too will be queried for whatever feedback it returns
 
Top