Author Topic: Getting Pulses from USB  (Read 32640 times)

chavantushar

  • Member
  • ***
  • Posts: 12
Getting Pulses from USB
« on: October 14, 2011, 02:03:10 am »
Basically I want to get pulses(5V, 0-10khz)from USB port.Number of pulses which I want depends upon requirement(e.g. suppose sometimes I want 50pulses or sometime I want 100 pulses etc.)I want to built a C code using that i can able to send pulses at the USB port.
      If it is not possible or difficult  using USB port then please tell me using which port I can fulfill my requirement! Thanks in advance  :)

Guido Koerber

  • Frequent Contributor
  • ****
  • Posts: 72
Re: Getting Pulses from USB
« Reply #1 on: October 14, 2011, 09:26:24 am »
You will need a USB device that does generate the pulses. USB is not a port like serial or parallel it is more like a network interface like ethernet. There absolutely no physical way to control the data lines of the USB in such a way as you would need it.

chavantushar

  • Member
  • ***
  • Posts: 12
Re: Getting Pulses from USB
« Reply #2 on: October 14, 2011, 01:21:54 pm »
sir can you tell me which device I can use? also please suggest me the possible solution...Thanks :)
« Last Edit: October 14, 2011, 01:26:48 pm by chavantushar »

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Getting Pulses from USB
« Reply #3 on: October 14, 2011, 03:14:29 pm »
See Development Boards here:

http://www.lvr.com/usb_device_hardware.htm

for links to hardware for developing devices. You'll need to provide the program code to generate the pulses and respond to commands from the PC.

Or you can buy a frequency generator, for example:

http://www.elandigitalsystems.com/usb/usbwave12.php

For more products, search on

usb frequency generator

Jan

chavantushar

  • Member
  • ***
  • Posts: 12
Re: Getting Pulses from USB
« Reply #4 on: October 15, 2011, 10:39:35 am »
Thanks a lot mam..... :)
But as this is my project,so I cant buy any ready made device.I have to build the device.I have short time to implement this.So can you please suggest me any other easy way to get my project done? I mean can I do this using serial port? Please give me solution.I'm waiting for your reply.

Thanks.

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Getting Pulses from USB
« Reply #5 on: October 15, 2011, 11:29:15 am »
Windows is not a real-time operating system. This means that an application can't send pulses at a defined rate to a port.

However, you might be able to do what you need with a sound card. Try a search on this:

pc sound card programming frequency generator square wave

Jan

chavantushar

  • Member
  • ***
  • Posts: 12
Re: Getting Pulses from USB
« Reply #6 on: October 16, 2011, 03:14:15 am »
Thanks a lot.I searched for "pc sound card programming frequency generator square wave".And I found that it can use to generate standard waveforms but I found that it has some limitations such as,

1.Waveform produced have noise in it.
2.Quality of waveform depend upon sound card.
3.The resolution and full-scale range of the amplitude adjustment depend on the design of the sound card.
4.If system is slow and busy waveforms are interrupted.
etc.

So can you tell me ,Is it possible to do using serial port?I mean , can I get such square pulses at the output of serial port by use of C-Programming? 


Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Getting Pulses from USB
« Reply #7 on: October 16, 2011, 10:14:11 am »
As with USB, you can use a serial port to send commands to a device you program to output pulses at a fixed frequency.

Jan

chavantushar

  • Member
  • ***
  • Posts: 12
Re: Getting Pulses from USB
« Reply #8 on: October 16, 2011, 11:54:46 am »
Thanks Mam, can you please explain me how I can do this?(using serial port how I can complete my requirement?)Please give me detail explanation for using serial port and what kind of programming I have to use?

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Getting Pulses from USB
« Reply #9 on: October 16, 2011, 12:27:10 pm »
Here is one example:

http://rayslogic.com/propeller/PulseGen.htm

using the Parallax Propeller:

http://www.parallax.com/tabid/407/Default.aspx

For more ideas, search on

pulse generator microcontroller source code

or similar

Jan

chavantushar

  • Member
  • ***
  • Posts: 12
Re: Getting Pulses from USB
« Reply #10 on: October 17, 2011, 01:24:43 am »
Thanks.But as far as my project is concerned I have to avoid micro controller.Can I do my project using C language and VB?
I mean we can use VB for making GUI,suppose we want 50 pulses then we have to enter "50" in particular box from the GUI (GUI has to be made using VB),this will automatically change required place from C code which we built(means it will automatically edit the required place from C code) and we will get 50 pulses at the output of serial port.

Please give me directions ,how I can do this.
Thanks and regards,
Tushar

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Getting Pulses from USB
« Reply #11 on: October 17, 2011, 10:01:46 am »
No, Windows is not a real-time operating system. If you need a defined pulse width, you need to generate the pulses in external hardware.

Jan

chavantushar

  • Member
  • ***
  • Posts: 12
Re: Getting Pulses from USB
« Reply #12 on: October 17, 2011, 11:27:29 am »
means according to you micro controller is necessary???It is not possible to get pulses using serial port,C programming and VB along with some other hardware?(I mean hardware without micro controller ?) Because as long as my task is considered I have to avoid micro controller.If I will not get any solution then my last option is to go for micro controller .But for time being I have search to get pulses using serial or parallel port etc. by using C or any other language along with VB to built GUI.

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Getting Pulses from USB
« Reply #13 on: October 17, 2011, 12:24:56 pm »
If you need to output a selectable number of pulses at a selectable frequency, a microcontroller is the way to go.

Jan

chavantushar

  • Member
  • ***
  • Posts: 12
Re: Getting Pulses from USB
« Reply #14 on: October 17, 2011, 12:36:06 pm »
ok...thanks mam...can you guide me how to implement using micro controller?please give me detail regarding that.I want to interface microcontroller with C language and VB(for GUI).