André's 8-bit Pages  Projects  Code  Resources  Tools  Forum
(by Google)

65816 board features

This page describes the features of the 65816 board, as well as the register settings in detail.

Please note that "system bus" refers to the 6502 bus connector.

This section describes the hardware features of the board that are available in the form of jumpers, and only selected ones. For a more detailled hardware description see the hardware page.

Jumpers and Connectors

The board has a number of jumpers and connectors. The most important one is shown here:

  • JP1: BOOTROM - when set to on, the on-board ROM is mapped into the lowest 64k address space upon reset, so the board can take the system over on power-up
This section describes the software-side features of the board. These features are implemented as part of the CPLD logic.

Control Register

The CPLD implements a control register at the address $ExyF, where "xy" is determined by the jumper settings JP7/8/9. Unfortunately this register currently is write-only. Here is a description of the control register bits:

BitValueNameDescriptionInit valueNotes
7128PRGROMWhen set, allows write access to the built-in ROM. Note that specific algorithms are required to do the programming, random access does not work0
664BOOTROMWhen set, the lowest 64k CPU address space are mapped to the built-in ROM (except video and I/O, see above)Bootrom jumperNote this allows to unmap the system ROM after boot by setting this bit to 0. Only the initial value is taken from the Bootrom jumper.
532SLOW64KWhen set, the lowest 64k CPU address space are mapped to the system bus (6502 connector)1
416SLOWCLKWhen set, use the system clock even on fast memory1
38HIDEBOGUSWhen set, hide the CPU's bogus cycles - as indicated by VPA and VDA both 0 - from the system bus when possible.
24FASTVREADWhen set, read the video RAM area from the fast RAM (writes still go to the slow system RAM)
1,02,1WPROTECTWrite protect upper parts of the lowest 64k of FastRAM
ValueProtected Area
00None
01$A000-$FFFF
10$C000-$FFFF
11$E000-$FFFF
00

Memory Map

This section describes the memory map of the system. As there are some jumper settings that influence the memory map, it is best shown in a table.

Memory areaRangeno BOOTROM, no SLOW64kBOOTROM, no SLOW64kno BOOTROM, SLOW64kNotes
$000000-$007fff32kFastRAMBootROMsystem busWrites always also go to FastRAM (write through)
$008000-$0087ff2ksystem bus (video memory) $8000-$87ffNote: If the FASTVREAD control register bit is set, only writes go to the system bus (and write through to FastRAM), but reads only go to FastRAM.
$008800-$00e7ff24kFastRAMBootROMsystem busWrites always also go to FastRAM (write through)
$00e800-$00efff2ksystem bus (io) $e800-$efffWrites always also go to FastRAM (write through)
$00f000-$00ffff4kFastRAMBootROMsystem busWrites always also go to FastRAM (write through)
$010000-$0fffff960k (2*512k-64k)FastRAM
$100000-$dfffff---
$e00000-$efffff1024ksystem bus (mirror)
$f00000-$f7ffff512kFastRAM mirror from $000000-$07ffff
$f80000-$ffffff512kROM

Some things should probably be explained:

There is a FastRAM mirror in $f00000. This is used to copy the slow system bus memory to FastRAM. Normally the FastRAM is written through when the system bus is written to. But when copying the ROM from the 8296 to the FastRAM by copying the ROM in-place, the system hang: the 8296 has a write-only register at $fff0, writing the value read from the ROM there hangs the system. So to be sure you have to write to an unmirrored FastRAM - the mirror at $f00000.

The system bus mirror is there to access the slow system bus even when the lowest 64k are running in FastRAM. I made the mirror 16 times the 64k system bus, for a total of 1MByte, to stay "compatible" with my CS/A65 65816 CPU card. This may also be good for future expansions.

Speed Map

Although there is a dedicated "fast" and a dedicated "slow" bus (65816 vs. system bus), the CPU speed does not completely align with these borders. There are two types of access, "slow" and "fast". Slow is always synchronized with the system bus PHI2 clock. Fast accesses are independent from the system bus clock and the actual speed is determined by the clock register.

If the system bus accessed, of course the CPU is slowed down and synchronized with the slow system bus PHI2 clock, to perform the access. But also the ROM is accessed with the slow access method - so ordinary PROMs can be used.

The CPLD's control and clock registers are accessed from the CPU's fast bus, but the access is actually done slow, as the I/O address comparator is connected to the slow bus.

All that changes when SLOWCLK is set in the control register. Then all accesses, even to FastRAM, no matter what address are slow. This way you can easily use code that requires to runs at exactly the same clock than the original system.

Clock register

The CPLD not only implements a control register, but also a clock register at the address $ExyE, where "xy" is determined by the jumper settings JP7/8/9. Unfortunately also this register currently is write-only.

This clock register determines the speed of the actual fast accesses. Speed is determined by the lowest 5 bit, that work as a counter latch. In general the speed can be determined by calculating:

	FClk = 50MHz / (clklatch + 1)
	
where clklatch is the value of the lowest 5 bits in the control register. Here is a small comparison between register values and clock speeds (for the 50MHz oscillator used) for some latch values:

latch valueclock speed (MHz) 
153.1Default
95
58.3
410

Please note that you should not make the fast clock slower than the system clock, otherwise the system will hang!

Additionally the clock register contains the "fastmode" bit in bit 7. This bit is set by default. Its working is a bit difficult to explain. The board detects whether the next access is slow at a fixed point after system bus PHI2 going low. If fastmode is set, this detection is done very quickly, so that at most one fast half cycle fits before the detection. This means that the system clock can be up to 2MHz without loss of speed. But it also means that bogus cycles cannot be hidden. If fastmode is not set, the detection is done later, so that one and a half cycle fit in from PHI2 going low to this detection. This allows to hide bogus cycles within PHI1 of the system bus - but system clock can only be 1MHz, or the system will slow down (you can read more about it in the How it works page). Just remember that fastmode should be set on a 2MHz host system bus, and not on a 1MHz bus.


Return to Homepage

Last modified: 2014-08-11
follow

Follow my 8-bit tweets on Mastodon (In new window) or Bluesky

discuss

Discuss my site on this 6502.org forum thread

Discuss this page's content on this 6502.org forum thread

(Forum registration required to post)

hot!

Dive into the retro feeling and build yourself a Micro-PET or a Multi-board Commodore 4032 replica

Need more speed? Speed up your 6502 computer with this 10 MHz 6502 CPU accelerator board

Interested in electronics design? Look at the design lesson I got from Bil Herd, the hardware designer of the C128

Want 64bit? - pimp the 6502 with the 65k processor design!