Re: 8ms Timer for serial port access
From: Jens Schumacher (jens.schumache_at_gmx.net)
Date: 10/29/03
- Next message: Grant Edwards: "Re: 8ms Timer for serial port access"
- Previous message: Byron A Jeff: "Re: 8ms Timer for serial port access"
- In reply to: Byron A Jeff: "Re: 8ms Timer for serial port access"
- Next in thread: Grant Edwards: "Re: 8ms Timer for serial port access"
- Reply: Grant Edwards: "Re: 8ms Timer for serial port access"
- Reply: Byron A Jeff: "Re: 8ms Timer for serial port access"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: Grant Edwards: "Re: 8ms Timer for serial port access"
- Previous message: Byron A Jeff: "Re: 8ms Timer for serial port access"
- In reply to: Byron A Jeff: "Re: 8ms Timer for serial port access"
- Next in thread: Grant Edwards: "Re: 8ms Timer for serial port access"
- Reply: Grant Edwards: "Re: 8ms Timer for serial port access"
- Reply: Byron A Jeff: "Re: 8ms Timer for serial port access"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|