Serial Mouse programming

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
vitaly.chipounov@libertys

Serial Mouse programming

Post by vitaly.chipounov@libertys »

Hello

I've made some routines to use the serial port.
I've managed to use my modem on COM2 but failed
to init correctly the COM1 MS Mouse.

Here is my code for mouse init. Where is the
mistake ? I assume that the INT gate is correctly set
and that UART_init() works. All this stuff works
in PMODE.

//First I set 1200 bps - 1 stop bit - no parity
//and +12V - I put 4 in MCR
enable_irq(4);
UART_init(0x3F8, 0x60, comprotocol7bits + comprotocolSOUTTXD12V, 4);
//I enable the COM1 RX int
outportb(0x3F8 + 1, 1);
//Don't know why these 2 lines
inportb(cominitaddr+5);
inportb(cominitaddr+6);
//Set DTR
outportb(0x3F8+4, 7);

Thanks for explanation
Chris Giese

RE:Serial Mouse programming

Post by Chris Giese »

>On 2001-07-24 06:06:09, [email protected] wrote:
>Hello
>
>I've made some routines to use the serial port.
>I've managed to use my modem on COM2 but failed
>to init correctly the COM1 MS Mouse.

1. Do you enable IRQ 4 at the 8259
interrupt controller chip?

2. To get serial interrupts on my system,
I had to turn on the Out2 signal:
//Set DTR
//outportb(0x3F8+4, 7);
outportb(0x3F8+4, 0x0F);

3. If you have a 16c550 serial chip,
turn off the FIFO for the mouse:
outportb(0x3F8+2, 0);

4. Some mice send a string of PnP bytes
when they are powered -- you should
either read these or ignore them.
For information on serial PnP, get
PNPCOM.RTF from
http://www.microsoft.com/hwdev/respec/pnpspecs.htm
Post Reply