Building +5v 60kHz PWM with a TL494 ic

Building your first 6502-based project? We'll help you get started here.
Post Reply
vmarcus
Posts: 10
Joined: 04 Feb 2022
Location: Mid-west - USA

Building +5v 60kHz PWM with a TL494 ic

Post by vmarcus »

Hey, I have somewhat, an embarrassing question. (Yeah, I’m still new to circuit design. :oops: )

What I am trying to do, is to supply a “stable” +5v 60kHz (50% duty cycle) square wave pulse signal for a replacement power supply of my CBM 710 computer. On my first attempt, on a previous replacement PSU, I used an adjustable 555 timer module, I got the desired frequency, but I got a little too much of the occasional flickering. Wasn’t sure, if this flickering was due to spikes/noise from the +5-volt supply. (or perhaps, I was lacking a 5v power regulator leading to the 555 timer)

However, this time, I’m using the TL494 ic. But for the examples, I'm seeing, even though resulting generated 2 PWM signals are 5v, it appears the VCC supply voltage is +12V or above. https://microcontrollerslab.com/tl494-p ... 4_Examples

Yeah, a bit confusing to me, as the novice, since original 710 PSU schematic http://www.zimmers.net/anonftp/pub/cbm/ ... -lp-ps.pdf
lists a 4N35 ic, but the actual PSU I have clearly has TL 494 ic.

Could someone, sketch out (or describe) an example 60kHz PWM circuit? I'll really be grateful. :D
Well, let me know of a simple alternative.
User avatar
GARTHWILSON
Forum Moderator
Posts: 8773
Joined: 30 Aug 2002
Location: Southern California
Contact:

Re: Building +5v 60kHz PWM with a TL494 ic

Post by GARTHWILSON »

Is the purpose to get +5V from +12, or vice-versa, or something else? There's more to getting a well behaved switch-mode power supply (SMPS) than just doing a PWM, and it's not territory that hobbyists do well in. I might recommend going with a ready-made integrated switching regulator instead, or just buying a complete power supply. One such regulator supplier we've used at work recently is Pololu. See https://www.pololu.com/category/136/voltage-regulators .

If you don't want the whole thing in one little pre-made module, there are tons of switching-regulator control ICs that have almost everything onboard except a few capacitors, an inductor, and a Schottky diode like a 1N5817. One I've used in several products, to get +12V from a 9V battery that gradually drops to below 5V as it wears out, is the MAX732 which keeps a constant frequency, although it's 170kHz, not 60kHz like you mention. Even there though, the layout is very critical; and if it isn't right, you'll get a noisy output that will skip pulses if the load isn't heavy enough. If you want to use the MAX732, post your design before getting boards made, and I'll point out what changes it needs in order to make a quiet output. It's especially hard to get a quiet output with thru-hole parts. Their lead inductance tends to be too much, something which the newbie might have a hard time believing; but my experience proves it.

Jameco's offerings of complete power supplies starts at https://www.jameco.com/c/Power-Supplies ... pters.html . Prices are very reasonable.
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
User avatar
GaBuZoMeu
Posts: 660
Joined: 01 Mar 2017
Location: North-Germany

Re: Building +5v 60kHz PWM with a TL494 ic

Post by GaBuZoMeu »

The 4N35 is an opto-coupler. And it looks to me as an output for a 60 Hz (not kHz !!) Signal, that is called "CP timing output".
If this signal isn't present most likely the 4N35 is damaged.

BEWARE: when replacing the 4N35 be sure that all caps are discharged !! Some hundred volts DC can do lethal injuries.
vmarcus
Posts: 10
Joined: 04 Feb 2022
Location: Mid-west - USA

Re: Building +5v 60kHz PWM with a TL494 ic

Post by vmarcus »

Hello,
GARTHWILSON wrote:
Is the purpose to get +5V from +12, or vice-versa, or something else? There's more to getting a well behaved switch-mode power supply (SMPS) than just doing a PWM, and it's not territory that hobbyists do well in. I might recommend going with a ready-made integrated switching regulator instead, or just buying a complete power supply. One such regulator supplier we've used at work recently is Pololu. See https://www.pololu.com/category/136/voltage-regulators .
Thank you for your response.
Sorry, I was mistaken, that should be 60Hz PWM, not 60kHz.
Trying keep the solution, as simple as possible. +5v in, and +5v PWM coming out.
I already have a Mean Well PT-65B power supply, which addresses the GND, GND, -12V, +12V, & +5v requirements.
All I wanted was to replicate the 60Hz signal that feeds into the Pin #1 of the power connector.


Yes, I agree,
"There's more to getting a well behaved switch-mode power supply (SMPS) than just doing a PWM, and it's not territory that hobbyists do well in."

But, you when you take your 40 year Commodore computer into a half dozen computer repair shops, and they look at you saying, what the hell is that? You realize, you are in for a rude awaken.
User avatar
GaBuZoMeu
Posts: 660
Joined: 01 Mar 2017
Location: North-Germany

Re: Building +5v 60kHz PWM with a TL494 ic

Post by GaBuZoMeu »

OK, so you need a 60Hz square wave generator.

You can rebuild the circuit from the original power supply, but then you are dealing with the mains - not recommended.

Using a 555 should work:
555.PNG
555.PNG (54.58 KiB) Viewed 1887 times
with R1 = 20.5 K, R2 = 110 K, and C = 0.1uF https://ohmslawcalculator.com/555-astable-calculator computes 60.000 Hz (!) and 54,26 % duty cycle (7,6ms low / 9ms high).

(I would use 18K + 5K trimmer for R1 to adjust for 60 Hz. R2 = 2x 220K parallel. An additional 0.1uF decoupling C across Vcc/Gnd is never bad.)


good luck!
User avatar
BillO
Posts: 1038
Joined: 12 Dec 2008
Location: Canada

Re: Building +5v 60kHz PWM with a TL494 ic

Post by BillO »

What is that signal used for? If it has anything to do with video syncing it may be best to have it based on the mains frequency. Using a 555 might (probably will) cause issues.
Bill
vmarcus
Posts: 10
Joined: 04 Feb 2022
Location: Mid-west - USA

Re: Building +5v 60kHz PWM with a TL494 ic

Post by vmarcus »

Hey,
GaBuZoMeu wrote:
OK, so you need a 60Hz square wave generator.

You can rebuild the circuit from the original power supply, but then you are dealing with the mains - not recommended.

Using a 555 should work:
*** This is exactly what I wanted, thank you. :)
I'll build this circuit, tap into +5v lead from the replacement PSU.
Yes, I will never attempt, to rebuild a PSU.
That's why I'm here, squawking like a mad duck, since I can't seem to find a modern PSU which supplies square wave generator.
BillO wrote:
What is that signal used for? If it has anything to do with video syncing it may be best to have it based on the mains frequency. Using a 555 might (probably will) cause issues.
Yes, this is for the video syncing and the for the Jiffy clock.

I find it rather baffling, why the heck this B128 is requiring this pulse from the Power Supply Unit, instead of generating it on the board.
None, of the other 8-bit Commodore computers has this requirement.

But I'm thinking since this signal has to so precise, I'll likely need to resort to a crystal oscillator and divide the frequency down to 60Hz.
https://www.eleccircuit.com/60hz-clock- ... or_circuit
User avatar
GARTHWILSON
Forum Moderator
Posts: 8773
Joined: 30 Aug 2002
Location: Southern California
Contact:

Re: Building +5v 60kHz PWM with a TL494 ic

Post by GARTHWILSON »

Right. A 555 with no crystal will not be very accurate. With Schmitt-trigger CMOS gates like the 74xx14, there's not much reason to ever use a 555 again either.
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
User avatar
BillO
Posts: 1038
Joined: 12 Dec 2008
Location: Canada

Re: Building +5v 60kHz PWM with a TL494 ic

Post by BillO »

Those MM5369 chips are as cheap as borsht. So are color burst crystals. I'd just skip the 555 and make the MM5369 circuit.
Bill
User avatar
Dr Jefyll
Posts: 3525
Joined: 11 Dec 2009
Location: Ontario, Canada
Contact:

Re: Building +5v 60kHz PWM with a TL494 ic

Post by Dr Jefyll »

vmarcus wrote:
Trying keep the solution, as simple as possible. +5v in, and +5v PWM coming out.
I already have a Mean Well PT-65B power supply, which addresses the GND, GND, -12V, +12V, & +5v requirements.
All I wanted was to replicate the 60Hz signal that feeds into the Pin #1 of the power connector.

[...] But I'm thinking since this signal has to so precise, I'll likely need to resort to a crystal oscillator and divide the frequency down to 60Hz.
The oscillator/divider would be a worthy project, and would help develop your skills. But if you feel there's already enough on your plate then you could consider the following approaches, which are much simpler but are a bit clunky to use, as they require a separate AC adapter aka "wall wart" in addition to your Mean Well power supply. NB- many wall warts deliver DC output; you need to locate one that has AC output. Thrift stores are a good source of assorted wall warts. Any output voltage from about 3 VAC to 30 VAC is acceptable.

-- Jeff
Attachments
60 Hz .png
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html
User avatar
GaBuZoMeu
Posts: 660
Joined: 01 Mar 2017
Location: North-Germany

Re: Building +5v 60kHz PWM with a TL494 ic

Post by GaBuZoMeu »

vmarcus wrote:
Yes, this is for the video syncing and the for the Jiffy clock.
This is more important than you might think: if the clock isn't synchronized to the AC main you will have video issues for sure.

That is why I recommend Jeff's suggestion using a wall wart AC adapter is save and easy.


good luck!
User avatar
BigEd
Posts: 11463
Joined: 11 Dec 2008
Location: England
Contact:

Re: Building +5v 60kHz PWM with a TL494 ic

Post by BigEd »

Are we sure about this? I had the idea that video timing on CBM machines is completely unrelated to the jiffy clock, other than approximately.
https://en.wikipedia.org/wiki/Commodore_CBM-II

Although it seems the Plus/4 models are different in this respect: the two are synchronous.
https://retrocomputing.stackexchange.co ... ng-flashin
vmarcus
Posts: 10
Joined: 04 Feb 2022
Location: Mid-west - USA

Re: Building +5v 60kHz PWM with a TL494 ic

Post by vmarcus »

Hello,
as per the following:
BigEd wrote:
Are we sure about this? I had the idea that video timing on CBM machines is completely unrelated to the jiffy clock, other than approximately.
https://en.wikipedia.org/wiki/Commodore_CBM-II
Yes, you're right, I shouldn't say "jiffy clock" :oops:

Here is what, I'm seeing from the schematics:
1. Page 12 - the 50/60 Hz signal feeds into pin 1 of Power Connector. http://www.zimmers.net/anonftp/pub/cbm/ ... 059-12.gif
2. Page 11 - this same signal feeds into 74L14 (hex inverter) of which then is connected to the pin 25 (IRQ0) of the 6525A and pin 19 (TOD) of the 6526A. http://www.zimmers.net/anonftp/pub/cbm/ ... 059-11.gif
According the 6526a specifications - http://archive.6502.org/datasheets/mos_ ... reated.pdf
The Time of Day Clock (TOD) requires an external 60Hz or 50Hz TTL level input for accurate time-keeping.

It's unfortunate, it's my pea brain that associates a "jiffy" as the period of an alternating current power cycle, 1/60 or 1/50 of a second.
https://en.wikipedia.org/wiki/Jiffy_(time)#Uses And since, a clock was depended on this signal, I just automatically, said jiffy clock.

And it's really weird, someone else actually ventured this same journey of replacing a B128/C610 power supply. https://forum.vcfed.org/index.php?threa ... 610.66228/
And apparently, I really do need to pay attention to lessons learned.
Post Reply