Re: 8ms Timer for serial port access

From: Jens Schumacher (jens.schumache_at_gmx.net)
Date: 10/29/03


Date: Tue, 28 Oct 2003 20:19:02 -0500

Am 28/10/03 19:27 Uhr schrieb "Byron A Jeff" unter <byron@cc.gatech.edu> in
bnn1hl$lqc@cleon.cc.gatech.edu:

> -I programmed in C++. So there is there is one Object which handles the
> -serial port connection and puts the data in some variables. There is another
> -Object with a graphical interface which displays the data and draws a graph
> -etc. To get the data, I call a function in the "serial port object" which
> -returns me the current values. And this is done with a timer. Maybe I should
> -change the object hierarchy, but I thought it is nice to have a independent
> -serial port object.
>
> That organization is fine. You simply want to poll the serial object for
> new data. Let the serial driver handle the receipt of the data.

OK got this, but there is the problem. How can I poll the data with a
frequency of 120Hz. When I use a timer, the best case I can get is a
temporal resolution of 100Hz, right?

> -The read function returns the number of bytes it managed to read from the
> -buffer, doesn't matter how many bytes you want to read. So, as far is I
> -know, there is nothing like a sleep until 24 bytes are received, or is
> -there? Don't know any other nice solution without keeping the cpu busy.
> -One way would be to ask in a while if 24 bytes are in the buffer and then
> -call the read function. But I'm not sure if this is a nice solution.
>
> You'll have to loop that yourself. But since you know data is going to show
> every 8 ms, you can simply timestamp the last time you read the port, and
> if more than 8ms has elapsed, read the new data.

But how can I trigger the event. If I insert a sleep I'm limited again to
the 100Hz Kernel frequency. And as described the delay should be as minimal
as possible. Can I use this timestamp without running into this 100Hz limit?

>
> But there certainly isn't a need for you to attempt real time management of
> the serial port. The kernel driver will handle the port. All you need to do
> is talk to the driver.

This is all I want. Would be nice if I could do this that easily. Maybe I
just think to complicated at the moment. But I'm really confused.

Thanks

Jens Schumacher



Relevant Pages

  • Re: Seagate Barracuda 160 GB IDE becomes corrupted. RMA?
    ... Operating System Microsoft Windows 2000 Professional ... System Memory 512 MB ... Communication Port Communications Port ... Driver Download http://www.viaarena.com/?PageID=2 ...
    (comp.sys.ibm.pc.hardware.storage)
  • soft lockup disease (2.6.14-rc1, x86_64)
    ... IA-32 Microcode Update Driver: v1 ... IO window: 1000-1fff] L ... ACPI: PM-Timer IO Port: 0x408 ACPI: Local APIC address 0xfee00000 ...
    (Linux-Kernel)
  • [PATCH]PCI Express Port Bus Driver
    ... A PCI Express Port is a logical PCI-PCI Bridge structure. ... physical device to be handled by only a single driver. ... service drivers will compete for a single PCI-PCI Bridge device. ...
    (Linux-Kernel)
  • Need pci=assign-busses for Acer Aspire 9410
    ... Using APIC driver default ... ACPI: Local APIC address 0xfee00000 ... SELinux: Initializing. ... cs: IO port probe 0x6000-0x6fff: clean. ...
    (Linux-Kernel)
  • 2.6.19-rc2 - Cable detection problem in pata_amd
    ... the pata_amd driver mis-detects the cable connected to the ... 2nd port on my system as 40 wire and sets UDMA/33 for this drive. ... I've tried switching the cables around to see if it truly was a cable ... Linux Plug and Play Support v0.97 Adam Belay ...
    (Linux-Kernel)