Recent from talks
Nothing was collected or created yet.
WDC 65C02
View on WikipediaW65C02S microprocessor in a PDIP-40 package | |
| General information | |
|---|---|
| Launched | 1983 |
| Common manufacturer | |
| Performance | |
| Max. CPU clock rate | 1 MHz to 14 MHz |
| History | |
| Predecessor | MOS Technology 6502 |
The Western Design Center (WDC) 65C02 microprocessor is an enhanced CMOS version of the popular nMOS-based 8-bit MOS Technology 6502. It uses less power than the original 6502, fixes several problems, and adds new instructions and addressing modes. The power usage is on the order of 10 to 20 times less than the original 6502 running at the same speed;[1] its reduced power consumption has made it useful in portable computer roles and industrial microcontroller systems. The 65C02 has also been used in some home computers, as well as in embedded applications, including implanted medical devices.
Development of the WDC 65C02 began in 1981[a] with samples released in early 1983.[b] The 65C02 was officially released sometime shortly after.[2] WDC licensed the design to Synertek, NCR, GTE Microcircuits, and Rockwell Semiconductor. Rockwell's primary interest was in the embedded market and asked for several new commands to be added to aid in this role. These were later copied back into the baseline version, at which point WDC added two new commands of their own to create the W65C02. Sanyo later licensed the design as well, and Seiko Epson produced a further modified version as the HuC6280.
Early versions used 40-pin DIP packaging, and were available in 1, 2 and 4 MHz versions, matching the speeds of the original nMOS versions. Later versions were produced in PLCC and QFP packages, as well as PDIP, and with much higher clock speed ratings. The current version from WDC, the W65C02S-14 has a fully static core and officially runs at speeds up to 14 MHz when powered at 5 volts.
Introduction and features
[edit]The 65C02 is a low cost, general-purpose 8-bit microprocessor (8-bit registers and data bus) with a 16-bit program counter and address bus. The register set is small, with a single 8-bit accumulator (A), two 8-bit index registers (X and Y), an 8-bit status register (P), and a 16-bit program counter (PC). In addition to the single accumulator, the first 256 bytes of RAM, the "zero page" ($0000 to $00FF), allow faster access through addressing modes that use an 8-bit memory address instead of a 16-bit address. The stack lies in the next 256 bytes, page one ($0100 to $01FF), and cannot be moved or extended. The stack grows downward with the stack pointer (S or SP) starting at $01FF and decrementing with each byte that is pushed.[3] The 65C02 has a variable-length instruction set, varying between one and three bytes per instruction.[1]
The basic architecture of the 65C02 is identical to the original 6502, and may be considered a low-power implementation of that design. At 1 MHz, the most popular speed for the original 6502, the 65C02 requires only 20 mW, while the original uses 450 mW, a reduction of over twenty times.[4] The manually optimized core and low power use is intended to make the 65C02 well suited for low power system-on-chip (SoC) designs.[1]
A Verilog hardware description model is available for designing the W65C02S core into an application-specific integrated circuit (ASIC) or a field-programmable gate array (FPGA).[5] As is common in the semiconductor industry, WDC offers a development system, which includes a developer board, an in-circuit emulator (ICE) and a software development system.[6]
The W65C02S6T is the production version as of 2025[update], and is available in PDIP-40, PLCC-44 and QFP-44 packages. The maximum officially supported Ø2 (primary) clock speed is 14 MHz when operated at 5 volts, indicated by a –14 part number suffix (hobbyists have developed 65C02 homebrew systems that run significantly faster than the official rating). The "S" designation indicates that the part has a fully static core, a feature that supports stopping the Ø2 clock in either phase with no loss of state.[7] Typical microprocessors not implemented in CMOS have dynamic cores and will lose state (and thus crash) if they are not continuously clocked at a rate between some minimum and maximum specified values.
The "6T" designation indicates the process geometry (0.6µ) and that Taiwan Semiconductor Manufacturing Company (TSMC) is the foundry that produces WDC's wafers.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
General logic features
[edit]- 8-bit data bus.
- 16-bit address bus (providing an address space of 64 KB).
- 8-bit arithmetic logic unit (ALU).
- 8-bit processor registers:
- 16-bit program counter.
- 69 instructions, implemented by 212 operation codes.
- 16 addressing modes, including zero page addressing.

Logic features
[edit]- Vector pull (
VPB) output indicates when interrupt vectors are being addressed. - Memory lock (
MLB) output indicates to other bus masters when a read-modify-write instruction is being processed. - WAit-for-Interrupt (
WAI) and SToP (STP, stop-the-clock) instructions reduce power consumption, decrease interrupt latency and enable synchronization with external events.
Electrical features
[edit]- Supply voltage specified at 1.71 V to 5.25 V.
- Current consumption (core) of 0.15 and 1.5 mA per MHz at 1.89 V and 5.25 V respectively.
- Variable length instruction set, enabling code size optimization over fixed length instruction set processors, results in power savings.
- Fully static core allows stopping the clock to conserve power.
Clocking features
[edit]The W65C02S may be operated at any convenient supply voltage (VDD) between 1.8 and 5 volts (±5%). The data sheet AC characteristics table lists operational characteristics at 5 V at 14 MHz, 3.3 V or 3 V at 8 MHz, 2.5 V at 4 MHz, and 1.8 V at 2 MHz. This information may be an artifact of an earlier data sheet, as a graph indicates that typical devices are capable of operation at higher speeds than suggested by the AC characteristics table, and that reliable operation at 20 MHz should be readily attainable with VDD at 5 volts, assuming the supporting hardware will allow it.
The W65C02S support for arbitrary clock rates allows it to use a clock that runs at a rate ideal for some other part of the system, such as 13.5 MHz (digital SDTV luma sampling rate), 14.31818 MHz (NTSC colour carrier frequency × 4), 14.75 MHz (PAL square pixels), 14.7456 (serial bit rate crystal), etc., as long as VDD is sufficient to support the frequency. Designer Bill Mensch has pointed out that FMAX is affected by off-chip factors, such as the capacitive load on the microprocessor's pins. Minimizing load by using short signal tracks and fewest devices helps raise FMAX. The PLCC and QFP packages have less pin-to-pin capacitance than the PDIP package, and are more economical in the use of printed circuit board space.
WDC has reported that FPGA realizations of the W65C02S have been successfully operated at 200 MHz.[citation needed]
Comparison with the NMOS 6502
[edit]Basic architecture
[edit]Although the 65C02 can mostly be thought of as a low-power 6502, it also fixes several bugs found in the original and adds new instructions, addressing modes and features that can assist the programmer in writing smaller and faster-executing programs. It is estimated that the average 6502 assembly language program can be made 10 to 15 percent smaller on the 65C02 and see a similar improvement in performance, largely through avoided memory accesses through the use of fewer instructions to accomplish a given task.[1]
Undocumented instructions removed
[edit]The original 6502 has 56 instructions, which, when combined with different addressing modes, produce a total of 151 opcodes of the possible 256 8-bit opcode patterns. The remaining 105 unused opcodes are undefined, with the set of codes with low-order 4-bits with 3, 7, B or F left entirely unused, the code with low-order 2 having only a single opcode.[8]
On the 6502, some of these leftover codes actually perform computation. Due to the way the 6502's instruction decoder works, simply setting certain bits in the opcode causes parts of the instruction processing to take place. Some of these opcodes immediately crash the processor, while other perform useful functions and were even given unofficial assembler mnemonics by some programmers.[9]
The 65C02 adds new opcodes that use some of these previously undocumented instruction slots. For example, $FF is used for the new BBS instruction. Those which remain truly unused are equivalent to NOPs. 6502 programs using those opcodes will not work on the 65C02.[1]
Bug fixes
[edit]A flaw that is present in all NMOS variants of the 6502 involves the jump instruction when using indirect addressing. In this addressing mode, the target address of the JMP instruction is fetched from memory, the jump vector, rather than being an operand to the JMP instruction. For example, JMP ($1234) would fetch the value in memory locations $1234 (least significant byte) and $1235 (most significant byte) and load those values into the program counter, which would then cause the processor to continue execution at the address stored in the vector.
The flaw, which some consider a bug, appears when the vector address ends in $FF, which is the boundary of a memory page. In this case, JMP will fetch the most significant byte of the target address from $00 of the original page rather than $00 of the new page. Hence JMP ($12FF) would get the least significant byte of the target address at $12FF and the most significant byte of the target address from $1200 rather than $1300. The original 6502 documentation does not state that the address will cross pages in this fashion, so one cannot consider it to be a bug per-se. But many 6502 users perceived this complication to be a weakness, so it was eliminated in the 65C02 at the cost of spending another cycle to update the pointer.[1]
Another by-design weakness that was revised by popular demand, the state of the (D)ecimal flag in the NMOS 6502's status register is undefined after a reset or interrupt. This means programmers have to set the flag to a known value in order to avoid random errors caused by arithmetic operations performed in the mode other than the one intended, constituting software bugs. As a result, one finds a CLD instruction (CLear Decimal) in almost all 6502 interrupt handlers, as well as early in the reset code. The 65C02 automatically clears this flag after pushing the status register onto the stack in response any interrupt or in response to a hardware reset, thus placing the processor back into binary arithmetic mode.[10] This usually saves a few bytes in the software and eliminates the possibility of a common programming mistake, at the cost of increasing the size of code that runs in decimal mode as programmers have to remember to SED in places they previously assumed it would still be set.
During decimal mode arithmetic, the NMOS 6502 will put the (N)egative, o(V)erflow and (Z)ero flags into officially undefined states. Programmers found that the CPU updates these three flags to reflect the result of underlying binary arithmetic, that is, the flags reflect a result computed prior to the processor performing decimal correction. In contrast, the 65C02 sets these flags according to the result of decimal arithmetic, at the cost of an extra clock cycle per arithmetic instruction.[10] Some writers assert that the V flag on the 65C02 is still incorrect in decimal mode, but the flag may also be considered to be meaningless because decimal arithmetic is always unsigned.
When executing a read-modify-write (R-M-W) instruction, such as INC addr, all NMOS variants will do a double write on addr, first rewriting the current value found at addr and then writing the modified value. This behavior can result in difficult-to-resolve bugs if addr is a hardware register. This may occur if the hardware is watching for changes to the value in the register and then performs an action, in this case, it will perform two actions, one with the original value and then again with the new value. The 65C02 instead performs a double read of addr, followed by a single write.
When performing indexed addressing, if indexing crosses a page boundary all NMOS variants will read from an invalid address before accessing the correct address. As with a R-M-W instruction, this behavior can cause problems when accessing hardware registers via indexing. The 65C02 fixed this problem by performing a dummy read of the instruction opcode when indexing crosses a page boundary. However, this fix introduced a new bug[citation needed] that occurs when the base address is on an even page boundary (which means indexing will never cross into the next page). With the new bug, a dummy read is performed on the base address prior to indexing, such that LDA $1200,X will do a dummy read on $1200 prior to the value of X being added to $1200. Again, if indexing on hardware register addresses, this bug can result in undefined behavior.
If an NMOS 6502 is fetching a BRK (software interrupt) opcode at the same time a hardware interrupt occurs, the BRK will be ignored as the processor reacts to the hardware interrupt. The 65C02 correctly handles this situation by servicing the interrupt and then executing BRK.
New addressing modes
[edit]The 6502 has two indirect addressing modes which dereference through 16-bit addresses stored in page zero:
- Indexed indirect e.g.
LDA ($10,X). Adds the X register to the given page zero address before reading the 16-bit vector. In this example, if X is 5 then the 16-bit address is read from locations $15/$16. This is useful when there is an array of pointers in page zero. - Indirect indexed e.g.
LDA ($10),Y. Adds the Y register to the 16-bit vector read from the given page zero address. In this example, if Y is 5 and locations $10/$11 contain the vector $1000 then the read address will be $1005. This performs pointer-offset addressing.
A downside of this model is that if indexing is not needed but the address is in the zero page, one of the index registers must still be set to zero and used in one of these instructions. Therefore the 65C02 adds a non-indexed indirect addressing mode, e.g. LDA ($10), to all instructions that can use indexed indirect and indirect indexed modes. This leaves the index registers free for other uses.[11]
The 6502's JMP instruction has a unique (among 6502 instructions) addressing mode known as "absolute indirect" that reads a 16-bit value from a given memory address and then jumps to the address in that 16-bit value. For instance, if memory location $A000 holds $34 and $A001 holds $12, JMP ($A000) will read those two bytes, construct the value $1234, and then jump to that location.
One common use for indirect addressing is to build branch tables, a list of entry points for subroutines that can be accessed using an index. For instance, a device driver might list the entry points for OPEN, CLOSE, READ, etc in a table at $A000. READ is the third entry, zero indexed, and each address requires 16-bits, so to call READ one would use something similar to JMP ($A004). If the driver is updated and the subroutine code moves in memory, any existing code will still work as long as the table of pointers remains at $A000.
The 65C02 adds the new "indexed absolute indirect" mode which eases the use of branch tables. This mode adds the value of the X register to the absolute address and takes the 16-bit address from the resulting location. For instance, to access the READ function from the table above, one stores 4 in X, then executes JMP ($A000,X). This style of access makes accessing branch tables simpler as a single base address is used in conjunction with an 8-bit offset.[11] The same can be achieved in the NMOS version using indexed indirect mode, but only if the table is in the zero page, a limited resource. Allowing these tables to be constructed outside zero page not only lessens the demand for this resource but also allows the tables to be placed in ROM.
New and modified instructions
[edit]In addition to the new addressing modes, the "base model" 65C02 also adds a set of new instructions.[12]
INCandDECwith no parameters now increment or decrement the accumulator. This was an odd oversight in the original instruction set, which only includedINX/DEX,INY/DEY, andINC addr/DEC addr. Some assemblers use the alternate formsINA/DEAorINC A/DEC A.[12]STZ addr, STore Zero in addr, replaces the need toLDA #0;STA addrand doesn't require changing the value of the accumulator. As this task is common in most programs, usingSTZcan reduce code size, both by eliminating theLDAas well as any code needed to save the value of the accumulator, typically aPHAPLApair.[13]PHX,PLX,PHY,PLYpush and pull the X and Y registers to and from the stack. Previously, only the accumulator and status register (P) had push and pull instructions. X and Y could be stacked only by moving them to the accumulator first withTXAorTYA, thereby changing the accumulator contents, then usingPHA.[14]BRA, branch always, operates like aJMPbut uses a 1-byte relative address like other branches (which all are conditional), saving a byte. The speed is often the same as the 3 cycle absoluteJMPunless a page is crossed which would make theBRAversion 1 cycle longer (4 cycles).[15] As the address is relative, it is also useful when writing relocatable code.[13]
Bit manipulation instructions
[edit]Both WDC and Rockwell contributed improvements to the bit testing and manipulation functions in the 65C02. WDC added new addressing modes to the BIT instruction that was present in the 6502, as well two new instructions for convenient manipulation of bit fields, a common activity in device drivers.
BIT in the 65C02 adds immediate mode, zero page indexed by X and absolute indexed by X addressing.[12] Immediate mode addressing is particularly convenient in that it is completely non-destructive. For example:
LDA $1234BIT #%00010000
may be used in place of:
LDA $1234AND #%00010000
The AND operation changes the value in the accumulator, so the original value loaded from $1234 is lost. Using BIT leaves the value in the accumulator unchanged, so subsequent code can make additional tests against the original value, avoiding having to re-load the value from memory.
In addition to the enhancements of the BIT instruction, WDC added two instructions designed to conveniently manipulate bit fields:
TSB addrandTRB addr, Test and Set Bits and Test and Reset Bits.
- A mask in the accumulator (
.A) is logically ANDed with memory at addr, which location may be zero page or absolute. The Z flag in the status register is conditioned according to the result of the logical AND—no other status register flags are affected. Furthermore, bits in addr are set (TSB) or cleared (TRB) according to the mask in.A. After the logical AND, TSB performs a logical OR of.Awith the memory byte and stores the result at addr, whereas TRB instead performs a logical AND ofNOT .Awith the memory byte and stores the result at addr. In both cases, the Z flag in the status register indicates the result of.A AND addrbefore the content of addr is changed. The other flags are not affected. TRB and TSB thus replace a sequence of instructions, essentially combining the BIT instruction with additional steps to save the computational changes, but without the additional steps affecting the flags, and without affecting the V flag as BIT does.[1]
Rockwell's changes added more bit manipulation instructions for any bit in zero page, to directly set or reset a bit with a 2-byte instruction, or to test and branch on a bit with a single 3-byte instruction. The new instructions were available from the start in Rockwell's R65C00 family,[16] but were not part of the original 65C02 specification and not found in versions made by WDC or its other licensees. These were later copied back into the baseline design, and were available in later WDC versions.
Rockwell-specific instructions are:
SMBbit# zpandRMBbit# zp. Set or Reset (clear) bit numberbit#in zero page byte zp.
- RMB and SMB are used to clear (RMB) or set (SMB) individual bits in a bit field, each replacing a sequence of three instructions. As RMB and SMB allow zero page addressing only, these instructions have limited usefulness and are primarily of value in systems in which device registers are present in zero page.[citation needed] The bit# component of the instruction is part of the opcode and is often written as part of the mnemonic, such as
SMB1 $12which sets bit 1 in zero-page address $12 (a/k/a address $0012). Some assemblers treat bit# as part of the instruction's operand, e.g.,SMB 1,$12, which has the advantage of allowing it to be replaced by a variable name or calculated number.[13]
BBSbit# zp,addrandBBRbit# zp,addr. Branch on Bit Set/Reset.
- The same zero-page addressing and limitations as RMB and SMB apply, but these instructions test, rather than assign, the selected bit of the zero page byte zp and then branch to addr if that bit is clear (BBR) or set (BBS). Also as with RMB and SMB above, the bit# component of the instruction is often written as part of the mnemonic, such as
BBS1 $12,addrwhich branches to the address label addr if bit 1 of the byte at zero-page address $12 is set. Again, some assemblers treat bit# as part of the instruction's operand, e.g.,BBS 1,$12,addr, with the advantage of allowing it to be replaced by a variable name or calculated number.[13]
Each of RMB, SMB, BBR, and BBS replaces a sequence of three instructions.[13]
Low-power modes
[edit]In addition to the new commands above, WDC also added the STP and WAI instructions for supporting low-power modes.
STP, STop the Processor, halts all processing until a hardware reset is issued. This can be used to put a system to "sleep" and then rapidly "wake" (reactivate) it with a reset.
WAIt has a similar effect, halting all processing, but this instruction resumes normal execution on the reception of an interrupt. Without this instruction, waiting for a hardware interrupt generally involves running a loop suspend the program until interrupt processing breaks out of the loop, sometimes known as "spinning". This means the processor runs during the entire process, using power while doing (almost) nothing, even when no interrupts are occurring. In the 65C02, interrupt code can be written by having a WAI followed immediately by a JSR or JMP to the handler. When the WAI is encountered, processing stops and the processor goes into low-power mode. When an interrupt is received, the processor immediately executes the JSR and handles the request.
This has the added advantage of slightly improving performance. In the spinning case, the interrupt might arrive in the middle of one of the loop's instructions, and to allow it to restart after returning from the handler, the processor spends three cycles to save its location. With WAI, the processor enters the low-power state in a known location where all instructions are guaranteed to be complete, so when the interrupt arrives it cannot possibly interrupt an instruction and the interrupt response can be immediate. Plus, since the program expects the interrupt, the processor can safely continue without spending time saving state; the program is responsible to perform any necessary state-saving before the WAI.
65SC02
[edit]Uses
[edit]Home computers
[edit]- Apple IIc portable by Apple Computer (NCR 1.023 MHz)[19]
- Enhanced Apple IIe by Apple Computer (1.023 MHz)
- BBC Master home/educational computer, by Acorn Computers Ltd (2 MHz 65SC12 plus optional 4 MHz 65C102 second processor)[20]
- Replica 1 by Briel Computers, a replica of the Apple I hobbyist computer (1 MHz)
- Laser 128 series clones of Apple II[21]
- KIM-1 Modern Replica of the MOS/CBM KIM-1 by Briel Computing
Video game consoles
[edit]- Atari Lynx handheld (65SC02 @ ~4 MHz)
- PC Engine aka TurboGrafx-16 (HuC6280 @ 7.16 MHz)[22]
- GameKing handhelds (6 MHz) by Timetop
- Watara Supervision handhelds (KS5360 (65SC02 core) @ 4 MHz)
Other products
[edit]- TurboMaster accelerator cartridge for the Commodore 64 home computer (65C02 @ 4.09 MHz)
- Tube-connected second processor for the Acorn BBC Micro home computer (65C02 @ 3 MHz)
- Many dedicated chess computers, e.g. Mephisto MMV, Novag Super Constellation, Fidelity Elite (4–20 MHz)
See also
[edit]- Interrupts in 65xx processors
- CSG 65CE02, a further enhanced version of the 65C02
Notes
[edit]- ^ Some sources, including prior versions of this article, claim 1978. This was the date that Bill Mensch, the primary designer, formed WDC. In a 1984 article, Mensch specifically states 1981 as the start date.
- ^ Wagner's June 1983 article mentions it being available for "several months". Given typical publication delays at that point, this may date it to as early as late 1982. Another source points to 1980, see talk page.
References
[edit]Citations
[edit]- ^ a b c d e f g Wagner 1983, p. 204.
- ^ "Softalk". Softalk Publishing. Vol. 3, no. 10. June 1983. p. 199. Retrieved 24 May 2022.
- ^ Koehn, Philipp (2 March 2018). "6502 Stack" (PDF).
- ^ Taylor & Watford 1984, p. 174.
- ^ "6502 CPU Projects in HDL (for FPGA)".
- ^ "W65C02DB Developer Board".
- ^ "W65C02S-14".
- ^ Parker, Neil. "The 6502/65C02/65C816 Instruction Set Decoded". Neil Parker's Apple II page.
- ^ Vardy, Adam (22 August 1995). "Extra Instructions Of The 65XX Series CPU".
- ^ a b "Differences between NMOS 6502 and CMOS 65c02". Retrieved 27 February 2018.
N, V, and Z flags were incorrect after decimal operation (but C was ok).
- ^ a b Clark, Bruce. "65C02 Opcodes".
- ^ a b c Wagner 1983, p. 200.
- ^ a b c d e Wagner 1983, p. 203.
- ^ Wagner 1983, pp. 200–201.
- ^ "W65C02S Datasheet" (PDF).
- ^ Wagner 1983, p. 199.
- ^ GTE Microcircuits Data Book. GTE Microcircuits. 1984. p. 1–3. Retrieved 2024-05-02.
- ^ Zaks, Rodnay (1983). Programming the 6502. Sybex. p. 348. ISBN 0895881357.
- ^ "8-The Apple IIc". Apple II History. 2010-06-23. Retrieved 2023-10-31.
- ^ "BBC Master Acorn Computer". www.old-computers.com. Retrieved 2023-10-31.
- ^ "LASER 128 / 128EX / 128EX2 Video Technology". www.old-computers.com. Retrieved 2023-10-31.
- ^ "HuC6280 - Archaic Pixels".
Bibliography
[edit]- Wagner, Robert (June 1983). "Assembly Lines". Softtalk. pp. 199–204.
- Taylor, Simon; Watford, Bob (July 1984). "6502 revival". Personal Computer World. pp. 174–175.
Further reading
[edit]- 65C02 Datasheet; Western Design Center; 32 pages; 2018.
- Programming the 65816 - including the 6502, 65C02, 65802; 1st Ed; David Eyes and Ron Lichty; Prentice Hall; 636 pages; 1986; ISBN 978-0893037895. (archive)
External links
[edit]- 65C02 webpage - Western Design Center
- 65xx/65Cxx/65SCxx Differences - CPU World
- 6502/65C02/65C816 Instruction Set Decoded – From Neil Parker's Apple II page
WDC 65C02
View on GrokipediaOverview
Introduction
The WDC 65C02 is an 8-bit CMOS enhancement of the original NMOS 6502 microprocessor, developed by the Western Design Center (WDC) in the early 1980s.[5] This fully static design maintains compatibility with the 6502 instruction set architecture while introducing improvements in reliability and efficiency, positioning it as a bridge between legacy NMOS technology and modern low-power computing needs.[5] Key capabilities include a 16-bit address bus supporting up to 64 KB of memory and an 8-bit data bus, with typical clock speeds ranging from 1 to 4 MHz and later versions capable of up to 14 MHz operation at 5 V.[5] These specifications enable efficient processing in resource-constrained environments, with power draw as low as 150 µA at 1 MHz and support for standby modes to further reduce consumption.[5] The 65C02's significance lies in its lower power requirements, which made it ideal for battery-powered devices, and its corrections to bugs in the original 6502, enhancing suitability for embedded applications such as consumer electronics and industrial controls.[5] Introduced in 1983, it continues in production as of 2025 for niche markets, with WDC maintaining availability in various packages like DIP and QFP.[5]Key Specifications
The WDC 65C02 is housed in a 40-pin dual in-line package (DIP), providing a standard interfacing footprint compatible with the original 6502 series. Key pins include VDD (positive supply) on pin 40 and VSS (ground) on pin 20; two-phase non-overlapping clocks with PHI1 (phase 1 input/output, also Vector Pull or VPB output) on pin 1 and PHI2 (phase 2 input) on pin 37; read/write control (R/W) on pin 34; interrupt request (IRQ) on pin 4; non-maskable interrupt (NMI) on pin 7; ready (RDY) on pin 2; bus enable (BE) on pin 35 for tri-stating address and data buses during DMA or power saving; and a 16-bit address bus with lines A0 through A15 on pins 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, and 24, respectively. Data lines D0-D7 occupy pins 25-32. The VPB output on pin 1 indicates that a vector location is being addressed during an interrupt sequence, going low during the last interrupt cycle.[5] The processor operates over a supply voltage range of 1.71 V to 5.25 V, with specified options including 1.8 V ±5%, 3.3 V ±10%, and 5 V ±5%, ensuring compatibility with TTL logic levels while leveraging CMOS technology for lower power. Input/output pins are CMOS-compatible, with logic low levels (V_IL) recognized up to a maximum of 0.8 V and logic high levels (V_IH) required to be at least 2.0 V minimum.[5] Power consumption is optimized for CMOS, with core current draw of approximately 0.15 mA/MHz at 1.89 V (150 µA at 1 MHz) and 1.5 mA/MHz at 5.25 V (1.5 mA at 1 MHz) under normal operation. In stop mode, quiescent current is typically under 10 µA, enabling significant energy savings for battery-powered or low-duty-cycle applications.[5] Critical timing parameters, derived from the two-phase clock system, include a minimum cycle time of 70 ns at 14 MHz (5 V supply), with all state changes occurring on the falling edge of PHI2; brief external buffering may be required for high-capacitance loads.[5] Industrial-grade versions of the WDC 65C02 are rated for an operating temperature range of -40°C to +85°C (PLCC and QFP packages), suitable for harsh environments, while commercial variants cover 0°C to 70°C (DIP package).[5]History and Development
Origins from the 6502
The MOS Technology 6502 microprocessor, introduced in September 1975, served as the foundational design for the WDC 65C02. Developed by a team led by Chuck Peddle at MOS Technology, the 6502 was an 8-bit NMOS processor that became a cornerstone of early personal computing due to its low cost and simplicity. It powered iconic systems such as the Apple II (introduced in 1977), Atari 2600 video game console, and Commodore PET computer, among others. However, its NMOS architecture suffered from relatively high static power consumption compared to emerging technologies, limiting its suitability for battery-powered or low-energy applications.[6][7][6] The transition to CMOS for the 65C02 was driven by key figures in the original 6502's development, particularly Bill Mensch, who had co-designed the 6502 while at MOS Technology. Mensch left MOS in 1977 amid corporate changes following Commodore's acquisition and founded The Western Design Center (WDC) in 1978 to pursue independent microprocessor innovation. Holding key patents from the 6502 family, Mensch initiated the CMOS redesign project in early 1981. CMOS was selected for its significantly lower static power dissipation—consuming power primarily during switching rather than continuously—and enhanced radiation hardness, making it ideal for reliable operation in harsh environments. These attributes addressed the NMOS 6502's power inefficiency, offering roughly an order of magnitude reduction in static power draw.[8][9][8][10] WDC's development of the 65C02 leveraged its intellectual property rights, with the design completed in 1981 and initial engineering samples released in early 1983, enabling testing in prototype systems. Full production ramped up later in 1983 through partnerships with foundries such as Synertek. WDC licensed the 65C02 to second sources like Rockwell (for the compatible R65C02 variant) and GTE for broader manufacturing. This timeline aligned with growing market demands in the early 1980s for portable computing devices, like early laptops, and embedded systems that required static CMOS operation for low-power, always-on functionality without constant clocking. The 65C02's design thus bridged the 6502's legacy with modern efficiency needs, powering devices such as the Apple IIc portable computer.[11][8][11][9][12]Design and Production by WDC
The design of the WDC 65C02 was led by Bill Mensch and his team at the Western Design Center (WDC), marking the company's first major project after its founding in 1978. This CMOS-based enhancement to the original NMOS 6502 addressed reliability issues by fixing several known bugs, such as the indirect JMP page boundary error and decimal mode flag inconsistencies, while maintaining full backward compatibility. Additionally, it incorporated 14 new instructions—including bit manipulation operations like BBR and BBS, stack operations such as PHX and PLY, and control instructions like BRA and STP—and two new addressing modes, such as zero-page indirect and absolute indexed indirect, to improve code density and efficiency.[13][5] Initial production of the 65C02 utilized a 3 µm CMOS process, enabling lower power consumption compared to the NMOS predecessor, with fabrication handled through foundries as WDC operated as a fabless company. By the 1990s, WDC migrated to finer nodes, including 2 µm and later 1.2 µm processes, and current versions are produced on a 0.6 µm CMOS process at TSMC. As of 2025, the chip remains available in 40-pin PDIP, 44-pin PLCC, and 44-pin QFP packages, supporting applications requiring long-term availability.[14][11][5] WDC retains ownership of the 65C02 intellectual property, licensing it to second sources like Rockwell International, which produced the compatible R65C02 variant in the 1980s for use in telephony and embedded systems. A key production milestone was the 65C02's integration into the Apple IIc computer in 1984, where it provided enhanced performance and reduced power draw for portable computing. Although WDC shifted primary development focus to the 16-bit 65C816 processor in 1983 for broader applications like the Apple IIGS, the 65C02 has stayed in active production for legacy and specialized support.[15][16][8] In modern contexts, the 65C02 continues to be manufactured for demanding sectors including automotive controls, industrial automation, and medical devices, benefiting from its static CMOS design that allows operation from DC to 14 MHz and low quiescent current. WDC achieved lead-free RoHS compliance for the 65C02 lineup starting in 2006, aligning with global environmental standards while ensuring compatibility with existing systems through green packaging options.[1][17]Technical Features
Architectural Improvements
The WDC 65C02 introduces several architectural corrections to address reliability issues inherent in the original NMOS 6502, ensuring greater compatibility and predictable behavior in embedded and computing applications. These fixes primarily target glitches in decimal mode operation, index register handling, and interrupt processing, totaling seven major resolutions that eliminate indeterminate states and erroneous flag settings. For instance, in decimal mode, the 65C02 properly initializes the decimal flag (D=0) following reset and interrupts, preventing unintended BCD arithmetic in interrupt service routines—a flaw in the 6502 where the D flag remained unchanged. Similarly, arithmetic instructions like ADC and SBC now set the negative (N), overflow (V), and zero (Z) flags correctly after decimal operations, resolving cases where the 6502 produced invalid flags (e.g., Z flag incorrectly cleared after ADC #99 + #01 resulting in $00). Although the BIT instruction's flag behavior in decimal contexts was not directly altered, these enhancements collectively stabilize flag-dependent logic across ALU operations.[18][5] Index register overflow issues, particularly during page boundary crossings in indexed addressing modes, are also rectified in the 65C02. The original 6502 would fetch data from garbage addresses when an index addition caused a carry into the high byte of the address (e.g., in indexed indirect (zp,X) mode crossing xx00) instead of the next page (xxFF; the 65C02 handles this seamlessly. Overall, these seven fixes enhance robustness for real-time systems by preventing crashes from erratic memory access or flag misreads.[19][20] To promote deterministic execution, the 65C02 removes the unpredictable behaviors of the 6502's undocumented opcodes, treating all invalid instructions as benign NOPs that consume the appropriate cycles without side effects. This contrasts with the NMOS 6502, where such opcodes could trigger partial execution of unrelated instructions (e.g., NOP variants like $04 or $44 exhibiting JAM-like halts or register modifications), potentially causing system instability. By reserving these slots for future use or new valid instructions while ensuring no undefined results, the 65C02 simplifies software porting and debugging. The core register set—accumulator (A), index registers (X and Y), stack pointer (SP), and program counter (PC)—remains fully compatible with the 6502, but benefits from the decimal mode enhancements for accurate BCD processing in financial or display applications.[5][21] The shift to a static CMOS implementation marks a fundamental architectural upgrade, enabling the processor to halt or stop without a continuously running clock, unlike the dynamic NMOS 6502 that required constant refreshing to retain internal state and avoid data loss. This static design supports low-power modes by allowing the PHI2 clock to remain high or low indefinitely during idle periods, reducing dynamic power dissipation to as low as 150 µA at 1 MHz. The bus interface further improves efficiency with a fully bidirectional 8-bit data bus featuring three-state outputs for multiplexing with other devices, and the Bus Enable (BE) pin that tristates address, data, and R/W buffers when asserted low, facilitating power savings in multi-chip systems by isolating the processor from the bus. These features retain pin-for-pin compatibility with the 6502 while enhancing suitability for battery-powered and embedded designs.[5]Instruction Set Enhancements
The WDC 65C02 expands the instruction set of the original 6502 microprocessor by incorporating 14 new instructions, bringing the total to 70 distinct instructions and 212 valid opcodes out of 256 possible, compared to the 6502's 151 opcodes. These enhancements provide greater programming flexibility, particularly for bit-level operations and control flow, while maintaining full compatibility with existing 6502 code.[5] Among the new instructions are branch if bit reset (BBR), branch if bit set (BBS), reset memory bit (RMB), set memory bit (SMB), stop clock (STP), and wait for interrupt (WAI). The STP instruction (opcode CB) suspends execution until an interrupt occurs, preserving the processor state for efficient interrupt handling. These additions are particularly useful in embedded systems requiring power management.[5][21] The bit manipulation instructions introduce 32 new opcodes specifically for zero-page memory: RMB0–7 for resetting individual bits, SMB0–7 for setting them, BBR0–7 for conditional branching if a bit is reset, and BBS0–7 for branching if set. These allow direct manipulation and testing of single bits without requiring multiple shift or mask operations, significantly improving efficiency for tasks like flag handling or peripheral control. For example, RMB0 $20 clears bit 0 at zero-page address $20 in a single cycle.[5][21] Existing instructions are also modified for better functionality. The branch always (BRA) instruction is formally defined with relative addressing (opcode $80), providing a reliable unconditional short branch that was previously undocumented on the 6502. Additionally, the add with carry (ADC) and subtract with carry (SBC) instructions now correctly update the negative, overflow, and zero flags in decimal mode, resolving a limitation in the original design and enabling more accurate binary-coded decimal arithmetic.[5][21] Four new addressing modes further enhance memory access capabilities: zero-page indirect ((zp)), which loads an address from a zero-page location; absolute indexed indirect ((a,X)), for table-based jumps with indexing; stack relative (d,S), offsetting from the stack pointer; and stack relative indirect indexed ((d,S),Y), combining indirection with stack-relative and indexing. These modes support more compact and versatile code, especially for data structures and interrupt routines, without altering the core 6502 architecture.[21]Power and Electrical Characteristics
The W65C02S microprocessor, implemented in CMOS technology, incorporates several low-power modes to optimize energy efficiency, particularly in battery-operated or embedded applications. The STOP mode is entered via the STP instruction, which halts the internal clock by holding PHI2 low, reducing the supply current to standby levels of less than 1 µA while preserving the processor state.[5] The IDLE mode is activated by driving the bi-directional RDY pin low, suspending instruction execution without stopping the clock, enabling rapid resumption for interrupt handling or synchronization; this mode is often used in conjunction with the WAI instruction for wait-for-interrupt scenarios.[5] Additionally, asserting the BE pin low disables the address and data output buffers, placing them in a high-impedance state to minimize bus-related power draw and prevent conflicts in multi-processor systems.[5] Clocking follows a two-phase non-overlapping scheme, with PHI2 serving as the primary input clock (driven externally) and PHI1 provided as an inverted output for synchronizing peripherals. The fully static core supports operation from DC (halted) up to 14 MHz at 5 V, allowing the clock to be paused high or low in standby without data loss or increased power.[5] For reliable performance across this range, the datasheet recommends using a stable external oscillator or crystal circuit to drive PHI2, ensuring minimal jitter and compliance with the required 40% duty cycle and non-overlapping phases.[5] Power consumption metrics underscore the CMOS advantages over NMOS predecessors like the original 6502, which typically draws around 130 mA under load.[22] The W65C02S exhibits dynamic supply current (Idd) of 0.15 mA per MHz at 5 V (scaling down further at lower voltages such as 1.8 V), with static standby current below 1 µA across supply voltages from 1.71 V to 5.25 V.[5] This results in significantly lower overall power, proportional to clock frequency and activity, making it suitable for low-energy designs. Electrically, inputs are compatible with TTL logic levels, accepting high inputs at 70% of VDD (minimum 2.0 V at 5 V) and low inputs down to -0.3 V, while outputs deliver TTL-compatible voltages with a source current of 700 µA (high) and sink current of 1.6 mA (low), supporting a fanout of 20 LSTTL loads.[5] The device includes built-in protection against high static voltages for ESD robustness, exceeding typical human body model thresholds.[5] Thermal characteristics specify a maximum storage temperature of 150°C and an operating ambient range of -40°C to +85°C for PLCC and QFP packages (0°C to 70°C for DIP), with junction temperature limits aligned to standard CMOS ratings up to 150°C.[5] Power dissipation is computed via P = VDD × Idd; for instance, at 5 V and 2 MHz, it approximates 1.5 mW for the core, emphasizing the processor's efficiency in heat-sensitive applications.[5]Variants
65SC02
The 65SC02 is a static CMOS variant of the 65C02 microprocessor, introduced around 1982 by GTE Microcircuits as a low-power option optimized for battery-operated devices.[23] This fully static design retains data without requiring a continuous clock signal, enabling zero standby power consumption and making it suitable for intermittent operation in power-constrained environments.[23] Compared to the original NMOS 6502, the 65SC02 employs an enhanced instruction set with 27 additional opcodes encompassing eight new instructions, including bit manipulation and arithmetic operations, for improved performance while maintaining full compatibility with 6502 software.[23] It operates at a maximum clock speed of 4 MHz, with low power consumption (4 mA at 1 MHz) and quiescent current typical of static CMOS designs, supporting prolonged battery life.[23][24] The chip remains pin-compatible with the 65C02, allowing straightforward integration into existing 6502-based systems without hardware modifications.[23] Targeted applications included low-power embedded systems like digital watches and calculators, where its static operation minimized energy use during idle periods.[23] Note that while GTE's 65SC02 is enhanced similar to the WDC 65C02, other manufacturers' 65SC02 variants (e.g., later WDC versions) may omit certain instructions like bit manipulation for specific optimizations.[25] Production of the original 65SC02 ceased in the 1990s following GTE's exit from the semiconductor market, but its architecture is emulated in contemporary retro computing projects and supported through equivalent parts offered by Western Design Center (WDC).[1]Other Related Processors
The Rockwell R65C02, introduced in 1981, is a CMOS-enhanced variant of the 6502 microprocessor developed by Rockwell International, featuring additional instructions and addressing modes beyond the original 6502 while maintaining full software compatibility and the same 40-pin DIP package.[26] It includes enhancements such as support for zero-page bit tests and branches, making it suitable for low-power applications like the AIM 65/40 trainer kit.[26] The R65C02 operates at speeds up to 4 MHz and retains the 16-bit address bus of its predecessor, ensuring drop-in compatibility with 6502-based systems.[27] The WDC 65C816, released in 1984 by the Western Design Center (WDC), extends the 65C02 architecture to support both 8-bit and 16-bit operations, with an emulation mode that allows seamless execution of 65C02 code.[28] Designed by Bill Mensch, it introduces 16-bit registers, a 24-bit address bus in native mode for accessing up to 16 MB of memory, and new instructions for block transfers and arithmetic shifts, while preserving the 6502 pinout for compatibility in upgraded systems.[29] Available in speeds up to 14 MHz from WDC, the 65C816 powers devices like the Apple IIGS and enables hybrid 8/16-bit processing without requiring full system redesigns.[30] In the 2000s, WDC developed the W65C265S as a 16-bit microcontroller integrating a 65C816S core with 8 KB of ROM, 576 bytes of RAM, and peripherals including three UARTs for serial communication and USB support via external interfaces, targeted at embedded development and prototyping.[31] Housed in a 48-pin PQFP package, it operates at up to 20 MHz and emphasizes low-power CMOS technology for high-reliability applications, differing from pure CPUs by incorporating on-chip memory and I/O to simplify board-level designs.[32] These processors maintain backward compatibility with the 6502 family through shared instruction subsets and pinouts where applicable, allowing the 65C816 and R65C02 to serve as direct replacements in existing hardware.[28] In modern contexts, derivatives include FPGA-based soft cores such as the open-source 65C02 implementation by M. Joergen, which replicates the instruction set for synthesis on programmable logic devices, and licensed IP cores like the M65C02 from OpenCores for ASIC integration.[33] Projects like the 100 MHz pin-compatible 65C02 FPGA replacement further extend usability in retrocomputing and high-speed emulation environments.[34]Applications
Home Computers
The Apple IIc, released in 1984, marked the first use of the WDC 65C02 in an Apple computer, clocked at 1.023 MHz. This CMOS processor's lower power draw compared to the NMOS 6502 reduced heat output, allowing Apple to design a compact, fanless all-in-one system measuring just 11 by 12 inches—small enough to fit in a briefcase and enabling true portability with optional battery packs and LCD displays. The 65C02's 27 additional instructions optimized firmware efficiency, packing IIe-level features like 128 KB RAM, an integrated disk controller, 80-column display routines, and mouse port compatibility into the limited space, while supporting Macintosh-style mice for graphical interfaces. It was also used in Apple II clones like the Laser 128.[1] Subsequent revisions of the Apple IIe, starting with the Enhanced IIe in March 1985, incorporated the 65C02 at 1.023 MHz as a drop-in replacement for the 6502, along with updated ROMs and a new character generator. This upgrade added MouseText—a set of 40 special graphics characters for line drawing and symbols—improved lowercase entry, enhanced interrupt handling, and ensured compatibility with software relying on the processor's extended opcodes, all while maintaining low power for reliable operation in educational and home settings. The 1986 Apple IIc Plus further leveraged the 65C02 at 4 MHz, boosting performance for demanding applications without excessive heat, and included a switchable speed mode for backward compatibility. In the BBC Micro ecosystem, the 65C02 appeared in peripherals like the Solidisk Fourmeg expansion card, which plugged into the IC1 socket and featured a 4 MHz CMOS 65C02 CPU alongside 512 KB RAM and five ROM sockets. This setup provided shadow RAM, toolkit utilities for BASIC programming, and compatibility with BBC BASIC V, extending the host system's capabilities for memory-intensive tasks in educational environments without altering the core 6502-based architecture. The Rockwell AIM 65/40 served as an educational trainer kit in the early 1980s, built around the 6502 family of processors to teach assembly and system design through hands-on modules, including expandable memory up to 48 KB and a built-in thermal printer—its modular nature allowed for low-power CMOS upgrades in custom configurations. User-driven upgrades to the Ohio Scientific Challenger series, such as the 1P and 4P models, often replaced the original 1-2 MHz 6502 with the 65C02 for improved efficiency and instruction support, contributing to more reliable all-in-one designs in hobbyist and educational use. Overall, the 65C02's significantly reduced power consumption—as low as 150 µA at 1 MHz, compared to hundreds of mA for the 6502—facilitated fanless, portable home computers like the Apple IIc, while its architectural enhancements enabled faster execution of peripherals like mice and reduced thermal issues in compact systems.[2]Video Game Consoles
The WDC 65C02 and its variants found application in several video game consoles, particularly handhelds, where its CMOS design provided low power consumption suitable for battery-operated devices. This efficiency was crucial for extending playtime in portable systems, while the processor's enhanced instruction set, including bit manipulation operations, facilitated optimized graphics and sound routines common in gaming hardware.[35] One prominent example is the Atari Lynx, a 1989 handheld console that utilized the 65SC02, a CMOS variant of the 65C02 lacking certain bit instructions but retaining core compatibility and operating at approximately 4 MHz. Integrated into the custom "Mikey" chip alongside sound and I/O functions, the 65SC02 handled game logic and video driving, contributing to the Lynx's advanced features like color graphics on a battery-powered LCD display. Its low-power characteristics helped mitigate the console's high energy demands from the backlight and processing, though battery life remained a noted limitation in reviews.[36][37] The NEC PC Engine (known as TurboGrafx-16 in North America), released in 1987, employed the Hudson Soft HuC6280, an enhanced 65C02 derivative clocked at 7.16 MHz with added opcodes for timer interrupts, I/O ports, and block transfers to accelerate sprite and tile operations in games. This customization improved performance for the console's HuCard and CD-ROM formats, enabling complex visuals and audio in titles like Bonk's Adventure, where bit operations sped up graphics manipulation without additional hardware. The HuC6280's design emphasized gaming optimizations, such as direct memory access for sound channels, distinguishing it from general-purpose 65C02 uses.[38][39] In the early 2000s, the Chinese-made GameKing handheld series incorporated a standard 65C02 running at 6 MHz, paired with a simple monochrome LCD (48x32 pixels, 4 shades of gray) for low-cost, bootleg-style gaming. Released by Timetop in 2003, the original GameKing and its successors supported cartridge-based games with multi-channel sound, leveraging the 65C02's efficiency for portable play in titles mimicking classics like Space Invaders. The processor's bit manipulation instructions proved advantageous for handling sprite updates and collision detection in these resource-constrained devices.[40] In modern contexts, the 65C02 appears in homebrew retro consoles and FPGA-based systems like the MiSTer platform, where it is emulated or implemented in hardware for authentic reproduction of 1980s gaming experiences. Projects such as the open-source GameTank retroconsole use 65C02-compatible processors for custom game development, benefiting from the chip's availability and low power for DIY portable builds. Homebrew cartridges for original systems also exploit 65C02 enhancements to accelerate graphics routines in fan-made titles.[41]Embedded and Modern Systems
The W65C02 microprocessor finds continued application in embedded systems due to its low power consumption and fully static core design, which enable operation in battery-powered and space-constrained environments. In medical devices, it supports life-critical functions such as heart defibrillation and pacing systems, where its reliability protects millions of lives annually. Automotive and industrial controllers leverage the chip's 150 µA current draw at 1 MHz for efficient, real-time processing in electronic control units and automation equipment. These markets benefit from the processor's compatibility with legacy designs while meeting modern efficiency demands.[2] In contemporary embedded and retro computing contexts from 2020 to 2025, the W65C02 powers single-board computers tailored for education and prototyping. Western Design Center's W65C02SXB development board, featuring an 8 MHz W65C02S, 32 KB SRAM, and peripheral interfaces, serves as a foundational tool for learning assembly programming and microcontroller development. FPGA-based soft cores of the 65C02 enable high-performance implementations, such as a pin-compatible variant clocked at 100 MHz for accelerated retro simulations. Homebrew projects, including breadboard-based systems inspired by educational kits, demonstrate the chip's accessibility for hobbyist experimentation with custom peripherals and operating systems. Notable examples include modular retro builds like the 2024 Minimalist Europe Card Bus (MECB) CPU card, which integrates the W65C02S in a PLCC package for expandable 8-bit systems supporting graphics and storage. The Olimex NEO6502 board combines a 6.25 MHz W65C02 with 64 KB RAM for core processing alongside a Raspberry Pi RP2040 microcontroller for HDMI output and USB connectivity, facilitating education, retro gaming emulators, and open-source firmware development. In the Commander X16 platform, the 65C02 drives an 8 MHz system enhanced by the VERA FPGA video adapter, providing 256-color VGA and up to 2 MB RAM for modern retro computing applications as of 2025. The W65C02's advantages in these domains include its affordability, with individual chips available for approximately $9 as of 2025, making it ideal for hobbyists and low-volume prototypes. Ongoing production by Western Design Center ensures availability for legacy system maintenance across industrial and medical sectors. Emerging trends involve hybrid architectures integrating the W65C02 with ARM-based processors, as seen in the NEO6502's dual-MCU setup for bridging 8-bit legacy code with contemporary interfaces like USB and HDMI. This approach supports transitional embedded designs, while WDC's ASIC and FPGA IP cores extend the processor's lifespan into high-volume, customized applications.References
- https://atariwiki.org/wiki/Wiki.jsp?page=6502%20bugs
