Repository navigation
SAMx64 Timing
The board operates on a 14.31818MHz crystal clock signal, this is divided down to create the quadrature clock required by the MC6809e CPU.
To create the quadrature the raw clock is processed as blocks of 16 clock ticks. Each two ticks forms a phase of the Q and E clock signals at the fastest clock speed, four ticks forming a complete cycle. At double speed eight ticks are required for a full cycle. At single speed all sixteen ticks are required.
At single cpu and vdg clock speeds the original SAM would use the positive phase of the clock for the CPU and the negative phase for the VDG. Increasing the cpu clock speed would require the VDG clock to also increase which disrupts the data being loaded into the pixel clock shift register. The solution to this is to load data onto the VDG on every other cycle but latch the data so that it appears stable. Doubling the CPU clock speed again can follow the same principle without disrupting the video.
Part of the x4 design requires that the VDG also have the option to run at double speed so it is necessary to perform the same trick on the CPU as the VDG.
In addition to the VDG the SAMx4 itself requires a slice of time on the clock cycle to perform MMU operations, two slices out of the negative clock phase.
With the CPU running at 4x speed, the VDG at 2x speed and the time required for the MMU, all of the available clock cycles are used.
To ensure all devices can receive their required time slice on every set of clock ticks the data bus is operated at the full 4x speed at all times.
Quadrature Clock:
| Device | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| CPU 1xQ | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 |
| CPU 1xE | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 |
| CPU 2xQ | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 0 |
| CPU 2xE | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 1 |
| CPU 4xQ | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 0 |
| CPU 4xE | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 0 |
| VDG 1xQ | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 1 |
| VDG 1xE | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 |
| VDG 2xQ | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 1 |
| VDG 2xE | 0 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | 0 | 0 | 0 |
Data Bus Time Slice Allocation:
| Device | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| CPU Data | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 0 |
| VDG Data | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 |
| MMU Data | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 |
Data Latch:
| Device | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| CPU 1x | 0 | 0 | 0 | 0 | 0 | 0 | 0 | X | X | 1 | 1 | V | V | V | V | 0 |
| CPU 2x | V | 0 | 0 | 0 | 0 | 1 | 1 | V | V | 0 | 0 | 0 | 0 | 1 | 1 | V |
| CPU 4x | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 0 |
| VDG 1x | X | X | X | 1 | 1 | V | V | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | X |
| VDG 2x | 0 | X | X | 1 | 1 | 0 | 0 | 0 | 0 | X | X | 1 | 1 | 0 | 0 | 0 |
| MMU | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 |
X = data window open, latched data invalid
V = data window open, latched data valid
1 = data bus frame active, latch data
0 = data bus frame inactive
Data windows must end on a 1 or a V
The time required to write to RAM or retrieve data from RAM is restricted by the access time and the latency in the supporting logic. The guaranteed maximum access time has to be less than two raw clock cycles - approximately 140ns. If the maximum time is respected all 8 access slices can be used to perform the required tasks but the length of the slower clock cycles need to have the data access stretched to maintain stable data on the bus visible to the device. This is achieved by loading latches from the fast data bus and then outputting the data throughout the slower cycle.
Dragon Rev X4 and Rev X4 (ATX) Kitchen Sink Edition