4 ms·
Does a serial port poll or interrupt? If it’s possible to interrupt on a serial port, are there existing examples of how to configure a mouse or keyboard to in
by rudolph9 6y ago
Does a serial port poll or interrupt?
If it’s possible to interrupt on a serial port, are there existing examples of how to configure a mouse or keyboard to interrupt over a serial port?
- simcop2387 6y agoIt can do both, but I believe you need hardware flow control working to get proper interrupt behavior for that. I don't think any mice actually did it that way back in the day.
- jacquesm 6y agoAll serial chips that I'm familiar with since the 8 bit days would do interrupts, the only time that I worked without is when we were just using GPIO pins to emulate serial ports.
- jacquesm 6y agoDepends on how you configure the chip. You don't actually need a chip, you can bit-bang serial just fine if you have accurate enough timing. Typically a serial port would contain a small buffer which would fill up, upon completion of the first byte an interrupt would be generated and you'd respond to that and read out the register freeing up room for more bytes to be received. Transmit the same but reversed, as soon as a byte had left the shifter in the chip it would generate an interrupt so you could re-use that space for more bytes to send. This works quite well. Hardware flow control can help in case the OS doesn't respond fast enough to the interrupts, so you don't lose characters.