So please if anyone know simple way to output sound from ATtiny85 even it it needs additional board like MCP4725 (I don't need 12 bit 8bit and 8K sample rate enough fro me )
blh64:
get a DFMini player and play MP3 files directly using the micoSD card.
That's will be good solution but for other project , in fact I had more complex idea which is communicate with sound between two arduino boards (with any RF chip) ,
The first one pickup microphone signal via ADC and send it as data (raw PCM 8bit 8K samples/s ) via RF dx port ,
and the other arduino pickup the signal and convert it back to analog DAC and output it on the speaker .
That's why I need to test DAC and successfully output audio from Arduino .
I hope I clear out my idea .
Alright I manged to fix the issue , I was need to wire negative speaker negative pins to ATtiny85 ground pin and the sound works now .
here is the complete code https://paste.ubuntu.com/p/Xgh6CG5VGF/
and here is the correct wire schematic
That can't be good for pin PB4. IO pins are rated for 40mA Absolute Max, and 20mA recommended. With an 8 ohm speaker, that can be 3.7V/8 ohm = 460mA. That is seriously overstressing the pin, and is just a matter of time until if fails.
Also, 3.7V indicates some kind of Lithium battery, which can be 4.2V when fully charged, making the situation even worse.
I would at a minimum put a resistor in series between PB4 and the speaker +.
200 ohm would be good. The speaker will be quieter tho as this limit the current into the 20mA range.
Thanks for reply I'll keep that on mind , even I was not planning to put the PB4 directly connected to speaker ,but I'll use sort kind of Amplifier that pass the sound to the speaker .
Power consumption is on my mind , I don't have all tools to do test it , but I'm thinking to use ear-buds to reduce power sage .
Next step to me is creating Walkie-Talkie like device with ATtiny85 , via RF chip (I'm thinking about 2.4Ghz one ) , I saw YT video about sending video for long distance (on open areas ) with some modification on Wifi protocol make it send data on one direction (no communication with the other device ) , I think this could reduce power consumption of WiFi chip . anyway that another topic thank yo all guys for assistance .