AXE171 remote control

Forgive my naivity, but is it necessary to write one's own BASIC program for the on-board 14M2 in order to be able to select and play a track by number from another PICaxe module?

And if so, which pin should one use for data input?
 
The 14M2 is not supplied with a program to communicate with DFPlayer (SPE035).
This is a sample program provided wayback by Hippy
Code:
#Terminal 4800

;             AXE171       .------------------------------------------.
;           PICAXE-14M2    |                                          |
;          .-----------.   | -.- V+     V+ -.-   SPE035 (DFP-Mini)    |
;         -| B.5   C.0 |-  |  |             |   .-----------------.   |
;      .---| B.4   C.1 |-  |  |             `---| VCC        BUSY |---'
;      |  -| B.3   C.2 |<--'  |  .------------->| RX         USB- |-
;      |  -| B.2   C.3 |<-----|--|--------------| TX         USB+ |-
;      |  -| B.1   C.4 |-     |  |             -| DACR     ADKEY2 |-
;      |  -| B.0   C.5 |      |  |     |\  _   -| DACL     ADKEY1 |-
;   .--|---| 0V  _  V+ |------'  |     | \|+|---| SPK1  ___   IO2 |-
;   |  |   `----' `----'   ___   |  8R |  | |  -| GND  |   |  GND |---.
;   |  `------------------|___|--'     | /|_|---| SPK2 |   |  IO1 |-  |
;   |                                  |/       `------|___|------'   |
;  _|_ 0V                  1K0                                    0V _|_                                                     -^- 0V

Symbol TX        = B.4
Symbol RX        = C.3
Symbol BUSY_PIN  = pinC.2

Symbol BAUD_FREQ = M8
Symbol BAUD      = T9600_8

Symbol cmd       = b0

Symbol arg       = w1 ; b3:b2
Symbol arg.lsb   = b2
Symbol arg.msb   = b3

Symbol counter   = w2
main:
High TX

Pause 2000
SerTxd("Starting", CR, LF )

'SerTxd("Select TF Card", CR, LF )
cmd = $09 : arg = $0002 : Gosub Send
Pause 4000

SerTxd("Set volume 60", CR, LF )
cmd = $06 : arg = 30 : Gosub Send
Pause 1000

For counter = 0 To 6
  'SerTxd("Play MP3 folder song 000", #counter, CR, LF )
  cmd = $12 : arg = counter : Gosub Send
  Pause 1000
  Do While BUSY_PIN = 0
   Pause 100
  Loop
Next

'Sertxd("Done", CR, LF )
pause 1000
goto main

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


Bill
 
This is a program I use for my robot car voice, With serial comms from the main control processor (picaxe40X2)
Code:
#Picaxe 14M2
'#Terminal 4800
'setfreq m8              .-------------- Serial IN
 '                       |
;                        | .------------------------------------------.
;           PICAXE-14M2  | |                                          |
;          .-----------. | | -.- V+     V+ -.-   SPE035 (DFP-Mini)    |
;         -| B.5   C.0 | | |  |             |   .-----------------.   |
;      .---| B.4   C.1 |-' |  |             `---| VCC        BUSY |---'
;      |  -| B.3   C.2 |<--'  |  .------------->| RX         USB- |-
;      |  -| B.2   C.3 |<-----|--|--------------| TX         USB+ |-
;      |  -| B.1   C.4 |-     |  |             -| DACR     ADKEY2 |-
;      |  -| B.0   C.5 |      |  |     |\  _   -| DACL     ADKEY1 |-
;   .--|---| 0V  _  V+ |------'  |     | \|+|---| SPK1  ___   IO2 |-
;   |  |   `----' `----'   ___   |  8R |  | |  -| GND  |   |  GND |---.
;   |  `------------------|___|--'     | /|_|---| SPK2 |   |  IO1 |-  |
;   |                                  |/       `------|___|------'   |
;  _|_ 0V                  1K0                                    0V _|_ 
                                                 
Symbol TX        = B.4
Symbol RX        = C.3
Symbol BUSY_PIN  = pinC.2
Symbol BAUD_FREQ = M8
Symbol BAUD      = T9600_8
symbol BAUDPX    = t9600_8
symbol SerialData = b10
Symbol cmd       = b0
Symbol arg       = w1 ; b3:b2
Symbol arg.lsb   = b2
Symbol arg.msb   = b3
Symbol counter   = w2
setint %00000010,%00000010,c
High TX
Pause 2000
cmd = $09 : arg = $0002 : Gosub Send
Pause 4000
cmd = $06 : arg = 40 : Gosub Send
Pause 1000
main:
do
pause 10
loop
Playvoice:
b11 = 0
  Select case b10
    case 21    'use selector
           cmd = $12 : arg = 1 : Gosub Send
    case 22    'Remote control
           cmd = $12 : arg = 2 : Gosub Send
    case 23    'line follower
           cmd = $12 : arg = 3 : Gosub Send
    case 24    'follow me
           cmd = $12 : arg = 4 : Gosub Send
    case 25    'light follower
           cmd = $12 : arg = 5 : Gosub Send
    case 26    'Light avoidence
           cmd = $12 : arg = 6 : Gosub Send
    case 27    'Wall follower
           cmd = $12 : arg = 7 : Gosub Send
    case 28    'Learn - playback
           cmd = $12 : arg = 8 : Gosub Send
    case 29    'Lost My way
           cmd = $12 : arg = 9 : Gosub Send
    case 30    'fall down step
           cmd = $12 : arg = 10 : Gosub Send
    case 31    'Found you
           cmd = $12 : arg = 11 : Gosub Send
    case 32    'bot model 1
           cmd = $12 : arg = 12 : Gosub Send
    case 33    'Video ON
           cmd = $12 : arg = 13 : Gosub Send
    case 34    'Video OFF
           cmd = $12 : arg = 14 : Gosub Send
    case 35    'Slow Speed
           cmd = $12 : arg = 15 : Gosub Send
    case 36    'high Speed
           cmd = $12 : arg = 16 : Gosub Send
    case 37    'battey Low
           cmd = $12 : arg = 17 : Gosub Send
    case 38    'Sierin
           cmd = $12 : arg = 18 : Gosub Send
    case 39    'noise 1
           cmd = $12 : arg = 19 : Gosub Send
    case 40    'noise 2
           cmd = $12 : arg = 20 : Gosub Send
    case 41    'noise 3
           cmd = $12 : arg = 21 : Gosub Send
    case 42    'noise 4
           cmd = $12 : arg = 22 : Gosub Send
    case 43    'overload
           cmd = $12 : arg = 23 : Gosub Send
    case 44
           cmd = $12 : arg = 24 : Gosub Send
    case 45
           cmd = $12 : arg = 25 : Gosub Send
    case 46
           cmd = $12 : arg = 26 : Gosub Send
    case 47
           cmd = $12 : arg = 27 : Gosub Send
    case 48
           cmd = $12 : arg = 28 : Gosub Send
    case 49    'noise 3
           cmd = $12 : arg = 29 : Gosub Send
    case 50    'noise 4
           cmd = $12 : arg =30 : Gosub Send
    case 51    'overload
           cmd = $12 : arg = 31 : Gosub Send
    case 52
           cmd = $12 : arg = 32 : Gosub Send
    case 53
           cmd = $12 : arg = 33 : Gosub Send
    case 54
           cmd = $12 : arg = 34 : Gosub Send
    case 55
           cmd = $12 : arg = 35 : Gosub Send
    case 56
           cmd = $12 : arg = 36 : Gosub Send
    case 57
           cmd = $12 : arg = 37 : Gosub Send
    case 58
           cmd = $12 : arg = 38 : Gosub Send
    case 59    'noise 3
           cmd = $12 : arg = 39 : Gosub Send
    case 60    'noise 4
           cmd = $12 : arg =40 : Gosub Send
    case 61    'overload
           cmd = $12 : arg = 41 : Gosub Send
    case 62
           cmd = $12 : arg = 42 : Gosub Send
    case 63
           cmd = $12 : arg = 43 : Gosub Send
    case 64
           cmd = $12 : arg = 44 : Gosub Send
    case 65
           cmd = $12 : arg = 45 : Gosub Send
    case 66
           cmd = $12 : arg = 46 : Gosub Send
end Select
    B10 = 0

      Pause 1000
      Do While BUSY_PIN = 0
           Pause 100
      Loop
      pause 1000
    return

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

interrupt:
b10 = 0
pause 100
  serin  C.1, BAUDPX, b10
PAUSE 100
'debug

gosub Playvoice
pause 20
setint %00000010,%00000010,c
return
 

Attachments

  • AXE171.jpg
    AXE171.jpg
    35.4 KB · Views: 2
Last edited:
Back
Top