Precise signal generation using matlab

  • Permalink
  • submit to reddit
  • Email
  • Follow


Can I generate a signal using MATLAB which is in the order of microseconds( Stays low for 1microsecond and becomes high the next microsecond) and output the same via serial or parallel port?
0
Reply venkata 8/23/2010 4:14:05 AM

See related articles to this posting

On 22/08/10 11:14 PM, venkata wrote:
> Can I generate a signal using MATLAB which is in the order of
> microseconds( Stays low for 1microsecond and becomes high the next
> microsecond) and output the same via serial or parallel port?

*Maybe*. I personally wouldn't count on it, though.

You _might_ be able to do an acceptable job of timing a signal if you 
manage to find an appropriate available hardware-level timer on some 
device, but it would be difficult to do in software unless perhaps you 
are using the RTW.

Asynch serial ports are not designed to run at 1 megabit per second. 
Apparently with 2009a and later, you can run at about 0.92 megabit/s, 
but it would be impossible to control the timing of the bits precisely 
within that framework.


Parallel ports... I'm having to do a bunch of careful reading here.

http://www.bb-elec.com/tech_articles/parallel_port_explained.asp

Look right near the bottom, where it talks about ISA cards supporting 2 
megabytes per second maximum, and PCI cards supporting 5.5 to 6 
megabytes per second maximum. That 5.6 to 6 megabytes per second 
_sounds_ like plenty for your application, but it needs EPP mode to do 
it as ECP mode is (the article says) not supported on PCI cards which 
(the article says) do not support DMA. EPP works with hardware support 
by monkeying with the bus wait states -- and that should raise red flags 
about loss of precision in the timing and about clock jitter.

Perhaps I just haven't been paying attention (a good possibility in this 
matter), but it seems to me that parallel ports these days tend to be 
ECP rather than EPP. Perhaps support for both modes is common; I don't 
do much PC hardware work.


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

This article gives more detail on how ISA cards are able to do 2 
megabytes per second. The method is _comparatively_ simple and I would 
_expect_ it to suffer less timing and jitter, but I'm not at all 
certain. And there is the fact that not many systems these days are 
built with ISA slots other than perhaps a compatibility mode.


Now, in general, the process of sending a signal through a parallel port 
involves asserting a signal on to the lines, and when the lines have had 
time to settle, asserting a strobe pulse on a separate line. The 
destination then takes a snapshot of the state of the line, usually 
triggered by the strobe line (leading vs trailing edge is defined in the 
standards but not always adhered to), with there being a window during 
which the source is expected to hold the lines steady (keeping in mind 
signal propagation time). After that the parallel lines are supposed to 
return to ground state -- parallel doesn't inherently mean "synchronous" 
(other than for the 8 data lines): except in the advanced modes the 
general assumption is that it will be a random amount of time before 
there is more data to be transmitted, so except perhaps in some of the 
advanced modes, two output bits in a row that happened to be the same 
would cause two separate drive-up and release-down on the pin, rather 
than just leaving the line in its last state until it is known to need 
to change.

The implication of this for your purpose is that you are going to have 
trouble getting your bit timing to be precise: you may get a million bit 
samples per second, but those are transferred as short-term samples of 
the state of the lines rather than through precise timing of the line 
states themselves. From the beginning of the cycle until the strobe, the 
data line is allowed to slew (and it probably will, as there is no 
inherent active de-bouncing in the technology and the lines will be 
moving from ground each time.) And then again after the strobe period 
slew is allowed.

Really, if you wanted to do more precise bit-hold timing with parallel 
ports, you should be working with the control bits rather than the data 
bits -- some of the control bits are defined as being holdable for 
extended times. The problem with that approach, though, is that you 
would have to do it through low level software control, perhaps in SPP 
mode (10 I/O cycles per byte), and you would never be able to get the 
data rates that you want if you used those modes. The higher the data 
rate you want, the more the work of the control pins is delegated to 
special-purpose state-engine hardware...


So what is the summary here?

A) That if you need precise timing, you are better off using a digital 
control of a device that generates the signal, whether that device be 
custom or a signal generator; and

B) If data rates is the aim rather than signal timing, by the time you 
want data rates of 1 megabits per second, you should probably give up on 
asynch serial or parallel ports, and should instead move to synch 
systems such as T1 or E0 lines, or to ethernet. A bit timing of 1 
megahertz on a four-wire connection is no problem; the E0 maximum rate 
is 1.544 megabits per second (T1 data rate is exactly 7/8 of that.)
0
Reply Walter 8/23/2010 5:33:12 AM

@walter robertson

Thank you for the reply.
0
Reply venkata 9/8/2010 5:04:04 AM
comp.soft-sys.matlab 201427 articles. 514 followers. Post

2 Replies
391 Views

Similar Articles

[PageSpeed] 25

  • Permalink
  • submit to reddit
  • Email
  • Follow


Reply:

Similar Artilces:

need code for generating an ecg signal using fourier series in matlab
i am a biomedical engineering student.i need to generate an ecg signal using fourier series using matlab.so i need the code for it.can anyone suggest me the code . On 28 d=E9c, 16:18, "bhargavi " <navilavanyanbharg...@gmail.com> wrote: > i am a biomedical engineering student.i need to generate an ecg signal us= ing fourier series > =A0using matlab.so i need the code > =A0for it.can anyone suggest me the code > =A0. Hi; try to see this link: http://www.mathworks.com/matlabcentral/fileexchange/10858-ecg-simulation-us= ing-matlab bye ...

I am using PCI 6229 to get a signal and PXI-6133 to send a signal back to my sytem using matlab:
I am using PCI 6229 to get a signal and PXI-6133 to send a signal back to my sytem using matlab: I am using matlab and use both AI and AO in the same loop but they dont work together (I dont see any signal in the Scope). what is the problem? thanks in advance AI = analoginput('nidaq','Dev1'); chan = addchannel(AI,0); duration = 0.0005; %0.5ms second acquisition set(AI,'SampleRate',1000) AO = analogoutput('nidaq','Dev4'); chan_o = addchannel(AO,0); set(AO,'SampleRate',1000) ramp=zeros(100,1); putdata(AO,y') start(AO) ...

please can any one post the matlab script for these s&#8226; generate 100 random number or use the test data provided by the standard; &#8226; write Convolution Encoder using MATLAB script; Then you n
&#8226; generate 100 random number or use the test data provided by the standard; &#8226; write Convolution Encoder using MATLAB script; Then you need to verify the Convolution Encoder by &#8226; calling MATLAB built in Convolution Encoder function ; &#8226; calling MATLAB built in Viterbi Decoder function vinay vish wrote: > &#8226; generate 100 random number or use the test data provided by the standard; > &#8226; write Convolution Encoder using MATLAB script; > Then you need to verify the Convolution Encoder by > &#8226; calling MATLAB built in ...

Generate dll in msvc++ using matlab generated dll
hi, I generated a dll using the matlab command mcc. Then made a project( win32 console application project) in msvc++ using this dll and other files generated from matlab. Wrote a main function as the procedure in the matlab compiler help. That project run wihout any error and got the correct output. Now I want to generate a dll for the entire project( above mentioned ). How can I use the matlab generated dll for generating dll in msvc++? ...

About COM objects, generated using Matlab builder, and Matlab Web server
Can someone package his GUI application into a COM object and publish it over the Web using Matlab web server? Is it possible this way that I dont have to create (for any new *.m file) a corresponding *.html or *.php file? Just re-package into a new COM object and re-publish it using matlab web server?? ...

Shall i use the misrosoft Visual c++ code from a m-file generated from matlab in Visual C++ with out matlab runtime environment
undefined ...

7.0 vs. 6.5: (matlab 7.0 does not work) question on using MSVC matlab add-in to generate m-dll to speed-up my program
Dear all, I was using Matlab 6.5 MSVC matlab add-in macro to generate m-MEX-dll used in Matlab for speeding-up my program. I created a new "matlab project" in MSVC 6.0. Then load the m-file "ProcessBitmap.m" which is the m-file I want to convert into MEX dll to use in the matlab command line. Then I built the "dll" file in MSVC 6.0. The generated "ProcessBitmap.dll" can be successfully used in matlab 6.5 command line without any trouble. It can be used inside the matlab command line. Even if I delete the original "m-file", the "ProcessB...

Using matlab to generate noise
I have to create a random number geneator to generate additive noise with zero mean and variance 0.3 The noise then had to be added to a cos function Can anyone give any hints on how to do this? Thanks in advance for any help! this is the code for that x = [-pi:.05:pi]; noise = 0.3.*randn(1,size(x,2)) data = cos(x) + noise B-Riz <briwel06@hotmail.co.uk> wrote in message <14390808.2774.1240263809787.JavaMail.jakarta@nitrogen.mathforum.org>... > I have to create a random number geneator to generate additive noise with zero mean and variance 0.3 The noise then had to be added to...

How generate signal UWB with Matlab???
Hello, Please help me for to generate a signal uwb with matlab. Thank you ...