Forum >DFRduino Player connect to atmega128
ArduinoGeneral

DFRduino Player connect to atmega128

userHead pandora 2012-04-24 08:20:19 7799 Views19 Replies
Hello,

I have atmega128 and DFRduino Player. Connections and sd card is correct.
I want to play player only with atmega128, not with the terminal, can I ?
I've tried to program it, but to a dead end. Can you help me to program it ?

sorry if my english so bad.

thank you very much.
2012-05-11 00:41:16 This is the ICSP header which is used to re-program the AVR's Firmware. If you do this you will break the player's functionality. You shouldn't need to use this.



userHeadPic Hector
2012-05-11 00:41:16 This is the ICSP header which is used to re-program the AVR's Firmware. If you do this you will break the player's functionality. You shouldn't need to use this.



userHeadPic Hector
2012-05-10 23:01:51 ah sorry, it can upload here userHeadPic pandora
2012-05-10 23:01:51 ah sorry, it can upload here userHeadPic pandora
2012-05-10 22:39:41 [quote="pandora"]
Okay I will try to fix it.
Can I add speaker in every port? I tried adding second speaker, and then make green LED flashing.

Edit : all problem solved, adding speaker, problem with the song stopping half way, just replace a new battery all the work. thank hector and ricky.

This pin is usefull for what? (marked in red)
[img]
[/quote]

Can not see the image! You can upload the image here.
userHeadPic R2D2C3PO
2012-05-10 22:39:41 [quote="pandora"]
Okay I will try to fix it.
Can I add speaker in every port? I tried adding second speaker, and then make green LED flashing.

Edit : all problem solved, adding speaker, problem with the song stopping half way, just replace a new battery all the work. thank hector and ricky.

This pin is usefull for what? (marked in red)
[img]
[/quote]

Can not see the image! You can upload the image here.
userHeadPic R2D2C3PO
2012-05-10 19:43:25 Okay I will try to fix it.
Can I add speaker in every port? I tried adding second speaker, and then make green LED flashing.

Edit : all problem solved, adding speaker, problem with the song stopping half way, just replace a new battery all the work. thank hector and ricky.

This pin is usefull for what? (marked in red)
[img]
userHeadPic pandora
2012-05-10 19:43:25 Okay I will try to fix it.
Can I add speaker in every port? I tried adding second speaker, and then make green LED flashing.

Edit : all problem solved, adding speaker, problem with the song stopping half way, just replace a new battery all the work. thank hector and ricky.

This pin is usefull for what? (marked in red)
[img]
userHeadPic pandora
2012-05-10 18:31:15 Hi,


I have not encountered a problem with the song stopping half way. Are you using batteries? Maybe the batteries are too low, you should change them.


make sure the program is not sending any extra data that might cause the player to stall. Maybe the button is unstable, if another push is detected then the sequence is repeated, but the play command also serves as the pause command. so maybe it is  pausing.
userHeadPic Hector
2012-05-10 18:31:15 Hi,


I have not encountered a problem with the song stopping half way. Are you using batteries? Maybe the batteries are too low, you should change them.


make sure the program is not sending any extra data that might cause the player to stall. Maybe the button is unstable, if another push is detected then the sequence is repeated, but the play command also serves as the pause command. so maybe it is  pausing.
userHeadPic Hector
2012-05-10 06:58:33 Thank for the reply hector, very helpful.

Finally, player can work. I add a push button to play player.
I was wrong earlier in the program. I'm using the usart, transmitter interrupt, and mistake setting baud rate.

this my update code :
[code]
DDRA.1 = 1; //Push Button
DDRB.1 = 1; //LED
PORTB.1 = 1; //LED off

while (1)
      {
        if (PINA.1 == 1)
        {
                PORTB.1 = 0; //LED ON
                printf("\\:s\r\n");
                printf("\\:v 255\r\n");
                printf("\\japan\r\n");
                while (PINA.1 == 1);
        }
      };
}
[/code]

usart connection diagram on the wiki is it true? when I followed the instructions did not work. I switch the connection was working.

And my player is working now, but the song always stop in the middle of playing or error stuck in the middle of playing. Can you help me?
userHeadPic pandora
2012-05-10 06:58:33 Thank for the reply hector, very helpful.

Finally, player can work. I add a push button to play player.
I was wrong earlier in the program. I'm using the usart, transmitter interrupt, and mistake setting baud rate.

this my update code :
[code]
DDRA.1 = 1; //Push Button
DDRB.1 = 1; //LED
PORTB.1 = 1; //LED off

while (1)
      {
        if (PINA.1 == 1)
        {
                PORTB.1 = 0; //LED ON
                printf("\\:s\r\n");
                printf("\\:v 255\r\n");
                printf("\\japan\r\n");
                while (PINA.1 == 1);
        }
      };
}
[/code]

usart connection diagram on the wiki is it true? when I followed the instructions did not work. I switch the connection was working.

And my player is working now, but the song always stop in the middle of playing or error stuck in the middle of playing. Can you help me?
userHeadPic pandora
2012-05-02 21:50:30 Hi Pandora,


You should try to modify the sample code provided on the wiki first.


I would recommend to modify the play command first. When you get that one working, you can modify the rest.

What will you use to trigger a change? A sensor, a button?




This is the command you should be using along with the library.

TwiSend("\\:s\r\n");
Serial.println("OK");
userHeadPic Hector
2012-05-02 21:50:30 Hi Pandora,


You should try to modify the sample code provided on the wiki first.


I would recommend to modify the play command first. When you get that one working, you can modify the rest.

What will you use to trigger a change? A sensor, a button?




This is the command you should be using along with the library.

TwiSend("\\:s\r\n");
Serial.println("OK");
userHeadPic Hector
2012-04-25 19:42:47 thank for the reply ricky.

i've tried several possibilities, but it still not work.
this is my code :

[code]
while (1)
      {
        lcd_clear();
        lcd_gotoxy(3,0);
        lcd_putsf(".::Ready::.");
        lcd_gotoxy(0,1);
        lcd_putsf("DFRduino Player");
        delay_ms(5000);
        lcd_clear();
        lcd_gotoxy(3,0);
        lcd_putsf(".::Play::.");
        printf("\\:s\r\n");
        printf("\\:v 255\r\n");
        printf("\\01");
        test[0] = getchar();
        test[1] = getchar();
        sprintf (lcd_buffer,"%s",test);
        lcd_gotoxy(0,1);
        lcd_puts(lcd_buffer);
        while (1);
       
      };
}
[/code]
userHeadPic pandora
2012-04-25 19:42:47 thank for the reply ricky.

i've tried several possibilities, but it still not work.
this is my code :

[code]
while (1)
      {
        lcd_clear();
        lcd_gotoxy(3,0);
        lcd_putsf(".::Ready::.");
        lcd_gotoxy(0,1);
        lcd_putsf("DFRduino Player");
        delay_ms(5000);
        lcd_clear();
        lcd_gotoxy(3,0);
        lcd_putsf(".::Play::.");
        printf("\\:s\r\n");
        printf("\\:v 255\r\n");
        printf("\\01");
        test[0] = getchar();
        test[1] = getchar();
        sprintf (lcd_buffer,"%s",test);
        lcd_gotoxy(0,1);
        lcd_puts(lcd_buffer);
        while (1);
       
      };
}
[/code]
userHeadPic pandora
2012-04-24 18:07:12 Yes. You can do it as long as the atmega 128 supports either i2c or serial interface.

Once you wire the Atmega128, you can send I2C command or serial command to player. 

The player accepts the same strings you used to send in your terminal. You can refer to our Arduino code, it has the same principle.

[url=https://www.dfrobot.com/wiki/index.php?title=DFRduino_Player_(SKU:DFR0112)]https://www.dfrobot.com/wiki/index.php?title=DFRduino_Player_(SKU:DFR0112)[/url]
userHeadPic R2D2C3PO
2012-04-24 18:07:12 Yes. You can do it as long as the atmega 128 supports either i2c or serial interface.

Once you wire the Atmega128, you can send I2C command or serial command to player. 

The player accepts the same strings you used to send in your terminal. You can refer to our Arduino code, it has the same principle.

[url=https://www.dfrobot.com/wiki/index.php?title=DFRduino_Player_(SKU:DFR0112)]https://www.dfrobot.com/wiki/index.php?title=DFRduino_Player_(SKU:DFR0112)[/url]
userHeadPic R2D2C3PO
2012-04-24 08:20:19 Hello,

I have atmega128 and DFRduino Player. Connections and sd card is correct.
I want to play player only with atmega128, not with the terminal, can I ?
I've tried to program it, but to a dead end. Can you help me to program it ?

sorry if my english so bad.

thank you very much.
userHeadPic pandora