I need to read the LSR because I’m used to work directly with
microcontrollers, in which I have allways access to whole registers
space, so I can work at highest possible speeds in serial transmissions.
In this case, I want to control the state of the 9th bit in order to
implement a kind of 485 bus. If the 9th bit is a ‘1’, the byte will be
an address, and if it’s a ‘0’, it will be data.
The problem appears when I change the state of the 9th bit from ‘1’ to
‘0’ (when I have sent the 1st byte, indicating the address of the
peripheral, and I send the 2nd byte, which is a data byte). I do it
before the shift register has finished sending the whole byte, so I
‘corrupt’ the state of the 9th bit, setting it to ‘0’ too soon.
That’s why I need to know the state of this shift register, I must
ensure that it’s empty in order to be able to change the 9th bit state,
and I can only get this info by reading the LSR.
Now, I wonder how is it possible that I have to implement a custom IOCTL
for getting a kind of info that I think that is as basic as other infos
that you can get with yet implemented IOCTLs.
It’s a little worring that I can get the full power of a simple
microcontroller running at 16MHz, but I can’t do it at all because my
PC, which runs at least 100 times faster, doesn’t allow to.
What would you suggest, putting a delay between the address and the
first data byte? If I can, I won’t do that.
En/na Ray Trent ha escrit:
Oh, and by the way OP, why do you think you need to read the LSR? That’s
usually an extremely accurate sign of a poorly designed serial device.Doron Holan wrote:
> Of course, the next set of questions comes up. What if I plug the
> device into the other com port on the machine? What if I plug the
> device into a usb -> serial adapter which you cannot rewrite the driver
> for? What if I plug it into a multi port serial card?
>
> d
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of elena nito
> Sent: Thursday, April 14, 2005 11:48 PM
> To: Windows System Software Devs Interest List
> Subject: Re:[ntdev] custom IOCTL in serial.sys
>
> Hi,
>
> Don’t worry, Loren, I had the same confusion when I first looked for the
>
> way to read LSR.
>
> Doron, it’s for motherboard UART, so I will replace the driver for
> just one serial port, as you suggested me.
>
> Thanks again for your help, I’ll tell you when I get it work.
>
>
> En/na Loren Wilton ha escrit:
>
>
>>>> Elena, the OP, just wanted to read the LINE STATUS REGISTER on the
>
>
> UART.
>
>>> Since I’m pretty sure that you can get these values with one of the
>
>
> user
>
>>
>> Duh, never mind! I was thinking of the MSR not the LSR.
>> There is indeed no function to read the LSR.
>>
>> Loren
>>
>>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>