From: Walter Roberson on
Michael Purdy wrote:
> Thanks very much for your help. You are correct in guessing that I am
> trying to control a device through MatLab code, and also that it doesn't
> matter that it is through the PS/2 port. I am trying to turn on/off a
> laser and would like to be able to control the frequency. I am using
> the PS/2 port because it is serial, and I literally just connected pins
> in the PS/2 with a wire to a breadboard. I had a USB-serial interface
> before that wasn't transmitting data fast enough so I couldn't change
> the frequency to a very high one. This is why I am trying to directly
> connect to the PS/2 port.

The maximum clock rate for PS/2 is 16 KHz, with an 11 bit word, so it is only
about 1 kilobyte (8 kilobit of data) per second. If a USB-serial interface
wasn't transmitting quickly enough, then is the PS/2 clock rate going to be
usable for your situation?
From: Michael Purdy on
Sounds like maybe not. Thanks again for your help. Perhaps I'll have to find another way of implementing this.
From: Walter Roberson on
Michael Purdy wrote:
>>> I am trying to turn on/off a laser and would like to be able to control
>>> the frequency.

> Sounds like maybe not. Thanks again for your help. Perhaps I'll have
> to find another way of implementing this.

Could you give more information as to what laser requires in order to change
its frequency? You indicated before that a USB to serial port was not
transmitting fast enough to allow you to change to a higher frequency. When I
read that, it hinted to me that the on-off control of the laser was per-bit
and that higher frequencies corresponded to more bits per second. Is that the
situation, or is it a matter of data acquisition, that you could not read data
samples from the laser (if it is measuring something) quickly enough at
higher frequencies?

If you need to pulse to turn on/off the laser, then possibly a better setup
would be to use a tunable oscillator driving a line, with the oscillator rate
set according to commands sent over a link: then as long as you do not need to
vary the frequency too quickly, the commands could be sent over the USB to
serial converter.

If you do need to control at the bit-level with the bits turning the laser on
and off for each frequency cycle, then it could be quite taxing on system
resources for higher rates. Normal matlab is, as far as I know, not designed
for such tasks: it is designed for bulk computations, not for low interrupts.
The Data Acquisition Toolbox would of course be sensitive to timing; also the
Real Time toolbox would allow you to create software for embedded systems to
accomplish such a task.
From: Michael Purdy on
In my experiment the laser is acting as a stimulus and is not actually acquiring any data. I simply want to send an on/off command in a per-bit fashion as you mentioned. We believe that the limiting factor when using the USB-serial interface was the interface itself as its maximum baud rate was 9600, which may not have been fast enough for high frequency data transmission. I used an oscilloscope to measure the frequency of the signal at the output of the USB-serial interface, and the voltage there was not able to keep up with the frequency I had specified in my MatLab code.

I may have to change to something like a tunable oscillator, but as of right now I do not have one available to me and so would like to write a program to send pulses.
This really should be possible, as the highest frequency I need to generate is only 500Hz (roughly). I have thought about using a parallel port to communicate to the laser (perhaps this could be faster). However, it seems that I would need the Data Acquistion Toolbox, of which there is only a 32-bit version and I am running on a 64-bit machine. Perhaps I will check out the Real Time Toolbox as you mentioned.

Thanks again.
From: Michael Purdy on
I didn't really specify in the last post the actual problems I am encountering.
First, I do not know how to 'make available' the PS/2 port so that it is visible to MatLab. Since there is no legitimate hardware attached to the port I cannot connect to it. The PS/2 port is not visible in the Device Manager even when I show hidden devices. If if was visible, is there some way that I can find it's address and use this to open it in MatLab?
Second, if I can eventually connect to the port I do not know how to change values on certain pins. The PS/2 port does not have RTS or DTR pins like other serial ports. I know that there is a data pin, a clock pin, and ground, and a Vcc, but I don't know what the names of the pins will be in terms that MatLab understands.

I really appreciate all the help. Thank you very much.
First  |  Prev  |  Next  |  Last
Pages: 1 2 3
Prev: help in simulink buck converter
Next: manipulate matrix