This was indirectly inspired by a post by Tadeusz Pycio a while back and in the meantime the two of us have independently created compatible boards based upon the chip. Mine uses the PLCC version and brings out all the output and input lines, but doesn't use the extended RC80 bus so the second port isn't brought out to the bus (and CLK2 isn't used for anything).
There are so many new developments I can't keep up. I really should update my "modules" spreadsheet but I've got behind the curve and now it is harder to do.
Are any of these designed going to be offered as kits?
Can you post details of I/O address options, suggested default address, and number of I/O addresses occupied.
Are any of these designed going to be offered as kits?In the current situation I do not plan to sell, so I shared Gerber files so that anyone interested could build them themselves.
Can you post details of I/O address options, suggested default address, and number of I/O addresses occupied.I/O addresses: 0x00-0F, 0x20-2F, 0x40-4F, 0x60-6F, 0x80-8F, 0xA0-AF, 0xC0-CF, 0xE0-EF. By default, I use the address 0x60, so that there is no conflict with the existing one on the SIO @ 0x80 bus, but the choice is any of the available ones.
Should we standardize on one of the common ranges like 0xA0-0xAF
Right now it detects the presence of a DUART. It should also determine its type, but the INITDEV routine assumes it's working with an XR88C681 because the baud rate tables can be set per-channel there. (Support for chips with MR0 will require more thought as we either need to limit baud rates to those in a single table, or do something like the NetBSD scn driver and switch tables if possible.) It also assumes the input clock is 3.6864MHz (i.e. rates will be doubled if running at 7.3728MHz).
A bug that took a while to track down wasn't in my driver per se: the DUART wouldn't work after booting, but was fine after running mode.com. It was as if INITDEV wasn't being called at first. Turns out I had DUART listed first in RomWBW's tables of entry points; the card was being initialized just fine, but then the 16550 UART detection routine running immediately afterwards was stomping on the DUART's clock select register. I've "fixed" this by placing DUART after the 16550 UART in the init and pre-init tables. I expect this will cause similar weirdness on a 16550-type card (I don't have one to test at the moment). A proper solution is probably to have the DUART detection code do a non-destructive test for a 16550-type UART and bail out early. (I'm thinking a write to the counter/timer upper byte register, which should immediately return the value written on a DUART unless the counter/timer's already running at an insanely high speed, but is the read-only modem status register on a 16550.)
This is a preliminary RomWBW driver for the DUART boards by me / Tadeusz Pycio / Alan Cox: https://github.com/codorjan/RomWBW/tree/duartIt's based mostly on the existing UART driver, with bits of SIO in there too.
A bug that took a while to track down wasn't in my driver per se: the DUART wouldn't work after booting, but was fine after running mode.com. It was as if INITDEV wasn't being called at first. Turns out I had DUART listed first in RomWBW's tables of entry points; the card was being initialized just fine, but then the 16550 UART detection routine running immediately afterwards was stomping on the DUART's clock select register. I've "fixed" this by placing DUART after the 16550 UART in the init and pre-init tables. I expect this will cause similar weirdness on a 16550-type card (I don't have one to test at the moment). A proper solution is probably to have the DUART detection code do a non-destructive test for a 16550-type UART and bail out early. (I'm thinking a write to the counter/timer upper byte register, which should immediately return the value written on a DUART unless the counter/timer's already running at an insanely high speed, but is the read-only modem status register on a 16550.)
TL;DR this isn't really done yet but works well enough that I've been using it as the only serial device in my RC2014 since Sunday...
Are you OK if I incorporate your work into the official RomWBW?
If you are OK with me incorporating your work, could you let me know when you consider it generally done?
If you have an RTC it is easy enough to measure.
For Fuzix I check the chip type and go 3.68 or 7.372 accordingly.Alan
Looks like the RTC gets initialized before any of the serial I/O devices. The easiest way may be to measure the speed if the RTC exists, otherwise assume a '681 is running at 3.68 and a '92 at 7.37.
I've just committed some code to weed out 16x50-style UARTs before accidentally overwriting any of their registers. The only other thing is to properly setup the baud rate generator for 26C92-style DUARTs, so once that's done it should be good to go...
I've also improved the 16x50 rejection a bit since the original one was also rejecting the XR88C92! (Seems it only updates the counter registers when the counter is actually running? I had to add a counter/timer source which messes with MCR, but that gets saved and restored later.) I don't have a 16550 board (yet) so I've really only tested this with Alan Cox's RC2014 emulator (which emulates a 16450). As such I've made duart a separate configuration for the RCZ80 platform until someone with a 16550 (or 16650, or 16750) can make sure it doesn't try configuring it as a DUART. I'm also hoping someone could test the driver with non-Exar units.
@Wayne, at this point I don't see any reason why this couldn't be incorporated into your repository...
Hi Alan,You have to be careful when reading 0xFF, non-existent registers in the I/O space also return this result.
Great. Can you provide (or point me to) the the driver source file?
I've only used git for about a year now and Github for a couple of months, what's the usual procedure? Should I send a pull request?
I've only used git for about a year now and Github for a couple of months, what's the usual procedure? Should I send a pull request?