Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 23:51 28 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : PicoMite: driving a small speaker

     Page 12 of 14    
Author Message
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4251
Posted: 10:05am 09 May 2023
Copy link to clipboard 
Print this post

Pulling the SD line low wil put the amplifier in shutdown mode.
Remember this is class-D, so it will be running PWM through the speaker when no audio is heard also.
SD low saves energy, it switches off the PAM PWM..

Looking at the Bintendo Lameboy, you have the real power switch, disconnecting the battery.
So you don't need to connect the SD pin. Just leave the PAM running. There is a lot of energy going to the pico, the backlight, etc... the few mA from the PAM will not make a major difference.

Volhout
Edited 2023-05-09 20:06 by Volhout
PicomiteVGA PETSCII ROBOTS
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4046
Posted: 10:14am 09 May 2023
Copy link to clipboard 
Print this post

  Volhout said  Pulling the SD line low wil put the amplifier in shutdown mode ...


Thanks, I understand (enough) of that, it was @mozzie's circuit attached to that pin that I didn't understand.

He is adding an external 10K pull-DOWN to a connection that already has an internal (on the module) 10K pull-UP. Is that to leave the connection "floating" and thus force the Pico GPIO to "make a decision" ? i.e. if you didn't connect the GPIO it would be anybody's guess if it was high or low ...

... as it happens I connected the pull-DOWN but did not connect to the GPIO when testing the circuit and the amp was not shutdown.

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1611
Posted: 10:26am 09 May 2023
Copy link to clipboard 
Print this post

Hi Tom, I suggested the single pot AFTER the filter but BEFORE the 68k input resistors. 50k if you replaced the filter with 10k and 3.3nF or if you leave them as is then 20k would be OK.

If you do replace the filter with 10k and 3.3nF then I would reduce the 68k resistors to 56k.

Yes, the bar SD means active low and if it has an internal pullup resistor then it needs no connection. I don't know what the 10k resistor R2 is meant to do. It seems to be redundant.

Bill
Keep safe. Live long and prosper.
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1611
Posted: 10:36am 09 May 2023
Copy link to clipboard 
Print this post

Looking at the circuit again, it looks like Mozzie intends the SD connection to a GPIO pin is intended to shut down the amplifier if you don't want sound. That may help to save power in that case. I still don't think R2 is needed or even desirable.

Bill
Keep safe. Live long and prosper.
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4046
Posted: 10:52am 09 May 2023
Copy link to clipboard 
Print this post

  Turbo46 said  Hi Tom, I suggested the single pot AFTER the filter but BEFORE the 68k input resistors.


Hi Bill,

Yes, you did, is that significant ? The 10K "volume control" on the module itself (which this is "replacing") is of course by definition after the 68K.

  Turbo46 said  50k if you replaced the filter with 10k and 3.3nF or if you leave them as is then 20k would be OK.


I kept the values as per mozzie's schematic, the 33nF fit even if it is a bit of a squash and a squeeze and the 100uF trash can is at a jaunty angle. 50K is just what I had in volume control style pots - actually a 5 pin stereo one, but only using 2 of its pins.

  Turbo46 said  If you do replace the filter with 10k and 3.3nF then I would reduce the 68k resistors to 56k.


Ack.

  Turbo46 said  Yes, the bar SD means active low and if it has an internal pullup resistor then it needs no connection. I don't know what the 10k resistor R2 is meant to do. It seems to be redundant.


I'm glad that it's not just me that is perplexed.

All on hiatus at the moment whilst I wait for some 1uF SMD capacitors to replace one that I seem to have mechanically damaged on the module.

Best wishes,

Tom
Edited 2023-05-09 21:26 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1611
Posted: 11:30am 09 May 2023
Copy link to clipboard 
Print this post

There are a couple of resistors on that module marked '101' - 100 ohms. I don't know if they are before the volume control or not.

Anyway if the 50k is connected after the 68k resistors it will have a more significant effect on the volume when set at 50k because of of the voltage divider effect. I'm not sure whether, in this situation, because the signals are 180 degrees out of phase with each other the 50k should be considered as 25k in each leg. I suspect so because the centre of the pot will be effectively zero. That would drop the input signal level by more than 50 percent.

I have done no maths on this.

Connecting a 20k pot across the two 1k (AKA 1k3) resistors will have little effect at 20k for the same reason.

Either/or will work it just depends on how much headroom you have on the volume.

Bill
Keep safe. Live long and prosper.
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4046
Posted: 11:49am 09 May 2023
Copy link to clipboard 
Print this post

<scratches head and looks puzzled>

> There are a couple of resistors on that module marked '101' - 100 ohms. I don't know if they are before the volume control or not.

I believe the schematic I linked above is accurate, the 100R resistors are after the onboard volume control.

I don't understand the rest of your explanation .

I have wired the 50K pot as a variable resistor - one input is connected to one of the legs and the other input to the wiper, the third leg is "left hanging" (and because I'm using a stereo part the fourth and fifth legs are hanging too). At one extent the resistance between the two inputs is 0K and the out-of-phase signals cancel each other out leading to zero volume and at the other end the resistance is 50K between the two inputs and you get an acceptable volume.

With the internal potentiometer set to 0R have I not just "replaced" it with the 50K external pot ? - which may be bigger than necessary ... but who cares ;-)

Best wishes,

Tom
Edited 2023-05-09 22:12 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1611
Posted: 12:20pm 09 May 2023
Copy link to clipboard 
Print this post

Sorry I did not see the schematic. It does make my explanation rubbish because the 50k pot is in parallel with the internal 10k pot. So it should have minimal effect on the volume when set to maximum.

Also the SD connection does not need any external connection unless you want to disable the amplifier when sound is not wanted.

Bill
Keep safe. Live long and prosper.
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4046
Posted: 12:38pm 09 May 2023
Copy link to clipboard 
Print this post

No worries Bill,

I was mistaken in one thing though, I am setting the internal potentiometer to 10K, not 0K. Thus unless I'm mistaken at maximum volume the resistance between the two inputs is 1/(1/10 + 1/50) = ~8.33K, perhaps something bigger than 50K would be better.

Best wishes,

Tom
Edited 2023-05-09 22:38 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1611
Posted: 01:06pm 09 May 2023
Copy link to clipboard 
Print this post

I knew what you meant about the setting on the 10k pot.

I think 50k is OK if you make it 100k that would give 9090 ohms. Not that much of an improvement and It would have to be moved a long way to make a noticeable difference in volume. Our hearing of volume is not linear that's why volume control pots are logarithmic.

There is no reason that connecting a 20k pot between the two 1k filter resistors won't do the same job. Same principle.

If you do need more volume then reducing the value of the 68k resistors will do it.

Bill
Keep safe. Live long and prosper.
 
Hawk

Senior Member

Joined: 15/07/2021
Location: Australia
Posts: 141
Posted: 01:07pm 09 May 2023
Copy link to clipboard 
Print this post

I'm sorry if this seems like a really stupid question, but there seems to be a LOT  of discussion regarding getting suitable audio output from the PicoMite(VGA) via MMBASIC.

Is this the first time this has been tried?

Are there other projects that have achieved this successfully?

I'm certainly no electronics expert, but it seems to me that PWM out has been done with multiple MCUs.  Surely there is already a working solution for the RP Pico.

I don't have a lot to add to the discussion technically, but as for requirements, I would like to drive stereo speakers in my Stand-alone unit (0.5 to 1W would be enough), and be able to plug into a 3.5mm jack either headphones, or audio out to speakers (separate or in a monitor.)

Will the solutions that are being suggested work with the PLAY WAV command?

I look forward to a workable solution.

Hawk
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4046
Posted: 01:20pm 09 May 2023
Copy link to clipboard 
Print this post

  Hawk said  I'm sorry if this seems like a really stupid question, but there seems to be a LOT  of discussion regarding getting suitable audio output from the PicoMite(VGA) via MMBASIC.

Is this the first time this has been tried?


The issue is specifically with a battery powered PicoMite feeding an unamplified tiny (less than 1") speaker. The PicoMite VGA has always been OK (perhaps a little "clicky") feeding an amplified desktop speaker.

  Hawk said  Are there other projects that have achieved this successfully?


Probably (?) though they all seem to have at least 2" speakers (properly enlosed) and that appears to compensate for a multitude of sins.

  Hawk said  I'm certainly no electronics expert, but it seems to me that PWM out has been done with multiple MCUs.  Surely there is already a working solution for the RP Pico.


I'm no expert either hence my asking for lots of help, but one of the significant issues has been compensating for the Pico's relatively noisy power supply and in addition until recently there were some firmware "problems" that made PLAY SOUND and PLAY TONE rather "clicky".

  Hawk said  I don't have a lot to add to the discussion technically, but as for requirements, I would like to drive stereo speakers in my Stand-alone unit (0.5 to 1W would be enough), and be able to plug into a 3.5mm jack either headphones, or audio out to speakers (separate or in a monitor.)


I can't comment on that.

  Hawk said  Will the solutions that are being suggested work with the PLAY WAV command?


Yes.

Best wishes,

Tom
Edited 2023-05-09 23:26 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9131
Posted: 01:28pm 09 May 2023
Copy link to clipboard 
Print this post

  Quote  Are there other projects that have achieved this successfully?


Lots. Just use the circuit in the manual and an externally powered amplifier or powered speakers
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4046
Posted: 01:31pm 09 May 2023
Copy link to clipboard 
Print this post

  matherp said  Lots. Just use the circuit in the manual and an externally powered amplifier or powered speakers


This being the clincher @Hawk, I didn't have that option and haven't just been being awkward for the sake of it .

Best wishes,

Tom
Edited 2023-05-09 23:39 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
mozzie
Regular Member

Joined: 15/06/2020
Location: Australia
Posts: 68
Posted: 05:34am 10 May 2023
Copy link to clipboard 
Print this post

G'day Tom,
Good to "hear" you are having a win with the sound output and PAM amp  

The circuit as shown was for the bare chip so you'll have to make adjustments for the components on the module, the pull down resistor on /SD is to shut off the amp until required by setting GPIO high.

Try both volume control methods, however testing here showed the "clicks and pops" from the play sound were more pronounced with a single pot across the inputs rather than the stereo pot as shown. The extra caps (C3 / C6) are AC coupling and also high pass filter to help remove low frequencies the tiny speakers can't reproduce, approx 80Hz with values shown, with your speaker 47nF or smaller might be worth a try. There is no point amplifying a signal the speaker has no hope of reproducing.

You may also find a small "Straight Blade" screwdriver works far better with the tiny pots than any "Phillips Head" type.

Hope this helps.

Regards,
Lyle.
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1611
Posted: 06:21am 10 May 2023
Copy link to clipboard 
Print this post

You could get a similar effect by reducing the capacitors C5 and C6 to 33nF?

Tom wants the circuit to be as compact as possible that is why he is trying the one pot approach.

Bill
Keep safe. Live long and prosper.
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4046
Posted: 06:37am 10 May 2023
Copy link to clipboard 
Print this post

Between the components on the module and those we've added around it the audio circuit contains 8 resistors, 11 capacitors, 2 ferrite beads and 2 variable resistors. I think that *must* be enough to mollify the analogue gods.

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6801
Posted: 07:18am 10 May 2023
Copy link to clipboard 
Print this post

To keep the older gods happy you need an output valve and transformer, 2V accumulator for the heater and a 90V HT battery with a tap for grid bias. :)
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1611
Posted: 07:31am 10 May 2023
Copy link to clipboard 
Print this post

Mozzie has a point about the SD input though. If popping at switch on and switch off becomes a problem there may be a need to add even more. The datasheet and the schematic say that the SD should be held down when power is applied and also when power is switched off.

Mozzie's 10k pulldown resistor, in conjunction with the internal 10k pullup resistor in the module would put the SD input at about half Vcc "in no man's land" neither on nor off. Not good. Remove it.

I suggest that, under program control, that you use an output the turn on the amp only when sound is needed and turn it off when the sound has finished. It won't stop the popping at turn on so if that becomes a problem then something more tricky may be needed.

Bill
Keep safe. Live long and prosper.
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6801
Posted: 08:00am 10 May 2023
Copy link to clipboard 
Print this post

I'm surprised that there's a switch-on pop if SD is high during switch on. Both sides of the speaker should be at mid voltage. If there's any pop it's part of the input circuit. Make sure that any input capacitors have time to charge before SD goes low then there shouldn't be any trouble.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
     Page 12 of 14    
Print this page
© JAQ Software 2024