PSOC designer: DFplayer, an mp3 player. UART and how that works? Psoc designer

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
simonthk
Level 1
Level 1
First question asked Welcome!

Hello smart people

I am trying to make an mp3 player work, called dfplayer FN-M16P. This is the datasheet: http://www.flyrontech.com/uploadfile/download/20184121510393726.pdf

So I am not working with electronics and programming so often sadly. I have a hard time making it work. It seems that I should send information to it via UART, so I does this with a PSOC microprocessor (like arduino).

Apparently I have to send a serial command 7E FF 06 09 00 00 02 FF F0 EF that all refers to hexidecimal.
Can anyone tell me how do I send this through the UART? How would you write it?

I tried with something like this with each number refers to the decimal in the ASCII table:


string[0]=126;
string[1]=255;
string[2]=6;
string[3]=18;
string[4]=0;
string[5]=0;
string[6]=1;
string[7]=254;
string[8]=240;
string[9]=239;
UART_PutString(string);

Thanks in advance on helping me with the advanced project.

Best regards Simon


0 Likes
1 Solution
SampathS_11
Moderator
Moderator
Moderator
250 sign-ins 250 solutions authored 5 questions asked

Hello Simon,

To use the UART in PSoC1, we need to initialize it first. I request you to review CE54939 - UART User Module Example Project, as a first step. This will help you work with the UART.

Secondly, taking the command string you have used in your post as an example, add

string[10] = 0;

Kindly note that UART_PutString() does not take the length of the string as an input parameter. It depends on the null or zero at the end of the string, to determine when to stop transmitting. Many string functions use this method, for e.g., strlen, strcpy and so on. Maybe this is one reason why you may be facing difficulties.

FYI, you can refer PSoC 1 Code Examples.

Lastly, PSoC1 is a very mature family, and hence I request you to consider our newest PSoC4 family. Since PSoC4 has a smaller silicon area, due to improvements in technology, it is much more economical than PSoC1.

Best regards,

Sampath Selvaraj

View solution in original post

0 Likes
1 Reply
SampathS_11
Moderator
Moderator
Moderator
250 sign-ins 250 solutions authored 5 questions asked

Hello Simon,

To use the UART in PSoC1, we need to initialize it first. I request you to review CE54939 - UART User Module Example Project, as a first step. This will help you work with the UART.

Secondly, taking the command string you have used in your post as an example, add

string[10] = 0;

Kindly note that UART_PutString() does not take the length of the string as an input parameter. It depends on the null or zero at the end of the string, to determine when to stop transmitting. Many string functions use this method, for e.g., strlen, strcpy and so on. Maybe this is one reason why you may be facing difficulties.

FYI, you can refer PSoC 1 Code Examples.

Lastly, PSoC1 is a very mature family, and hence I request you to consider our newest PSoC4 family. Since PSoC4 has a smaller silicon area, due to improvements in technology, it is much more economical than PSoC1.

Best regards,

Sampath Selvaraj

0 Likes