I've been working on the initial BIOS version to get my new Pocket SBC running for a bit now and I do have it functioning quite well. Here's a link to the hardware project:
viewtopic.php?f=4&t=4988 I've found some odd operation of the SCC2691 for initialization and operation. For initializing the chip, it's a more complicated set of instructions versus something as trivial as the 65C51. I initially got it to work by simply doing load and store operations, i.e., LDA #$value, STA UART_REGISTER. After getting the configuration and sequence sorted, I decided to put it into an indexed load/store with two tables; one that holds the register offset and the other that holds the register data. As the NXP UARTS use a set of Mode Registers at the same physical address, you issue a command to reset the Mode register pointer, then store the desired value for MR1 followed by MR2. For some odd reason, this method doesn't work. The first Mode register gets loaded with all bit active ($FF) while the second Mode register gets loaded with the correct value. I've tried this multiple ways and in every case, if I used a load/store that is indexed addressing (W65C02) the first Mode register never gets loaded correctly.
I'm currently using two routines to get the UART functioning; The first is a simple set of commands that set power down mode as inactive (ensure the chip is in power up mode) followed by a sequence of commands that clear the Break Change Interrupt, Disable the Receiver, Disable the Transmitter, Clear all errors. The second routine uses an indexed set of tables to set up the various registers for operating mode, i.e., baud rate, interrupt masks, counter/timer preload values, etc. The last part of this routine does the load/store of the Mode registers. I also use the same table of reset commands for handling the Receive Break function of the UART with one extra command to enable the receiver. The odd part is I have to issues a Power On mode command again with the indexed list (this was done in the first Reset routine) otherwise the UART never works. It's not clear why I need to issue the Power Up command again with the second routine, but it won't work without doing it.
Once the chip is working, it's basically flawless in receive and transmit along with handling the received break function. I use this in the Monitor/BIOS to break out from the Macro loop of the Monitor (allows a sequence of instructions to be executed in an endless loop). In fact, I'm quit happy with the results of both the new board and the new UART as a console. However, the NXP UARTs also have some caveats that need to be managed so you don't hose them up. There are a couple test modes that are invoked by simply doing a read to a register. One is for the baud rate and a second is a 1X/16X clock test. As one of the monitor functions displays memory addresses in hex and ASCII, if the routine is executed against the UART, it locks up the system. I've done some initial debug around this and it turns out there is no way to reset the chip via software, a physical hardware reset is required. I have a Panic routine invoked via a NMI trigger which save registers, pertinent pages and restores the vectors and I/O initialization (which runs to completion) but the UART won't start working again until a physical reset is done.
An earlier bit of code was not locking up, albeit the console display of the I/O page (UART addresses) was garbled up a bit. Unfortunately I can't seem to find the cause for the recent locking up on reading the registers. Also, reading the receive register will also increment the FIFO buffer which adds yet another issues to be dealt with. I'm not currently decided on how to manage the memory display in the Monitor code just yet, but I'm thinking of having an excluded address list that will return a bogus value for any accesses to those addresses.
In any case, using the SCC2691 is a bit of a challenge versus the 65C51 for something as simple as a console. Overall, I'm still glad that I made the switch (of UARTs) and the new SBC. It's been a good project so far and I'll likely have the initial BIOS and Monitor versions done shortly. It also gives me the base code and knowledge to move to the newer NXP UARTs with minor code changes. If anyone else has done some (65C02) coding around the SCC2691, I'd be interested to hear any experiences to compare with mine so far.