Atmega 328 audio out

Post Reply
rodo1
 

Posts: 9
Joined: 13 Jun 2023, 18:16

Atmega 328 audio out

Post by rodo1 »

Gang,
As far as I know, the Atmega 328 uP does not have an onboard DAC. However, the receive audio appears to exit from pin 13 (PB1) and goes directly to the speaker. How does this work?
Tnx!
Bob WB0POQ
DL6ZB
 

Posts: 2
Joined: 20 Jul 2023, 17:16

Re: Atmega 328 audio out

Post by DL6ZB »

rodo1 wrote: 16 Jul 2023, 21:46 Gang,
As far as I know, the Atmega 328 uP does not have an onboard DAC. However, the receive audio appears to exit from pin 13 (PB1) and goes directly to the speaker. How does this work?
Tnx!
Bob WB0POQ
Timer1 is used as fast PWM. The micro's OC1B = PB1 is a PWM output, runs in PWM (pulse wide modulation), mode 14 here which is defined as "Fast PWM".
PWM is a different methode to DAC to generate audio from a micro.
It sounds a little strange. However, it's not that hard to get.

Here's an info in more detail how this works.

https://www.ee-diary.com/2021/07/atmega ... mming.html
IZ2DQA
 

Posts: 2
Joined: 13 Jun 2023, 15:37

Re: Atmega 328 audio out

Post by IZ2DQA »

Do you have an idea about the output impedance of that pin? I would like to experiment different speakers and I don’t know how it will work with 8, 16 or 32 ohm. I know that the stock speaker is 32 ohm.
Thanks
coolepascal
 

Posts: 7
Joined: 12 Jul 2023, 15:48

Re: Atmega 328 audio out

Post by coolepascal »

IZ2DQA wrote: 29 Jul 2023, 21:49 Do you have an idea about the output impedance of that pin? I would like to experiment different speakers and I don’t know how it will work with 8, 16 or 32 ohm. I know that the stock speaker is 32 ohm.
Thanks
Hmmm The Atmega runs at 5V and the max current trough a pin i would at abt 10mA (guessed based on old TTL fanout, facts can be found in the Atmega datasheet).
You certainly can't attach a 8 Ohm speaker to the 328 without damaging it !
Have a look for some portable boombox speaker like Manuel showed in one of his video's
IZ2DQA
 

Posts: 2
Joined: 13 Jun 2023, 15:37

Re: Atmega 328 audio out

Post by IZ2DQA »

Thank you for your reply. In that case if I don’t get wrong it could have 500ish ohm. I ordered a micro amplifier that fits inside the sandwich to see if I can improve the volume because now is very very low.
73 Leo
Post Reply

Users browsing this forum: No registered users and 10 guests