-
Design flaws
01/20/2022 at 22:26 • 0 comments- The 65C51 UART has a bug, with no intention of fixing it.
It has no FIFO buffer, which is a problem with FTDI USB chips that send up to three bytes after the hardware handshake line tells them to stop. - The Flash ROM is a PLCC. Most hobbyist programmers have DIP ZIF sockets, and will need an adaptor to handle a PLCC chip. And an extractor tool to get it out of PLCC sockets.
- The ready signal (RDY) is not on the expansion bus.
I want to be able to slow down the CPU for chips that do not run at 14 MHz. RDY would need a flying wire. - Flash ROM highest address bit is pulled high, and switched by Terbium software.
I want to be able to replace the Terbium software with my own ROM code, without having to go through Terbium. - The sockets are surface mount. This makes it much harder to modify, which I want to do for the previous points.
To attach wires to the circuit, one may have to take chips out of sockets to fine solder wires to the socket pads.
- The 65C51 UART has a bug, with no intention of fixing it.
-
BBC BASIC
11/14/2021 at 18:05 • 0 commentsI feel it would be easier to let them stay there and modify BBC BASIC to set the RAMTOP variable slightly lower.
The BBC Micro has the 16K BASIC ROM at 8000 hex and the 16K MOS at C000. This conflicts with the Terbium IDE which sits in the first 1.3K at 8000.
The Acorn Atom's BBC BASIC board for the Acorn Atom moves the I/O space from B000 to 7000 hex, out the way of the Terbium IDE hardware. The firmware might be a good starting point, because it omits most of the BBC Micro peripherals (which the WD65C02SXB doesn't have either). The firmware has routines to drive 256x192 graphics, provided by the 6847 chip. This would be much easier to implement than BBC Micro compatible graphics.
The BBC Micro 6502 second processor used just a 2K for the MOS and I/O, allowing BBC BASIC to be relocated at B800.
This allows the Flash ROM to contain BBC BASIC, and 2K for OS ROM and I/O starting at F800.
So the job is to write a small OS that just implements console I/O. This could be through the 65C51 serial chip (which has a handshaking flag bug), or the USB module (the IDE would have to disconnect), or the 65C22 VIA (maybe talking to another USB module).
I have had a look at J.G. Harston's latest code for the Acorn Atom BBC BASIC conversion board MOS. He has spotted many errors. I have edited it to assemble online at asm80.com, and have tried to make the labels more informative. Although still 4K, it has code for driving the 6522, 8255 and 6847.
J.G. Harston's has code for a tiny 6502 Tube Client in 512 bytes. Implements OSWRCH and OSRDCH via a single I/O port:
https://mdfs.net/Software/Tube/6502/Mini65.bas
It is in BBC BASIC's unconventional assembler. I don't have a BBC micro so I started converting it to a more conventional assembler syntax.
I wondered if the Terbium IDE and BBC BASIC could co-exist. Terbium uses the first four bytes of page zero, but so does BBC BASIC:
00-01 LOMEM (LO-HI) pointer to start of BASIC variables 02-03 VARTOP (LO-HI) pointer to end of BASIC variables
BBC BASIC does have some spare page-zero bytes but that would require modding the IDE code. Or BBC BASIC. This might disrupt either environment.
I feel it might be best that the reset routine reads a switch on an input port, then runs either Terbium IDE or BBC BASIC.
2021-11-25
When developing 6502 software, you will probably want to change the reset and interrupt vectors at the end of the memory map. With TIDE, it isn't possible. You can tell tide to switch in a new 32K bank of ROM but then TIDE software is switched out. Pulling out the USB cable cuts the power and when plugged in again the board will reset to the TIDE software.
A way round this may be to start in TIDE, use TIDE to switch in the new ROM, then close TIDE to release the USB connection for a terminal emulator.
It would be a nuisance doing it every time, but this is just a development project to demonstrate the code works. I thought of hacking the PCB but the tracks are very fine and the PLCC sockets are surface mounted! There is no way to tack vero wire to socket pins! I don't think this board was built with enough thought.
For now, I'll just accept having to change the Flash ROM by unplugging, reprogramming, and replugging it.
-
Memory Map
11/14/2021 at 17:18 • 0 comments0000 RAM in first 32K less final 256 bytes
7exx Terbium workspace RAM
7fxx I/O space:
XBUS_CS0; ADDR $7F00; SIZE 32
XBUS_CS1 ADDR $7F20; SIZE 32
XBUS_CS2 ADDR $7F40; SIZE 32
XBUS_CS3 ADDR $7F60; SIZE 32
USER_ACIA ADDR $7F80; SIZE 4
USER_PIA ADDR $7FA0; SIZE 32
USER_VIA ADDR $7FC0; SIZE 32
SYSTEM_VIA ADDR $7FE0; SIZE 328000 Start of 32K Flash ROM, start of Terbium IDE.
853B End of Terbium IDE (in the particular ROM disassembled)ABORT ADDR $FFF8; SIZE 2
NMI ADDR $FFFA; SIZE 2
RESET ADDR $FFFC; SIZE 2
IRQ ADDR $FFFE; SIZE 2Like the BBC Micro, it uses the first 32K for RAM and the last 32K for ROM.
The BBC Micro disables three 256-byte pages of ROM space for I/O devices.
The WD65C02SXB disabled one 256-byte page of RAM space for I/O devices.This decoding is done by U6,10,12,13 which are simple to modify logically but not physically, because they are surface-mount TSSOP. I can do it but would probably need to restore it in future. I would also have to mod the IDE software too.
It is possible to hold TIDE and BBC HiBASIC without overlap, but changing between the two requires reprogramming the hardware vectors in the last six byte of ROM.