By naruhodo792170
#8501
i want to use 89s51 to control dfplayer.
But dfplayer have no response.
please tell me where is wrong.
Code: Select all
#include <REG51.H>
char code play[]={0x7E,0xFF,0x06,0x03,0X00,0X01,0XFF,0XE6,0XEF};
int i;
main()
{
   SCON=0x50;     /mode1
   TMOD|=0x20;    /timer set
   PCON&=0x7F;   /smod=0
   TH1=TL1=0xFD;  /baud rate =9600 (use 11.0592MHz xtal.)
   TR1=1;                 /timer start
   for(i=0;i<10;i++)
   {
      SBUF=play[i];
      while(TI==0);
      TI=0;
   }
   
   while(1);
}
By Leff
#8529
Sorry, never tried it on 51 IC. :?

I think as long as the baud rate and the command are right, then it should work, I think you must know it better than me...sorry can not help much.