Acorn Electron MODE 1 Contention: How Many CPU Cycles Per Line?
Why the Electron's 6502 stalls in MODES 0 to 3, what Acorn's manuals say about RAM timing, and what a new logic analyser capture of MODE 1 shows.
In MODE 1, an Acorn Electron running code from RAM gets 24 CPU clock cycles in each display line instead of 64. Acorn's Electron Service Manual explains why: in screen modes 0, 1, 2 and 3 the video circuit "uses all the available memory time slots during the display period", so the 6502 "is denied RAM access during 40 microseconds of each 64 microseconds of the 256 lines in 312", and it waits until the display part of the line is over. On 3 December 2026 hoglet, the developer of the ElectronFpga project, posted logic analyser measurements on StarDot that match those figures cycle for cycle, plus one extra stalled cycle that Acorn's documents never mention. This guide sets out what Acorn documented, what was measured and what is still a hypothesis.
Acorn's Service Manual: in MODES 0 to 3 the CPU is denied RAM for 40 of every 64 microseconds on 256 of the 312 lines. A program running from RAM therefore gets at most 24 one-microsecond RAM cycles per display line, and hoglet's 3 December capture counts exactly 24 in MODE 1.
Why does the Electron's CPU slow down in MODES 0 to 3?
Because the CPU and the video circuit share one small, narrow block of RAM. The Service Manual (Issue 2, section 5.1, page 7) says the Electron's RAM is four 64Kbit dynamic memory chips, 32K in all, and that "to read a byte from memory requires two accesses", since each chip holds two bits of every byte. The manual puts the RAM's bandwidth at 2MHz, and the ULA, the custom chip that "coordinates every function of the computer", hands it out:
- 2MHz for ROM accesses, which only the processor uses.
- 1MHz for RAM accesses, because "the processor and the video are competing for access to the RAM". In MODES 4, 5 and 6 "this is no problem since the screen only needs 1MHz access".
- Stopped in MODES 0 to 3 during the display period, when the screen takes every slot.
The Advanced User Guide for the Acorn Electron (Mark Holmes and Adrian Dickens, Adder Publishing for Acornsoft, 1984, section 15.3.2) gives the reason: twice as much data has to be read from RAM to produce the display in MODES 0 to 3 as in MODES 4 to 6. If the CPU tries to reach RAM during the displayed part of a line, the guide says, the ULA holds the CPU's clock high for up to 40µs, while ROM and peripheral accesses carry on "in the normal way".
How much RAM does each screen mode take, and what does the CPU get?
The mode list is from the Service Manual's specification (section 3.1, page 3); the access rule is from section 5.1.
Mode | Display (Acorn's figures) | Screen RAM | CPU access to RAM while the screen is drawn |
|---|---|---|---|
0 | 640 x 256, two colours, 80 x 32 text | 20K | Stopped for up to 40µs of each 64µs line |
1 | 320 x 256, four colours, 40 x 32 text | 20K | Stopped for up to 40µs of each 64µs line |
2 | 160 x 256, sixteen colours, 20 x 32 text | 20K | Stopped for up to 40µs of each 64µs line |
3 | 80 x 25 text, two colours | 16K | Stopped for up to 40µs of each 64µs line |
4 | 320 x 256, two colours, 40 x 32 text | 10K | 1MHz, shared with the video |
5 | 160 x 256, four colours, 20 x 32 text | 10K | 1MHz, shared with the video |
6 | 40 x 25 text, two colours | 8K | 1MHz, shared with the video |
ROM accesses run at 2MHz in every mode. The same manual's fault finding pages (section 8.3 and 8.4, page 11) tell engineers to expect exactly this on the clock pin: varying between 1MHz and 2MHz in MODES 4 to 6, and "no clock output at all for some of the time" in MODES 0 to 3. One gap: Acorn gives the 40 of 64µs, 256 of 312 lines figure for all four modes, and does not say how the blank lines between MODE 3's text rows behave.
How many CPU cycles does a MODE 1 line give you?
On Acorn's figures, 24 for code in RAM: a 64µs line minus 40µs of video leaves 24µs, and RAM cycles are 1µs each. hoglet measured it on a real Electron with an HP 16702B logic analyser sampling both edges of the 16MHz clock, 32 samples per microsecond, while the 6502 ran a tight loop from RAM at &2002 to &2004 with interrupts disabled. His per line counts of the CPU clock (Phi0) show:
- 64 cycles on every line outside the display.
- 24 cycles on each of the 256 display lines. In his memory trace, 23 of them are normal 1µs cycles and one is stretched to about 41µs while the ULA reads 80 bytes of screen data, which is one MODE 1 line (20K over 256 lines).
- 63 cycles, not 64, on the line just before the first display line.
Over a whole field that is roughly 9,700 RAM cycles in MODE 1 against about 20,000 in MODE 4, again for code running from RAM. Code in ROM is not held up.
What is the extra stall before the first display line?
It is a single CPU cycle stretched from 1µs to 2µs on the last line before the picture starts, and nobody has explained it yet. hoglet's drill down shows the ULA reading video addresses &43F0 and &4400 during that cycle, data that is never displayed; he writes that it's "just where the address counter seems to have got to in the retrace period". He sees it on both Ferranti and Synertek ULAs, chips from two different makers. His conclusion: the stall serves no useful purpose, "but it is actually there and should be modeled in emulators". He also asked whether anyone else had seen it. There were no replies at the time of writing, on the evening of 3 December.
Why does this matter for scrolling and other timed effects?
Because cycle counted code only works if every stall lands where the programmer expects. The Electron has no hardware fine scroll and no raster interrupt, as Eben Upton notes in his elkgame project, a MODE 1 and MODE 2 scroll engine posted to StarDot on 22 November 2026. It scrolls a 56 character by 170 line window at 50 frames a second by writing to the ULA at exact moments: the screen mode changes partway through every scanline of the window. A stall that ends one microsecond early or late moves the picture by a character.
Two techniques from his project notes follow directly from Acorn's rules. A RAM read during the display stalls until the line's video fetch ends, which gives code a known point in the line to lock to. And because ROM area accesses are never stalled, the engine runs from a bank of sideways RAM, which the notes, citing an earlier hoglet post, report running at 2MHz, with interrupts off.
Why did the demo need a different timing on the FPGA Electron?
Nobody knows yet; this is the open question in the thread. elkgame ships two "lead in" schedules, one for real ULAs (the default) and one for the ElectronFpga ULA and designs that share its timing, which differ by half a microsecond in when the ULA's address counter steps in a 40 column mode. On 23 November hoglet confirmed that even his reworked development ULA, now running on a single clock and limited to the original interlaced PAL timing, still needs the FPGA schedule, and called that "clearly a bug".
These are the explanations on the table, and none is proven:
- The address counter phase (Eben Upton's best guess). The real ULA steps its 40 column address in the first half of each microsecond and the FPGA in the second half. His probe programs support it, but only on a Ferranti ULA in an issue 6 Electron; Synertek is unmeasured.
- The stall length (the alternative in the same summary). The real stall ends 1µs earlier, so the FPGA's contention runs too long. His summary says the probes "can't tell these apart".
- Contention in the wrong cycles (hoglet's suspicion, 23 November). The FPGA's simulated contention may not happen in the correct cycles and may end too late. His 3 December capture was the first step in measuring that.
Whether the extra stall before the first line plays any part has not been said by anyone in the thread. Upton's summary also reports two smaller differences seen on real chips: a write to the ULA's registers during the display takes a video slot, and mode value 7 wraps the screen differently on Ferranti and Synertek ULAs. Those are his measurements, not Acorn's documentation.
What do the measurements say about field timing?
They fit Acorn's description: the Service Manual specifies a 625 line, 50Hz interlaced PAL television output. In the earlier part of the same StarDot thread, in May 2025, 0xC0DE, the author of the Electroniq emulator, checked his timing model against hoglet's captures and settled on an odd field of 312 lines (39,936 cycles at 2MHz) and an even field of 313 lines (40,064 cycles), with vsyncs exactly 40,000 cycles apart. Those are community measurements, consistent with Acorn's 312 line figure but not stated in Acorn's manuals.
Can the CPU ever beat the screen to RAM?
Yes, through NMI. The Service Manual says the ULA "uses the NMI input to determine whether the processor should have full 1MHz access to the RAM regardless of screen mode". The Advanced User Guide adds that an NMI makes the ULA release the 6502, "but inevitably creates snow on the screen".
More retro hardware on kuliz
If your Electron era kit includes cartridges with battery saves, our guide on backing up SNES saves before a battery swap covers the same careful order for old hardware.
FAQ
Why is the Acorn Electron so slow in MODE 1?
In MODES 0 to 3 the screen uses every RAM slot during the display, so the 6502 is stopped for up to 40µs of each 64µs line whenever it needs RAM, on 256 of the 312 lines.
Does the Electron's 6502 run at 2MHz or 1MHz?
Both, plus stopped. Acorn's Service Manual says 2MHz for ROM, 1MHz for RAM, and stopped during the display in MODES 0 to 3 when it wants RAM.
Is MODE 4 faster than MODE 1 on the Electron?
For code in RAM, yes. MODE 4 needs only half the video bandwidth, so the CPU keeps 1MHz RAM access throughout, while MODE 1 halts it during the display part of every line.
How many cycles per scanline does the Electron have?
A line lasts 64µs, so 64 CPU cycles at 1MHz. In MODES 0 to 3 a program in RAM gets 24 per display line, which is what hoglet measured in MODE 1.
Does code in sideways RAM avoid contention?
Accesses to the ROM area are not stalled, and Eben Upton's notes, citing an earlier hoglet post, report sideways RAM there running at 2MHz. Acorn's manuals only describe ROM.
Why does Electron software behave differently on an FPGA?
For this scroll demo the cause is not settled. The leading ideas are a half microsecond difference in when the ULA steps its address counter, or FPGA contention ending too late.











