Unable to use parallel tasks using SPE033

Tvmender

Member
Hi All

Is it possible on a 20M2 to run parallel tasks whilst using an SPE033 MP3 module?

I get an error stating "Error: setfreq not allowed in multi task program"

Edit: Just read that its a no.

Is there a way of doing this to allow parallel tasks?

Any help appreciated!
 
Last edited:

PhilHornby

Senior Member
setfreq isn't allowed in a multi task program (because the firmware has already changed it to 16MHz to cope).

But what is the connection between parallel tasks, setfreq and the SPE033?
 

erco

Senior Member
Default serial comms on the DFplayer mini (same as SPE033 IIRC?) are 9600 baud. Manual says "Baud rate adjustable" but I don't see any details how to at a quick glance. If you can change the MP3 baud rate to 4800 then you can leave the 20M2 at its 4MHz default frequency, which doesn't support 9600 baud AFAIK. FYI the YX5300 MP3 modules I use also require 9600 baud.

If you can't change the MP3 module's baud rate you'll have to run your 20M2 at 8MHz or higher, so you can't multitask. Writing a non-MTing program isn't that hard.
 

Attachments

Last edited:

Rampz

Well-known member
I have often looked at parallel tasks as a solution to a problem and every single times members on here have come back with a more elegant solution that doesn't required parallel tasks, so my question is what else are you trying to do that makes you think you need it, just curious?
 

hippy

Technical Support
Staff member
The most pragmatic solution would be to not do multi-tasking.

One way to resolve the issue may be to use HSEROUT rather than SEROUT but that will depend on what your code needs or wants to do.

Using multi-tasking could be problematic with the MP3 players anyway. The usual trick is to SEROUT and then immediately SERIN. One might have to suspend other tasks while that is happening to avoid a task switch and not being ready with SERIN when the data is returned. If one can 'send blind' that could open the door to using HSEROUT.

Another option might be to add an additional PICAXE M2/X2 chip which can take serial data sent from the multi-tasking M2 and send that at 9600 baud, convert what it gets back for the M2. It might be possible to turn that bridging chip into a smarter peripheral to make things easier all round. You could perhaps have your M2 multi-tasking chip drive an AXE171 MP3 audio kit.
 

Tvmender

Member
Hi All,

Many thanks for your replies. I have decided to use an 08M2 to deal with serial comms on the SPE module for ease. My main PICAXE simply sends a command to play a certain address to it. Works well at the moment.

Thanks again!
 
Top