wagiminator / ATtiny85-TinyDFPlayer

MP3-Player
Other
31 stars 8 forks source link

Cant use DFPlayer #3

Open bixicy opened 3 years ago

bixicy commented 3 years ago

Hi,

I have also the problem here: https://github.com/wagiminator/ATtiny85-TinyDFPlayer/issues/2

Without Attiny I can use DFPlayer. But when I connect to the Attiny its not possible to play mp3 files.

I cheked, ATtiny is running at 8 MHz internal. It's still not working. A tried different DFPlayer library. but I cant the correct one.

Can you help to change from attiny to Arduino pro mini?

I have to change

include

include

looks like the two librarys are not compatible with the pro mini

wagiminator commented 3 years ago

Hi, replace "#include " with "#include ". The OLED library will then automatically use the other I2C library. You have to connect the OLED to the SDA/SCL pins of the pro mini.

BTW, do you have the possibility to check/calibrate the internal oscillator of the ATtiny? Maybe the oscillator is too far off for the serial communication with the DFPlayer to work. It's hard for me to find the root of the problem because all four of my builds work without any issue.

bixicy commented 3 years ago

Hi, thank you

I just tested this, but I'm not quite happy with it yet. The sketch is uploaded without error message, but a few things are not working yet.

Battery indicator, buttons, volume

I have commented out the battery indicator for now, that is the last thing I will do.

Are the buttons with 10k each correct? If I calculate correctly, then 10k 0V come out as a value. Or how is the value of each button calculated.

I have just researched this in google,

volt * 5.0 / 1023.0

If I countermeasure the button with the multimeter, then no more voltage comes from the input voltage of 5.04v.

wagiminator commented 3 years ago

Hi, are you using the Arduino or the ATtiny now? When using the Arduino, of course, you have to make sure that you have implemented the correct pins and the correct ADC port in the code. Don't forget the 10k pullup for the buttons. This forms a voltage divider with the other 10k resistors on the buttons.

VU2ATX commented 2 years ago

Thanks for the wonderful gadget design, I followed your laid-down instructions and got it working. I faced some issues and have some of them still popping up;

  1. The 0.96" OLED in the market have VCC and GND pins swapped so had to remove the 4 pin connector on the OLED module and used wires to connect. My suggestion is; In the next PCB version, it would be better to provide solder jumpers to select accordingly. There is another option to use Schottky bridge chip to power the OLED module, this will avoid any jumpers but one small drawback would be that it would reduce the supply voltage by 0.2V

  2. I am able to compile and upload any of your sketch versions; tinyDFPlayer_v1.0.ino, tinyDFPlayer_v1.1.ino, tinyDFPlayer_v1.2.ino but all of them have similar behavior that the folder count is always displayed 25 whereas on the SD card there are 18 folders (01-18). Similar is the case with file count.

  3. Via "Previous" button when I am trying to switch folder then at one time it displays like Folder: 26 of 25 or even 29 of 25, it looks like an issue, Pls suggest

  4. In case I want to use Arduino pro mini which is cheaper and I have lots of them then what necessary suggested pin / code changes are required.

  5. I tried uploading your compiled "tinyDFPlayer_v1.2.hex" using USBasp, following your instructions; avrdude -c usbasp -p t85 -U lfuse:w:0xe2:m -U hfuse:w:0xd7:m -U efuse:w:0xff:m -U flash:w:tinyDFPlayer_v1.2.hex

But looks like it required your tinyDFPlayer_v1.2.eep file for the EEPROM, pls share the same.

Thanks in advance

wagiminator commented 2 years ago

Hi,

  1. All of my OLEDs have the pinout I used on the board, but if I should ever make a new version of the board, then I'll think about it.
  2. Strange. I have no idea right now. I have several of these boxes in use, but none of them showed any issue.
  3. see 2.
  4. Connect the volume pot to any analog pin, use a dedicated pin for each button, connect the oled to the standard I²C pins and the DFPlayer to any free pins and use the software serial library to leave RX/TX free for uploading code. Of course you have to make some changes in the code.
  5. This is even more strange. You don't need any eep file.
VU2ATX commented 2 years ago

Hi,

  1. All of my OLEDs have the pinout I used on the board, but if I should ever make a new version of the board, then I'll think about it.
  2. Strange. I have no idea right now. I have several of these boxes in use, but none of them showed any issue.
  3. see 2.
  4. Connect the volume pot to any analog pin, use a dedicated pin for each button, connect the oled to the standard I²C pins and the DFPlayer to any free pins and use the software serial library to leave RX/TX free for uploading code. Of course you have to make some changes in the code.
  5. This is even more strange. You don't need any eep file.

Thank you so much for the reply.

> 4. Connect the volume pot to any analog pin, use a dedicated pin for each button, connect the oled to the standard I²C pins and the DFPlayer to any free pins and use the software serial library to leave RX/TX free for uploading code. Of course you have to make some changes in the code. Thank you, will try

> 5. This is even more strange. You don't need any eep file. If possible pls read the EEPROM of your board and share.

wagiminator commented 2 years ago

Since I only flashed a blank attiny myself, you can pull the eep from a blank attiny yourself: avrdude -c usbasp -p t85 -U eeprom:r:tinyDFPlayer_v1.2.eep:i But for me that still doesn't make any sense, you don't need an eep file, the error must be somewhere else.

VU2ATX commented 2 years ago

Since I only flashed a blank attiny myself, you can pull the eep from a blank attiny yourself: avrdude -c usbasp -p t85 -U eeprom:r:tinyDFPlayer_v1.2.eep:i But for me that still doesn't make any sense, you don't need an eep file, the error must be somewhere else.

Thanks for reply, can you please pull eep file from your flashed attiny85, that could resolve my issue.

I have tried what you suggested but no solution from pulling eep from blank attiny85