MDFLY 5016 and PICAXE 20M2

Krafter

Member
Hey all. Thanks in advance for any advice. I'm working on a project here using a 20M2 and a MDFLY AU5016. I have it playing MP3s just fine however I'm struggling with trying to read the status of the commands via serial output (of the MDFLY). There isn't much on this topic although I was expecting that after a command is issued, something would be sent out. What I'm running into is either the 20M2 will get stuck (assuming it's waiting on data) or I can trigger any input a couple of time then it gets stuck. I'd really like to be able to read whats going on from this audio board. Any advice will be helpful.

This code is very raw and the data from the serin command does nothing at this stage. Keep in mind that I don't have any experience with PICAXE serin so it's very possible that I'm doing something wrong.


Code:
#picaxe 20m2

symbol SoundBaud = T9600_8
symbol SoundIn   = B.0
symbol SoundOut  = b.1
symbol BusyLED   = c.7

symbol Sensor1   = pinC.0
symbol Sensor2   = pinC.1
symbol Sensor3   = pinC.2
symbol Sensor4   = pinB.5
symbol Sensor5   = pinB.6
symbol SoundBusy = pinB.7

main:
setfreq m8

start:

if Sensor1 = 1 then
debug
	serout SoundOut,SoundBaud,($F1,$EB)
	do while SoundBusy = 1 or Sensor1 = 1
		serin SoundIn, SoundBaud, b0
		high BusyLED
		pause 500
		low BusyLED
		pause 500
	loop
end if

if Sensor2 = 1 then
	serout SoundOut,SoundBaud,($F2,$EB)
	do while SoundBusy = 1 or Sensor2 = 1
		high BusyLED
		pause 500
		low BusyLED
		pause 500
	loop
end if


if Sensor3 = 1 then
	serout SoundOut,SoundBaud,($F3,$EB)
	do while SoundBusy = 1 or Sensor3 = 1
		high BusyLED
		pause 500
		low BusyLED
		pause 500
	loop
end if
goto main

datasheet

edit: I've also had the serin command above the loop but had similar results.

edit edit: seems as if I'm making progress. I moved the serin command directly under the serout and added two bytes instead of one. I'm now reading data.
 
Last edited:
Top