DF Mini Module with Picaxe 18M2 Low power board?

jensmith25

Senior Member
Hi,

I need to use the DF Mini audio module (SPE035) with an 18m2 low power board as the low power board has the voltage regulation required and other bits I need.

Anyway, to keep it simple, does anyone know what pins I need to connect the module to to work with the 18M2?

I know it's '+', "gnd" but the other pins are marked as RX, TX and Busy.

On the AXE171 board the 14m2 pins used are:
C.2
C.3
B.4
V+
0v

I'm assuming Busy can be any pin as long as it's defined in the program? Can it also be a C.x input pin?

Can RX and TX also be any input pins? It's unclear to me what pins on the 14m2 are RX and TX because the obvious would be serial in - C.5 and Serial out - B.0 but that's not what the DF mini is using.....
which is confusing.

Any help gratefully received.

Jennifer,
 

Technical

Technical Support
Staff member
See page 9 of http://www.picaxe.com/docs/axe171.pdf

B.4 is output (picaxe to module) C.3 is input (from module to picaxe). You may only need the output.

If using the CHI030 remember you must connect the module to the ecentre row of solder points, not the right hand buffered outputs.
 

hippy

Technical Support
Staff member
Ideally I need to use B.4 for the pwm feature so can I use another output pin?
Yes; you can use any pin you can perform a SEROUT on. Likewise to read the busy signal you can use any pin which can be a digital input.

It is not clear which PWM feature you are describing or that it would be on pin B.4. The 18M2 only caters for PWMOUT on the B.3 and B.6 pins.
 

jensmith25

Senior Member
We've tried this for hours with various combinations and pins used, but whatever happens we get a few seconds of the music and then we get some kind of feedback noise and that's it. The time it takes to do this is random but always within 30 seconds.

Current code is this:
Code:
#Picaxe 18M2

' Play mp3 files on audio pcb Axe171 in continuous loop
' © Small Scale Lights / JS Miniatures 2016 - 2017

Symbol TX = B.5
Symbol RX = C.5
Symbol BUSY_PIN = pinC.6
Symbol BAUD_FREQ = M8
'symbol mdefault = m4
Symbol BAUD = T9600_8
Symbol cmd = b0
Symbol arg = w1 ; b3:b2
Symbol arg.lsb = b2
Symbol arg.msb = b3
Symbol varA = w2

'Static LEDs on 
'High B.2, B.5

High TX ; set TX pin high for idle high serial
Pause 2000
'Disabled - SerTxd("Starting", CR, LF )
'Disabled - SerTxd("Select microSD Card", CR, LF )
cmd = $09 : arg = $0002 : Gosub Send
Pause 4000
'Disabled - SerTxd("Set volume 20", CR, LF )
cmd = $06 : arg = 20 : Gosub Send
Pause 1000

' Play tracks from folder - label 01 not MP3
'cmd = $17 : arg = $0001 : Gosub Send

'Disabled - SerTxd("Play MP3 folder song 0001.mp3", CR, LF ) 
cmd = $12 : arg = 0001 : Gosub Send
Pause 1000

' Repeat forever
'cmd = $08 : arg = $0002 : Gosub Send

'Disabled - Sertxd("Done", CR, LF )
Stop

Send:
 SetFreq BAUD_FREQ
 Pause 10
 SerOut TX, BAUD, ( $7E, $FF, $06, cmd, $00, arg.msb, arg.lsb, $EF )
 'SetFreq MDEFAULT
 Return
 
 end
We're completely out of ideas and my husband is a programmer. It seems to be a hardware issue but we've connected it to the 14m2 Audio project board and it plays perfectly so it's something to do with the 18m2 board. We've tried every pin combination and using just the 3 basic pins but can't get it to work at all.

Turn sound up to hear it: https://youtu.be/wCv19NN3T24
 

hippy

Technical Support
Staff member
You could try reinstating the 'SetFreq MDEFAULT' you have commented out of the 'Send:' routine. Otherwise lack of that will be messing with the PAUSE timing which could be causing things to go wrong.
 

jensmith25

Senior Member
We've tried that but I can certainly put it back in. We've pretty much tried everything. Different MP3 module, different SD card, we've tried the modified code with the 14m2 board and that works but it doesn't work with the 18m2 low power board.

What is causing the noise?

We even tried starting the music then unplugging the RX connection so only power is going to the board but that doesn't work either.

It has to be hardware but not sure what's causing it.

Possibility:

I have set it up with the 12v to 5v regulator but thought that the non-buffered outputs on the CHI030 were 5v?


EDIT:

Looks like might have solved it by connecting to 12v rather than a 4.5v battery box. The MP3 module was getting 3.15v but I guess with the on board resistor perhaps it wasn't enough. No idea.
 
Last edited:

JimPerry

Senior Member
EDIT:

Looks like might have solved it by connecting to 12v rather than a 4.5v battery box. The MP3 module was getting 3.15v but I guess with the on board resistor perhaps it wasn't enough. No idea.
NEVER rely on a battery box for development - if the application need batteries then that is another can-of-worms :confused:
 

jensmith25

Senior Member
No, it is supposed to run off 12v. I've used a battery box before as it's a faff to take my laptop to be near a plug socket, and had no problems but guess in this instant it was a problem.
 

hippy

Technical Support
Staff member
Looks like might have solved it by connecting to 12v rather than a 4.5v battery box. The MP3 module was getting 3.15v but I guess with the on board resistor perhaps it wasn't enough. No idea.
NEVER rely on a battery box for development - if the application need batteries then that is another can-of-worms :confused:
We would normally recommend trying with a battery box if having problems with whatever is being used as a power supply to a PICAXE, but 4.5V into a 5V regulator is going to produce well below 4.5V on the output, and not necessarily reliably or consistently once current flows.

Most regulators require at least 2V overhead to regulate properly so an input over 7V is usually required, hence 9V-12V is often chosen.

One can usually connect a 4.5V battery box to the power rails on the PICAXE side of a regulator without any damage providing the regulator is left unpowered.

The DF Player Mini module is rated for 3.2V-5V operation so would guess you were running on the margins of it working and not.
 

jensmith25

Senior Member
Thanks Hippy, will know for the future.

I measured 3.15 on the output but guess that could have dropped with the player connected.
 
Top