Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 09:46 25 Apr 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: can we explain/fix "ticking" when using PLAY SOUND

     Page 2 of 5    
Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8578
Posted: 11:02am 20 Mar 2023
Copy link to clipboard 
Print this post

I would say a key problem is that you are inputting a highish voltage signal into a highish gain amplifier with a noisy power supply. You are then attenuating the input with RV1 which reduces the signal to noise ratio of the system.

I'm running an external amp with a quality power supply and I get no noise at all. There are slight clicks but they are exactly the same in the CMM2.
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3839
Posted: 11:13am 20 Mar 2023
Copy link to clipboard 
Print this post

  matherp said  I would say a key problem is that you are inputting a highish voltage signal into a highish gain amplifier with a noisy power supply. You are then attenuating the input with RV1 which reduces the signal to noise ratio of the system.


OK , is a battery "noisy" ? Hopefully some of our bretheren will look kindly on this poor programmer with some suggestions on what he can do given he's only got about two square inches of PCB to provide audio and ideally wants something he can build from through-hole chinesium.

Yes, Peter (and everyone), I know I'm out of my depth and relying on the goodwill of others.

Best wishes,

Tom
Edited 2023-03-20 21:24 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8578
Posted: 11:39am 20 Mar 2023
Copy link to clipboard 
Print this post

  Quote  OK , is a battery "noisy" ?


Yes when it has all the junk that the RP2040 is adding to it. Try the SDcard approach.

Power the amp through a 10ohm resistor with 100uF and 100nF directly across the amp power pins
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3839
Posted: 11:44am 20 Mar 2023
Copy link to clipboard 
Print this post

  matherp said  Power the amp through a 10ohm resistor with 100uF and 100nF directly across the amp power pins


Thanks Peter, would I be correct in assuming that exactly 10R isn't critical and two 22R in parallel will be close enough ?

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
mozzie
Regular Member

Joined: 15/06/2020
Location: Australia
Posts: 68
Posted: 11:56am 20 Mar 2023
Copy link to clipboard 
Print this post

G'day Tom,
If the bypassing doesn't work can I suggest adding a 100n cap in between the output of the filter (junction of 2.2k resistors) and the volume control, and also re-configuring the volume control so that the wiper goes to the input of the PAM amplifier board.

The 100n capacitor will AC couple the amplifier and also limit the low frequency response to approx 160Hz, if you are using small speakers as mentioned this might stop the speakers / amp from clipping on a sudden signal change and attenuate the clicking sound.

The changes to the volume control will maintain a fairly constant input resistance otherwise the frequency response will change as the volume control changes, less resistance = higher cutoff frequency. Volume controls also don't like DC.

I am no EE etc, but many years of messing with audio gear  
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 5714
Posted: 11:59am 20 Mar 2023
Copy link to clipboard 
Print this post

Yep, that'll be fine. :)
Get the supply from VSYS, via the 10/11R resistor followed by the capacitor(s) to ground. The value is very non-critical.

Incidentally, terminals 1 & 2 of the volume control in your circuit are reversed. The slider of the pot should go to the input. RV2 is actually in parallel with R3.

As mentioned above, AC coupling the volume control input would be good as the output from the PWM filter can sit at about half supply voltage normally. Personally I'd go for about 2.2uF and, if polarised, with + towards the PicoMite. A smaller value capacitor will work, but it may not remove clicks, which are usually high frequency spikes or bursts. It will pass those very well, while reducing your lower frequencies.
Edited 2023-03-20 22:05 by Mixtel90
Mick

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

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3839
Posted: 12:13pm 20 Mar 2023
Copy link to clipboard 
Print this post

  Mixtel90 said  Incidentally, terminals 1 & 2 of the volume control in your circuit are reversed. The slider of the pot should go to the input. RV2 is actually in parallel with R3.


Sorry Mick, I don't quite get you, could you use smaller words ;-) (and this may be an error in the schematic and not the circuit). I think this is the same as one of the points @mozzie made.

  Quote  As mentioned above, AC coupling the volume control input would be good as the output from the PWM filter can sit at about half supply voltage normally. Personally I'd go for about 2.2uF and, if polarised, with + towards the PicoMite.


Can you be specific, between where and where would this capacitor sit ?

Best wishes,

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

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 5714
Posted: 12:25pm 20 Mar 2023
Copy link to clipboard 
Print this post

The two are related, that's lucky. :)

disconnect the volume control terminals marked 1 and 2.

connect a capacitor from the junction of the two 2.2k resistors to terminal 1 of the volume control

connect terminal 2 of the volume control to the amplifier input

that sorts it all out. :)
Mick

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

Guru

Joined: 11/02/2018
Location: Australia
Posts: 1779
Posted: 12:26pm 20 Mar 2023
Copy link to clipboard 
Print this post

They are saying terminal 1 of the pot goes to the filter output, via the extra capacitor and terminal 2 of the pot goes to the amp input.
An alternative location for the extra capacitor would be between the Pico pin and the filter input.
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3839
Posted: 12:29pm 20 Mar 2023
Copy link to clipboard 
Print this post

Thanks Mick, et al., plenty of things to play with this evening.

First need to get the PAM mounted on its own piece of perfboard so it's easier to faff with ... the pins on the bl**dy thing aren't breadboard friendly.

Best wishes,

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

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 5714
Posted: 12:49pm 20 Mar 2023
Copy link to clipboard 
Print this post

@phil99
A capacitor in series with R1 may not work. Remember, this is a PWM signal and the audio doesn't exist (it's only a 40kHz carrier) until it's smoothed out by the filter capacitor. You could, possibly, put the capacitor in series with R2 though. Personally I prefer to keep a little loading on the filter cap. It gives you the opportunity to trim things a bit.
Mick

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

Joined: 11/12/2012
Location: United Kingdom
Posts: 8578
Posted: 01:18pm 20 Mar 2023
Copy link to clipboard 
Print this post

Tom

Try this before I do a new beta. Should cure the clicks. Also includes whitenoise options P and N as per the CMM2


PicoMiteVGA.zip
 
thwill

Guru

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

  matherp said  Tom

Try this before I do a new beta. Should cure the clicks. Also includes whitenoise options P and N as per the CMM2

PicoMiteVGA.zip


Thanks Peter, but this is a PicoMite not a PicoMiteVGA ;-)

I can check it on the VGA this evening if you like ?

Best wishes,

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

Joined: 11/12/2012
Location: United Kingdom
Posts: 8578
Posted: 01:28pm 20 Mar 2023
Copy link to clipboard 
Print this post

PicoMite.zip
 
thwill

Guru

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

  matherp said  PicoMite.zip


Unfortunately PLAY SOUND now seems to be completely dead (no sound), PLAY TONE works ???

Best wishes,

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

Joined: 11/12/2012
Location: United Kingdom
Posts: 8578
Posted: 02:08pm 20 Mar 2023
Copy link to clipboard 
Print this post

Definitely works - just downloaded the ZIP, and re-programmed and all OK with your 4 liner at the top of the thread
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3839
Posted: 02:24pm 20 Mar 2023
Copy link to clipboard 
Print this post

  matherp said  Definitely works - just downloaded the ZIP, and re-programmed and all OK with your 4 liner at the top of the thread


I don't understand it, PLAY TONE and PLAY WAV are fine, but PLAY SOUND with that example now does nothing (except a quiet click and a bit of background white noise). Have tried at different CPUSPEEDs too with no result.

This evening I'll roll-back and test my original version (5.07.06) just in case I've done something daft and changed some other variable in the experiment.

It advertises itself as 5.07.07b28 ?

Best wishes,

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

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3839
Posted: 02:55pm 20 Mar 2023
Copy link to clipboard 
Print this post

I don't suppose you baked in some assumption about which PWM pins are used ? I'm using OPTION AUDIO GP6,GP7

Best wishes,

Tom
Edited 2023-03-21 00:55 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8578
Posted: 03:35pm 20 Mar 2023
Copy link to clipboard 
Print this post

Same and tested at 133000, 252000 and 378000


PicoMite.zip


Posted again - but the same
Edited 2023-03-21 01:36 by matherp
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 3839
Posted: 03:59pm 20 Mar 2023
Copy link to clipboard 
Print this post

Sorry Peter,

- I rolled back to 5.07.06 and PLAY SOUND works (with ticking).
- I nuked it with flash_nuke.uf2.
- I flashed the contents of your zip 5.07.07b28 and PLAY SOUND does not work.
- This is a standard green Pico.

> option list
PicoMite MMBasic Version 5.07.07b28
OPTION AUDIO GP6,GP7, ON PWM CHANNEL 3
> list
Do
 Play sound 1,b,s,523,20
 Pause 400
 Play sound 1,b,s,423,20
 Pause 400
Loop
> run
<... silence ...>


What daft mistake am I making ?

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
     Page 2 of 5    
Print this page
© JAQ Software 2024