Serial Mouse programming
Posted: Mon Jul 23, 2001 11:00 pm
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
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