Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 12:46 29 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: PicoGAME VGA development

     Page 4 of 31    
Author Message
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4047
Posted: 10:52am 25 Mar 2022
Copy link to clipboard 
Print this post

And now I have (all / most of) the bits for at least 10 of them coming from AliExpress ... I'm not intending to build 10, that's just the way it goes when you order from AliExpress.

I haven't ordered any boxes ... ridiculous that represents the majority of the cost ... wondering whether I can just sandwich the device between two laser cut pieces of 3mm MDF with some spacers - presumably that must be cheaper and not too hard to wrangle.

Best wishes,

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

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6814
Posted: 11:58am 25 Mar 2022
Copy link to clipboard 
Print this post

If you wanted to be *really* classy you could use clear acrylic sheet instead of MDF. Not quite as cheap, but you could gaze in awe upon it's true beauty. :)
Mick

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

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4047
Posted: 12:11pm 25 Mar 2022
Copy link to clipboard 
Print this post

  Mixtel90 said  If you wanted to be *really* classy you could use clear acrylic sheet instead of MDF. Not quite as cheap, but you could gaze in awe upon it's true beauty. :)


Yes, foam board first, then MDF, and finally clear acrylic.

Though I've honestly no idea how to get the latter two made (especially cheap in small quantities) - perhaps I can find a local hackerspace that can help me out.

Best wishes,

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

Joined: 05/03/2018
Location: Netherlands
Posts: 4256
Posted: 12:20pm 25 Mar 2022
Copy link to clipboard 
Print this post

  Mixtel90 said  (Remember that you are looking for a linear sine wave output, ideally. Non-linear diodes and level shifters are not the best idea when what you really want is a low pass filter. :) )


Try it, you'll be amazed. With 1k resistor to the picomite current is around 2mA. The Ri of the diode is 25/2=12.5 ohm. This gives a 40dB rejection of the ripple of the 3.3V. Non linearity is of no importance, it simply clips the 3.3V PWM to 0.7V PWM. So amplitude is 10dB down, but noise floor is 40dB down -> 30 dB improvement.

I you want to drive headphones, try this circuit. Simple, cheap, and works fine.


PicomiteVGA PETSCII ROBOTS
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6814
Posted: 01:47pm 25 Mar 2022
Copy link to clipboard 
Print this post

That project's finished now. I won't be making any changes unless the prototypes have a serious problem that isn't easily fixed with a couple of links or availability of something disappears. It's simply not worth the effort. :)

I have other things I want to look at now.


@thwill
I've bent acrylic rod using a bit of heat to make light pipes a couple of times. Cutting it is just a nick with a knife to weaken it then snap it. I assume you cut the sheet the same way - score it with a knife then bend it over a straight edge. You can drill it (gently, with a sharp drill) or, I'm told, you can melt holes through it by heating up some tube and pushing it through. I've not tried that though.

Polycarbonate is better than acrylic for working in some ways - it's nowhere near as fragile but it's very difficult to keep it bent! We tried bending some pieces at work (to use as HV bus bar shields) by clamping it in a vice and using a hammer. It bounced off. The press brake bent it, but it tended to straighten out rather a lot after taking it out.
Mick

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

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4047
Posted: 01:55pm 25 Mar 2022
Copy link to clipboard 
Print this post

  Mixtel90 said  @thwill
I've bent acrylic rod using a bit of heat to make light pipes a couple of times. Cutting it is just a nick with a knife to weaken it then snap it. I assume you cut the sheet the same way - score it with a knife then bend it over a straight edge. You can drill it (gently, with a sharp drill) or, I'm told, you can melt holes through it by heating up some tube and pushing it through. I've not tried that though.


I'm thinking laser cut or nothing (a laser will vapourise Acrylic rather than melt it). Identical top and bottom rectangles with rounded corners, no sides, and then nylon screws and spacers to keep everything rigid and the PCB in place.

In case you're wondering I'm not planning to go into small scale manufacturing - that's a marginal business at best, I'm just curious about what it would take. I will probably keep a couple of spare boards and component kits around in case anyone wants one (at cost) in the future but doesn't want to go through the faff of PCB manufacture and component chasing.

In any case this is all rather in the nature of putting the cart before the horses given I don't have any physical PCBs yet, nevermind a stuffed and tested VGA PicoMite - Game Edition.

Best wishes,

Tom
Edited 2022-03-26 02:55 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
al18
Senior Member

Joined: 06/07/2019
Location: United States
Posts: 205
Posted: 06:07pm 25 Mar 2022
Copy link to clipboard 
Print this post

Mick,
Thanks for the design.

Note if want to mount JS1 directly to the board, you'll need to desolder the right angle header pins mounted by the supplier and solder straight header pins.

I've used clear polypropylene welding rod as a light pipe. It can easily be bent at an angle. However it doesn't have a round shape - it's a rounded triangle shape.
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6102
Posted: 08:58pm 25 Mar 2022
Copy link to clipboard 
Print this post

  Mixtel90 said  
Polycarbonate is better than acrylic for working in some ways - it's nowhere near as fragile but it's very difficult to keep it bent!

Many years ago - close to 50 years, I used a poly-carbonate laminated sheet by Makrolon.
You could bend it and cut it in the press but there was some bounceback.
Makrolon still exist but I have no idea if the product I used is still available.

Brilliant for projects and one-of covers. I have a very small amount left, saving it for a rainy day.

Jim
VK7JH
MMedit   MMBasic Help
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6814
Posted: 10:26pm 25 Mar 2022
Copy link to clipboard 
Print this post

I think we ended up using Makralon, It was for insulation in a 36,000V switch. Sheets of it were mounted on the steel walls of the box on insulating pillars. That allows a charge to build up on both sides of the sheet, but the one closest to earth is within the rating of the pillars. If you just put the sheet directly on the metal the voltage just arcs straight through. Strange stuff happens at those voltages.


@thwill
I once got a load of thin aluminium pieces laser cut. I was making a pair of high voltage tuning capacitors and these were the moving and fixed plates. The price was very reasonable. :)
Mick

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

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6814
Posted: 04:36pm 27 Mar 2022
Copy link to clipboard 
Print this post

@Volhout
I just got round to using your headphone output circuit while messing about with my VGA mini design. I think you might have a problem if you use it as shown with a Pico. A PNP transistor emitter junction will be forward biased and conduct the 5V directly to the Pico output pin, putting an overvoltage on it. If you swap the transistor for a NPN, with its emitter grounded, it should be fine - especially with a 1k base resistor to limit the current out of the pin. Another possibility is to use an intermediate NPN stage or to use a 3V3 supply and accept a drop in output.

Note that if the PWM output is held low (in the original circuit) or high (if using an NPN) then the transistor will pass 180mA from a 5V supply. You need a 1W resistor to be safe as it could dissipate almost 900mW.

The 27R resistor could be a constant current source of around 100mA or so to get a more linear output.

This configuration of output stage is horribly inefficient. :)  The transistor should be biased to get the junction of the transistor & resistor/current source at half the supply voltage with no signal. That would mean using a DC bias and capacitively coupling the PWM. The amp runs pretty warm and in class A so the quality can be good.

I've used a similar circuit using a triode valve with a common source mosfet directly coupled to the anode. The resistor from the mosfet source to ground is the valve heater. It sounds amazing and warms up the vicinity nicely from a 48V DC HT rail. :)
Mick

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

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2141
Posted: 11:31pm 27 Mar 2022
Copy link to clipboard 
Print this post

If I understand @Volhout's circuit it isn't linear, it is a digital current amplifier for PWM output. The filtering is done by the inductance & inertia of the headphones and by your ears, you just can't hear the PWM frequency.

The max. current through the resistor is (3.3 - 0.6) / 27 = 100mA = 270mW The average will be half that.
Edit - messed that up.
The max. current through the resistor is (5 - 0.6) / 27 = 163mA = 717mW The average will be half that. So a 1/2 W resistor should be ok.


5V won't be applied to the Pico pin as any base current flowing into the pin will turn the transistor on thus pulling the voltage down until the base current (and thus pin current) is a microamp or two. The Pico can cope with this.
Edited 2022-03-28 09:43 by phil99
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1611
Posted: 01:15am 28 Mar 2022
Copy link to clipboard 
Print this post

What is the state of the pin when there is no sound? Logic 0 or 1? I think something a little more is needed, maybe a complementary pair of transistors between 0 and 3.3 volts with a base resistor of (say) 1K and 27ohm and 22uF in series with the output.

Bill
Keep safe. Live long and prosper.
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2141
Posted: 06:07am 28 Mar 2022
Copy link to clipboard 
Print this post

"What is the state of the pin when there is no sound?"

One would expect it to be the PWM frequency with a 50% duty cycle.

As it is only for driving headphones any more complexity is overkill, IMHO.

If there is a low-pass filter between the Pico and the base it becomes a linear amp. However as it is an emitter follower it has plenty of negative feedback so the fidelity will still be very high.
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4256
Posted: 06:40am 28 Mar 2022
Copy link to clipboard 
Print this post

The amplifier circuit I showed earlier is a simple buffer for a high(er) impedance audio signal that is centered around 1.6Vdc. It was used in the ArmmiteF4 tetris game. The armmite has a real DAC output that does not require low pass filtering.

In case it is used for the picomite with PWM, you do need to use the low pass filter (1k+47nf) and then connect to the base of the PNP transistor. Due to the capacitor in the low pass filter (as long as there is modulation) the bias of the base of the transistor will not cause any problems. When the PWM pin of the picomite is switched to INPUT, it will (becuase of the PNP transistor base current) be driven to 4V, whee the current limit is in the 1k low pass filter resistor. I have not tested if this is a problem. I simply have PWM all the time.

For 32 ohm headphones you will be able to increase the 27 ohm resistor to something like 39 or 47 ohm. In a different thread I have shown a buffer that uses a current source, in stead of the 27ohm resistor. Performance of that circuit is better but it has more components.

Volhout
PicomiteVGA PETSCII ROBOTS
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4256
Posted: 06:50am 28 Mar 2022
Copy link to clipboard 
Print this post

  phil99 said  
If there is a low-pass filter between the Pico and the base it becomes a linear amp. However as it is an emitter follower it has plenty of negative feedback so the fidelity will still be very high.


Do not expect the amplifier to be "hifi". The transistor used in combination with a 27 ohm emitter resistor, will give the amplifier some non-linearity. That is why I improved the circuit with the current source later. But for the typical "game sound" this is good enough. Using a BC327 or 2N2907 or equivalent (relatively high gain, medium current PNP) gives better results.
Edited 2022-03-28 16:53 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1611
Posted: 06:56am 28 Mar 2022
Copy link to clipboard 
Print this post

  Quote  One would expect it to be the PWM frequency with a 50% duty cycle

For a program with no sound?

What happens if the Pico 3.3v supply fails? We have a 27 ohm resistor connected to 5v feeding the Pico input via a 'diode' junction. RIP Pico.

Sorry, not for me.

Bill
Keep safe. Live long and prosper.
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6814
Posted: 10:28am 28 Mar 2022
Copy link to clipboard 
Print this post

There is no "average" output from a PWM pin. It is one of tristate, high or low completely under program control. Consequently you have to assume that the programmer (and it may not be you) has set the pin to something and it will always be worst case. So, the transistor can be hard on or hard off.

In the case of the transistor being hard on the only current limit through the 27R resistor is the emitter-collector drop which is pretty minimal. If it drops 0.2V then the current is 178mA and the power is 850mW. This can be continuous and you won't know about it unless you check the temperature of the transistor and resistor.

The transistor can't be hard off in the circuit as drawn. The maximum voltage on the base is 3V3 if the PWM pin is high and the emitter is 0.6V higher at 3V9. That gives a resistor current of 40mA.

If the PWM pin happens to be tristate then the base of the transistor is floating. Consequently the voltage on it is 5 - 0.6 = 4.4V. This is not good for a pin with a maximum rating of 3.6V. The fact that it's tristate doesn't matter - it still connected to two mosfets on the die, they just happen to be switched off. If you are lucky there won't be diodes formed in the substrate that might cause problems. Do you want to gamble?  :)

The easy getout is simply to run the circuit at 3V3, but watch the current if you are powering headphones from the PicoMite 3V3 rail as it has limited current and there are two channels. It may also be noisy.

Incidentally, there is no voltage gain in this circuit no matter what transistor you use. An emitter follower has to have a gain of less than one. It does have current gain though, which is where you get the lower impedance output. Whether it works better than a simple resistor direct from the PWM pin I don't know yet. :)
Mick

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

Joined: 05/03/2018
Location: Netherlands
Posts: 4256
Posted: 12:16pm 28 Mar 2022
Copy link to clipboard 
Print this post

  Turbo46 said  
  Quote  One would expect it to be the PWM frequency with a 50% duty cycle

For a program with no sound?

What happens if the Pico 3.3v supply fails? We have a 27 ohm resistor connected to 5v feeding the Pico input via a 'diode' junction. RIP Pico.

Sorry, not for me.

Bill


Hi Bill,

As long as you leave the collector of the transistor connected to ground, you will never exceed the base current of the transistor. With a hfe of 300, that is maximum (5-0.6)/(27*300)=0.5mA
That won't kill the chip.

But regardless, it is not for you if you .... ;)
PicomiteVGA PETSCII ROBOTS
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4256
Posted: 12:25pm 28 Mar 2022
Copy link to clipboard 
Print this post

  Mixtel90 said  There is no "average" output from a PWM pin. It is one of tristate, high or low completely under program control. Consequently you have to assume that the programmer (and it may not be you) has set the pin to something and it will always be worst case. So, the transistor can be hard on or hard off.

In the case of the transistor being hard on the only current limit through the 27R resistor is the emitter-collector drop which is pretty minimal. If it drops 0.2V then the current is 178mA and the power is 850mW. This can be continuous and you won't know about it unless you check the temperature of the transistor and resistor.

The transistor can't be hard off in the circuit as drawn. The maximum voltage on the base is 3V3 if the PWM pin is high and the emitter is 0.6V higher at 3V9. That gives a resistor current of 40mA.

If the PWM pin happens to be tristate then the base of the transistor is floating. Consequently the voltage on it is 5 - 0.6 = 4.4V. This is not good for a pin with a maximum rating of 3.6V. The fact that it's tristate doesn't matter - it still connected to two mosfets on the die, they just happen to be switched off. If you are lucky there won't be diodes formed in the substrate that might cause problems. Do you want to gamble?  :)

The easy getout is simply to run the circuit at 3V3, but watch the current if you are powering headphones from the PicoMite 3V3 rail as it has limited current and there are two channels. It may also be noisy.

Incidentally, there is no voltage gain in this circuit no matter what transistor you use. An emitter follower has to have a gain of less than one. It does have current gain though, which is where you get the lower impedance output. Whether it works better than a simple resistor direct from the PWM pin I don't know yet. :)


I like this kind of feedback. People analyze what you propose, and try to shoot holes in it. Thanks guys. You all feel hesitant against it, and that is fine.
But for a 32 ohm headset it is far better than a resistor, since the pico pins simply cannot deliver sufficient current. You can choose to thermally overload the IO pin by driving to much current, or adding a buffer. Any buffer (not specific this one).

The reverse bias current from the "tristate" IO pin however is 40mA/300 (the hfe of the transistor) so it is equal to 0.13mA. This will not kill any IO pin. Definitely not. Understand that these pins are typically soft ESD protected and these diodes will not suffer from 0.1mA. Absolutely not.

Anyway, no one is forcing you to use this circuit.
But .. it works, it is proven(*), it is simple, and free to use (no license involved).

Volhout
(*) I use it in mu CMM2 for headset output, my ArmmiteF4 to drive a small speaker, and plan to use it on my picomite VGA when I get to layout phase.
Edited 2022-03-28 22:30 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6814
Posted: 02:08pm 28 Mar 2022
Copy link to clipboard 
Print this post

A quick & dirty simulation using Circuit Simulator gives current out of the base at 124.38uA into 3V3 and 525.84uA into 0V (with a hFE of 300). Of course, these are when the PWM pin is driven to its limits so it won't go overvoltage.

The RP2040 Datasheet doesn't give a current rating for the ESD system. If you prefer to put 4V4 on the pin rather than the absolute maximum stated in the Datasheet and trust that the ESD protection will carry the 120-odd uA then fair enough.  :)
Mick

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