Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Computer controlled square wave generator

Status
Not open for further replies.

niculaegeorge

Newbie level 1
Newbie level 1
Joined
Jan 8, 2012
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,320
I am trying for some time to control/drive a simple N-channel MOSFET gate with a computer. Therefore I need a TTL 5 to 12 V output signal from my computer. From what I know, the only output capable of such thing is Parallel Port/Centronics. However I'm not satisfied with that, because I can't get it to switch faster than 1ms. :sad: I've heard speculating that some people have managed to get the maximum switching time out of it, were one bit of info sent acts like a signal picked up by the switching transistors. I wish I could do that, but these are dreams. What I'm only after is kind of a simple square wave generator(emphasize> ONLY SQUARE WAVE) frequency controlled by the computer. What I'm having in mind is a low gate threshold MOSFET acting as a driver for a bigger MOSFET's intended for heavy inductive loads. How can it be more simpler than two transistors? Sadly I wish it were that simple. This low-threshold MOSFET should be controlled by ANY 1V DIGITAL OUTPUT FROM MY COMPUTER. There are MANY "Pick-up points" were I can extract such a digital signal that I can then control with the computer. One is the Parallel port (if someone would actually tell how to make it switch in the KHz range), second is the serial port (here I will need another simple circuit, I say simple because I'm only interested in fast square wave switching, :!: therefore no amplification, no current, no analog signal. Only digital levels. Using pull-ups resistors and additional FET stages to raise the digital level require to open high power N MOSFETs- so what I have in mind is something ridiculous simple. Here using the serial port, I will also need a software). There are many ways I know in theory that a digital output can be extracted from the computer. Another I've heard can be done using the Joystick/MIDI output from a sound card. Another way is through the USB data out pin. But I've also seen another more accessible way to control power FET switching is through the audio output 3.5mm jack stereo output speakers from the sound card. Although in theory I can only achieve a maximum of 20KHz switching frequency, I have to be satisfied with that considering other inaccessible alternatives. The problem with the audio output, is the fact that is weak analog signal. So it must be converted in a high TTL digital output (Analog to Digital conversion ADC) like we see here, **broken link removed**. I've tried with no success to build such circuits. I like this alternative, because I can easily generate for example exactly 13.4567 Hz in a coil using only a computer and few components which is difficult to do with expensive high precision/accuracy signal/function generators! What can it be more cool than that?
Another way through which I'm thinking of controlling the gate switching a MOSFET is through the use of a Soundcard that has a digital output. What can I do about that? :???: Another possibility I'm considering is using the PWM yellow wire fan speed control going into any of the cooling fan in the computer.Is it possible to extract that PWM and use it to drive a low-threshold n channel MOSFET acting as a driver for a bigger more powerful heavy switching nMOSFET? If yes, then I'm going to also need the software that controls the speed of the fan). What schematic should I use? The only thing I am finding on the web regarding all these things, are people that are controlling leds, servos, motors, relays and all kinds of garbage, :x except a simple common ordinary MOSFET !!! Then you have a Square wave (only) generator controlled by the computer. Isn't that cool or what? :cool: Another problem I have to consider with all these possibilities presented, is which of these can most easily provide an almost DC output for longer periods of time, say when I'm trying to output a 50% duty cycle 0.5 Hz frequency switching. This means that I'm not only interested in peaks, or one-shots or low duty cycle. So a S/R latch IC might be required. Therefore I seek a way to generate computer controlled high power/high frequency/adjustable duty-cycle/PWM fast switching using one of the methods described above. Can anybody please help me with advices, suggestions, links or a diagram or something?
 

Is your computer a PC? If so you might have to look for I/O boards allowing you to read/write I/O through memory read/write instructions(mother board bus?). Requires also a special ICs for level shifting and MOSFET drive. To be fast enough you might have to program a driver routine.
 

It seems that you need critical timing and high frequency pulses.
The better option is not to rely on operating system for timing. If you are using Windows, it is going to be a problem as it is not a real time system.
Thus, your software may stop executing and produce longer pulses for a while if there is another critical process going on.

I would suggest you to buy an Arduino board (or other uC based board). You can program it with a simple piece of code that accepts the frequency of the pulses from the PC through USB port.
The USB port shows up as a virtual COM port in PC. You need a simple COM port software on the PC end.

Thus it will run on its own generating the pulses and PC will only talk to it if the pulse frequency (or other characteristic) needs to be changed.
You will get pulse timing accuracy in the range of microseconds.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top