Hello,

I would like to write an application that would periodically write bytes to the parallel port with frequency ranging from several Hz to 1MHz. I thought I could use the hadrware timer to genearte interrupt every time and write a device driver to handle it. However, my first question is: Is it possible to accomplish it? I mean, is it possible to get such a high frequency reliable under Windows? will not my interrupts be delayed by task switching, other interrupts etc. Is it possible to disable task switching etc for a short time? Or would it be realiable at least in the case that no other applications run

Thank you very muc

Re: 1MHz interrupt by Don

Don
Thu Feb 26 07:18:41 CST 2004

No, you cannot get this level of performance. In theory you have a 10ms
timer, with the ability to boost that to a 1ms timer, but then things like
interrupt from other devices kick in. A customer of mine measured the
accuracy of the 1ms timer on their system and found it to anywhere from 1 to
2.7 ms!

--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Remove StopSpam from the email to reply

"Bolek" <kraljaprvni@seznam.cz> wrote in message
news:ABF095B0-AF11-4A13-A934-616EF13E3EEA@microsoft.com...
> Hello,
>
> I would like to write an application that would periodically write bytes
to the parallel port with frequency ranging from several Hz to 1MHz. I
thought I could use the hadrware timer to genearte interrupt every time and
write a device driver to handle it. However, my first question is: Is it
possible to accomplish it? I mean, is it possible to get such a high
frequency reliable under Windows? will not my interrupts be delayed by task
switching, other interrupts etc. Is it possible to disable task switching
etc for a short time? Or would it be realiable at least in the case that no
other applications run?
>
> Thank you very much
>
>



Re: 1MHz interrupt by Pavel

Pavel
Thu Feb 26 11:04:48 CST 2004

There are several 8051 kits with USB interface like Cypress, or RS232,
They are quite easy (*) to program and may do what the OP wants.

--PA


"Don Burn" <burn@stopspam.acm.org> wrote in message news:103rsi4qre55e9f@corp.supernews.com...
> No, you cannot get this level of performance. In theory you have a 10ms
> timer, with the ability to boost that to a 1ms timer, but then things like
> interrupt from other devices kick in. A customer of mine measured the
> accuracy of the 1ms timer on their system and found it to anywhere from 1 to
> 2.7 ms!
>
> --
> Don Burn (MVP, Windows DDK)
> Windows 2k/XP/2k3 Filesystem and Driver Consulting
> Remove StopSpam from the email to reply
>
> "Bolek" <kraljaprvni@seznam.cz> wrote in message
> news:ABF095B0-AF11-4A13-A934-616EF13E3EEA@microsoft.com...
> > Hello,
> >
> > I would like to write an application that would periodically write bytes
> to the parallel port with frequency ranging from several Hz to 1MHz. I
> thought I could use the hadrware timer to genearte interrupt every time and
> write a device driver to handle it. However, my first question is: Is it
> possible to accomplish it? I mean, is it possible to get such a high
> frequency reliable under Windows? will not my interrupts be delayed by task
> switching, other interrupts etc. Is it possible to disable task switching
> etc for a short time? Or would it be realiable at least in the case that no
> other applications run?
> >
> > Thank you very much
> >
> >
>
>



Re: 1MHz interrupt by Maxim

Maxim
Sat Feb 28 11:09:33 CST 2004

Nothing on USB can make a million of interrupts per second.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com


"Pavel A." <pavel_a@geeklife.com> wrote in message
news:eayQHqI$DHA.4072@tk2msftngp13.phx.gbl...
> There are several 8051 kits with USB interface like Cypress, or RS232,
> They are quite easy (*) to program and may do what the OP wants.
>
> --PA
>
>
> "Don Burn" <burn@stopspam.acm.org> wrote in message
news:103rsi4qre55e9f@corp.supernews.com...
> > No, you cannot get this level of performance. In theory you have a 10ms
> > timer, with the ability to boost that to a 1ms timer, but then things like
> > interrupt from other devices kick in. A customer of mine measured the
> > accuracy of the 1ms timer on their system and found it to anywhere from 1
to
> > 2.7 ms!
> >
> > --
> > Don Burn (MVP, Windows DDK)
> > Windows 2k/XP/2k3 Filesystem and Driver Consulting
> > Remove StopSpam from the email to reply
> >
> > "Bolek" <kraljaprvni@seznam.cz> wrote in message
> > news:ABF095B0-AF11-4A13-A934-616EF13E3EEA@microsoft.com...
> > > Hello,
> > >
> > > I would like to write an application that would periodically write bytes
> > to the parallel port with frequency ranging from several Hz to 1MHz. I
> > thought I could use the hadrware timer to genearte interrupt every time and
> > write a device driver to handle it. However, my first question is: Is it
> > possible to accomplish it? I mean, is it possible to get such a high
> > frequency reliable under Windows? will not my interrupts be delayed by task
> > switching, other interrupts etc. Is it possible to disable task switching
> > etc for a short time? Or would it be realiable at least in the case that no
> > other applications run?
> > >
> > > Thank you very much
> > >
> > >
> >
> >
>
>



Re: 1MHz interrupt by Alex

Alex
Sat Feb 28 18:26:45 CST 2004

Can't you use DMA to output to the paralel port?

or

If it is experimental, you can do it one of this ways:
Make the application for DOS, reprogram the system timer, write the
apropriate INT hook. This should provide guaranteed timing.
Hook the system timer interupt under windows(posible, not recomended, bad in
a production application, everyone here will flame you for doing it).
Use a realtime thread, write your own Sleep function based on the cpu time
stamp counter and use it in a "..Sleep(something);DoJob();.." loop.(this
will eat 100% of the CPU time).



"Maxim S. Shatskih" <maxim@storagecraft.com> wrote in message
news:eChOiMl$DHA.2576@tk2msftngp13.phx.gbl...
> Nothing on USB can make a million of interrupts per second.
>
> --
> Maxim Shatskih, Windows DDK MVP
> StorageCraft Corporation
> maxim@storagecraft.com
> http://www.storagecraft.com
>
>
> "Pavel A." <pavel_a@geeklife.com> wrote in message
> news:eayQHqI$DHA.4072@tk2msftngp13.phx.gbl...
> > There are several 8051 kits with USB interface like Cypress, or RS232,
> > They are quite easy (*) to program and may do what the OP wants.
> >
> > --PA
> >
> >
> > "Don Burn" <burn@stopspam.acm.org> wrote in message
> news:103rsi4qre55e9f@corp.supernews.com...
> > > No, you cannot get this level of performance. In theory you have a
10ms
> > > timer, with the ability to boost that to a 1ms timer, but then things
like
> > > interrupt from other devices kick in. A customer of mine measured the
> > > accuracy of the 1ms timer on their system and found it to anywhere
from 1
> to
> > > 2.7 ms!
> > >
> > > --
> > > Don Burn (MVP, Windows DDK)
> > > Windows 2k/XP/2k3 Filesystem and Driver Consulting
> > > Remove StopSpam from the email to reply
> > >
> > > "Bolek" <kraljaprvni@seznam.cz> wrote in message
> > > news:ABF095B0-AF11-4A13-A934-616EF13E3EEA@microsoft.com...
> > > > Hello,
> > > >
> > > > I would like to write an application that would periodically write
bytes
> > > to the parallel port with frequency ranging from several Hz to 1MHz. I
> > > thought I could use the hadrware timer to genearte interrupt every
time and
> > > write a device driver to handle it. However, my first question is: Is
it
> > > possible to accomplish it? I mean, is it possible to get such a high
> > > frequency reliable under Windows? will not my interrupts be delayed by
task
> > > switching, other interrupts etc. Is it possible to disable task
switching
> > > etc for a short time? Or would it be realiable at least in the case
that no
> > > other applications run?
> > > >
> > > > Thank you very much
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Re: 1MHz interrupt by Pavel

Pavel
Sat Feb 28 19:03:12 CST 2004

"Maxim S. Shatskih" <maxim@storagecraft.com> wrote in message
news:eChOiMl$DHA.2576@tk2msftngp13.phx.gbl...
> Nothing on USB can make a million of interrupts per second.

I meant, the PC will download a program to the micro via USB, and then
the micro will operate it's external i/o lines. Now you can find a cheap board
with 51 clone running at 20M ops/sec. My most recent experience with these was a
Cygnal eval.board.
It comes with all necessary tools to make a simple app interfaced to PC.

--PA


> "Pavel A." <pavel_a@geeklife.com> wrote in message
> news:eayQHqI$DHA.4072@tk2msftngp13.phx.gbl...
> > There are several 8051 kits with USB interface like Cypress, or RS232,
> > They are quite easy (*) to program and may do what the OP wants.
> >
> > --PA
> >
> >
> > "Don Burn" <burn@stopspam.acm.org> wrote in message
> news:103rsi4qre55e9f@corp.supernews.com...
> > > No, you cannot get this level of performance. In theory you have a 10ms
> > > timer, with the ability to boost that to a 1ms timer, but then things like
> > > interrupt from other devices kick in. A customer of mine measured the
> > > accuracy of the 1ms timer on their system and found it to anywhere from 1
> to
> > > 2.7 ms!
> > >
> > > --
> > > Don Burn (MVP, Windows DDK)
> > > Windows 2k/XP/2k3 Filesystem and Driver Consulting
> > > Remove StopSpam from the email to reply
> > >
> > > "Bolek" <kraljaprvni@seznam.cz> wrote in message
> > > news:ABF095B0-AF11-4A13-A934-616EF13E3EEA@microsoft.com...
> > > > Hello,
> > > >
> > > > I would like to write an application that would periodically write bytes
> > > to the parallel port with frequency ranging from several Hz to 1MHz. I
> > > thought I could use the hadrware timer to genearte interrupt every time and
> > > write a device driver to handle it. However, my first question is: Is it
> > > possible to accomplish it? I mean, is it possible to get such a high
> > > frequency reliable under Windows? will not my interrupts be delayed by task
> > > switching, other interrupts etc. Is it possible to disable task switching
> > > etc for a short time? Or would it be realiable at least in the case that no
> > > other applications run?
> > > >




Re: 1MHz interrupt by Tim

Tim
Mon Mar 01 23:44:10 CST 2004

"Pavel A." <pavel_a@geeklife.com> wrote:

>"Maxim S. Shatskih" <maxim@storagecraft.com> wrote:
>
>> Nothing on USB can make a million of interrupts per second.
>
>I meant, the PC will download a program to the micro via USB, and then
>the micro will operate it's external i/o lines. Now you can find a cheap board
>with 51 clone running at 20M ops/sec. My most recent experience with these was a
>Cygnal eval.board.

Doesn't matter. USB interrupts at 1kHz, not 1MHz. Or are you talking
about programming it via USB, but connecting the I/O lines via some other
path?
--
- Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc

Re: 1MHz interrupt by Bolek

Bolek
Tue Mar 02 04:23:11 CST 2004

Perhaps I could. I don't know much about parallel port and DMA or DMA at
all. Can you recommend me some articles on how to use it? Thanks.

Alex wrote:

> Can't you use DMA to output to the paralel port?
>
> or
>
> If it is experimental, you can do it one of this ways:
> Make the application for DOS, reprogram the system timer, write the
> apropriate INT hook. This should provide guaranteed timing.
> Hook the system timer interupt under windows(posible, not recomended, bad in
> a production application, everyone here will flame you for doing it).
> Use a realtime thread, write your own Sleep function based on the cpu time
> stamp counter and use it in a "..Sleep(something);DoJob();.." loop.(this
> will eat 100% of the CPU time).
>
>
>
> "Maxim S. Shatskih" <maxim@storagecraft.com> wrote in message
> news:eChOiMl$DHA.2576@tk2msftngp13.phx.gbl...
>
>> Nothing on USB can make a million of interrupts per second.
>>
>>--
>>Maxim Shatskih, Windows DDK MVP
>>StorageCraft Corporation
>>maxim@storagecraft.com
>>http://www.storagecraft.com
>>
>>
>>"Pavel A." <pavel_a@geeklife.com> wrote in message
>>news:eayQHqI$DHA.4072@tk2msftngp13.phx.gbl...
>>
>>>There are several 8051 kits with USB interface like Cypress, or RS232,
>>>They are quite easy (*) to program and may do what the OP wants.
>>>
>>>--PA
>>>
>>>
>>>"Don Burn" <burn@stopspam.acm.org> wrote in message
>>
>>news:103rsi4qre55e9f@corp.supernews.com...
>>
>>>>No, you cannot get this level of performance. In theory you have a
>
> 10ms
>
>>>>timer, with the ability to boost that to a 1ms timer, but then things
>
> like
>
>>>>interrupt from other devices kick in. A customer of mine measured the
>>>>accuracy of the 1ms timer on their system and found it to anywhere
>
> from 1
>
>>to
>>
>>>>2.7 ms!
>>>>
>>>>--
>>>>Don Burn (MVP, Windows DDK)
>>>>Windows 2k/XP/2k3 Filesystem and Driver Consulting
>>>>Remove StopSpam from the email to reply
>>>>
>>>>"Bolek" <kraljaprvni@seznam.cz> wrote in message
>>>>news:ABF095B0-AF11-4A13-A934-616EF13E3EEA@microsoft.com...
>>>>
>>>>>Hello,
>>>>>
>>>>>I would like to write an application that would periodically write
>
> bytes
>
>>>>to the parallel port with frequency ranging from several Hz to 1MHz. I
>>>>thought I could use the hadrware timer to genearte interrupt every
>
> time and
>
>>>>write a device driver to handle it. However, my first question is: Is
>
> it
>
>>>>possible to accomplish it? I mean, is it possible to get such a high
>>>>frequency reliable under Windows? will not my interrupts be delayed by
>
> task
>
>>>>switching, other interrupts etc. Is it possible to disable task
>
> switching
>
>>>>etc for a short time? Or would it be realiable at least in the case
>
> that no
>
>>>>other applications run?
>>>>
>>>>>Thank you very much
>>>>>
>>>>>
>>>>
>>>>
>>>
>>
>
>


Re: 1MHz interrupt by Pavel

Pavel
Tue Mar 02 08:01:45 CST 2004

"Tim Roberts" <timr@probo.com> wrote in message news:0l7840d86uodgang15aiqvu3a5kboef66s@4ax.com...
> "Pavel A." <pavel_a@geeklife.com> wrote:
>
> >"Maxim S. Shatskih" <maxim@storagecraft.com> wrote:
> >
> >> Nothing on USB can make a million of interrupts per second.
> >
> >I meant, the PC will download a program to the micro via USB, and then
> >the micro will operate it's external i/o lines. Now you can find a cheap board
> >with 51 clone running at 20M ops/sec. My most recent experience with these was a
> >Cygnal eval.board.
>
> Doesn't matter. USB interrupts at 1kHz, not 1MHz. Or are you talking
> about programming it via USB, but connecting the I/O lines via some other
> path?

Yes, sure. I mean the *external* i/o pins on the uC board.
Most of available cheap boards have serial connection with host, USB was mentioned just for example.

- PA