DF Player mini Code

Status
Not open for further replies.

Suraj143

Active Member
Has anyone tried DF player mini (Actually my module is (MP3-TF-16P) to play some sound tracks.I tried with a PIC micro but its not working.I searched examples on the internet & they all have arduino examples

When a button presses the 1st sound track play & after 5 seconds it will pause. Here is what I did, but its not working.

Code:
Set_TF_Card        movlw        7Eh
            call        TX_RS232
            movlw        0FFh
            call        TX_RS232
            movlw        06h
            call        TX_RS232
            movlw        09h
            call        TX_RS232
            movlw        00h
            call        TX_RS232
            movlw        00h
            call        TX_RS232
            movlw        02h
            call        TX_RS232
            movlw        0FFh
            call        TX_RS232
            movlw        0F0h
            call        TX_RS232
            movlw        0EFh
            call        TX_RS232
            ;
            call        Del_1S
;-------------------------------------------------------------------------
;7E FF 06 03 00 00 01 FE F7 EF
;-------------------------------------------------------------------------
Wait_Press        btfsc        PORTB,4        ;when button pressed play the 1st track
            goto        Wait_Press
            bsf        PORTA,1
Play_Track        movlw        7Eh
            call        TX_RS232
            movlw        0FFh
            call        TX_RS232
            movlw        06h
            call        TX_RS232
            movlw        03h
            call        TX_RS232
            movlw        00h
            call        TX_RS232
            movlw        00h
            call        TX_RS232
            movlw        01h
            call        TX_RS232
            movlw        0FEh
            call        TX_RS232
            movlw        0F7h
            call        TX_RS232
            movlw        0EFh
            call        TX_RS232
            ;
            movlw        .50
            movwf        ISR_Count
            movlw        .5            ; count 5 seconds
            movwf        Seconds
Count_Play        call        Del_X20mS
            decfsz    ISR_Count,F
            goto        $-2
            movlw        .50
            movwf        ISR_Count
            decfsz    Seconds,F
            goto        Count_Play
            ;
Stop_Track        movlw        7Eh            ; after 5 seconds pause track
            call        TX_RS232
            movlw        0FFh
            call        TX_RS232
            movlw        06h
            call        TX_RS232
            movlw        0Eh
            call        TX_RS232
            movlw        00h
            call        TX_RS232
            movlw        00h
            call        TX_RS232
            movlw        00h
            call        TX_RS232
            movlw        0FEh
            call        TX_RS232
            movlw        067h
            call        TX_RS232
            movlw        0EFh
            call        TX_RS232          
            ;
            btfss        PORTB,4
            goto        $-1
            bcf        PORTA,1
            goto        Wait_Press
 
I have played with one and gotten it to work. Here are the commands I used.
Reset module (0x7E,0xFF,0x06,0x0C,0x01,0x00,0x00,0xFE,0xEE,0xEF).
Specify Volume (0x7E,0xFF,0x06,0x06,0x01,0x00,0x1E,0xFE,0xD6,0xEF).
Specify Track (0x7E,0xFF,0x06,0x03,0x01,0x00,0x01,0xFE,0xF6,0xEF) First folder, first track.
Next Track (0x7E,0xFF,0x06,0x01,0x01,0x00,0x00,0xFE,0xF9,0xEF)
That should get you up and running. One thing to note, if you don't get the checksum right, it will ignore the command. Hope this helps.
 

Hi,

Great information. It works superbly.

Thanks for the info.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…