Control SD-MP3 recorder with RS232

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 7.

Moderator: Benj

Post Reply
SILVESTROS9
Posts: 115
Joined: Wed Aug 03, 2016 10:45 pm
Has thanked: 24 times
Been thanked: 11 times
Contact:

Control SD-MP3 recorder with RS232

Post by SILVESTROS9 »

Hello to all!
I made a demo code for one command to test a SD-MP3 RECORD MODULE . I use UART(RS232) of a PIC16F887 to send control commands to module. With AD key control the module works fine with default REC input (MIC). I want to change the input mode to 2 channel AUX , so according to command protocol I must send data 7E 04 D3 02 D9 7E in HEX with a string . I send " 7E 04 D3 02 D9 7E" but module not respond . I think that data are sent in ASCII format. How can I send command data according to module command protocol (all the commands need to be sent in hex) ? Also how can I check returned data ( 00 , 01 ) that confirms command execution?
Generally there is a confusion about RX/DX data format and I would like to hear any opinion about that.
Attachments
SE1-RECORDER-DEMO-01.fcfx
A demo code to test SD RECORDER
(8.34 KiB) Downloaded 221 times
Ashampoo_Snap_2017.05.19_23h20m54s_005_AVPageView.png
With this command I select 2 channel AUX input
(71.79 KiB) Downloaded 3492 times
Ashampoo_Snap_2017.05.19_23h19m40s_004_AVPageView.png
Serial protocol with data sending in HEX
(65.22 KiB) Downloaded 3492 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: CONTROL SD-MP3 RECORDER WITH RS232

Post by Benj »

Hello,

Yes you're currently sending in ASCII format, here is a modified version of your program in binary format.
SE1-RECORDER-DEMO-01.fcfx
(12.37 KiB) Downloaded 275 times

SILVESTROS9
Posts: 115
Joined: Wed Aug 03, 2016 10:45 pm
Has thanked: 24 times
Been thanked: 11 times
Contact:

Re: CONTROL SD-MP3 RECORDER WITH RS232

Post by SILVESTROS9 »

Hello Benj and many thanks for help. SD Recorder returns 00 , so it seems that command executed correctly. I'll add some commands to demo code, to make audio test for recorder .

SILVESTROS9
Posts: 115
Joined: Wed Aug 03, 2016 10:45 pm
Has thanked: 24 times
Been thanked: 11 times
Contact:

Re: CONTROL SD-MP3 RECORDER WITH RS232

Post by SILVESTROS9 »

Hello Benj,
OK , I made some modifications to the code , so return data is 01, and command is executed correctly.Now I need to add a special feature to PLAY BACK of the recorder.
I would like to control the PLAY BACK speed of a recording, and especially to control the tempo without affecting the pitch. I would like to record audio signal of an electric or acoustic guitar, and when PLAY BACK to adjust the speed (only the tempo) to test some portions of recording. Searching for an IC that can help me to do that
I found the MSM6322, a real time pitch controller, but that IC controls not only the PLAY BACK tempo , but also the pitch . The result is degrade and distortion of playing guitar signal, that is for me useless. I found the following site that has a time-stretcher that controls (on line) only the tempo of recorded file.
http://onlinetonegenerator.com/time-stretcher.html
My question is : is there a hardware solution with some IC or circuit that can use as digital signal processing, to adjust the play back speed? If not, is it possible to use the DSP component of FLOWCODE7 to solve the above in software level ?

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: CONTROL SD-MP3 RECORDER WITH RS232

Post by Benj »

I take it you need to do this in real time. If not then why not adjust the recordings using a PC and then call the MP3 file at the right tempo.

You are probably going to need a lot of processing power to do this any real justice. Either an expensive dedicated DSP chip like a red pitaya or even better a PC with some dedicated real time software.

https://redpitaya.com/

I don't think a micro is going to be up to the job though I could be wrong.

SILVESTROS9
Posts: 115
Joined: Wed Aug 03, 2016 10:45 pm
Has thanked: 24 times
Been thanked: 11 times
Contact:

Re: CONTROL SD-MP3 RECORDER WITH RS232

Post by SILVESTROS9 »

Many thanks Benj for info. You've right that is difficult to processing recording files without a DSP chip.On the other hand, I have some apps for PC that can do the job like Audacity, but is not possible to connect a PC to my project, cause it must be strictly stand alone(lack of space). Maybe a solution is to look at a possibility to connect a small tablet with a dedicated app . I found some apps for android that have many playback features that covers my requirements .Do you have an idea on how can transfer the file that I've recorded and stored on sd disk , to tablet ?

Post Reply