Single-Stepping The 6502 Processor

Although marketing folk and laypeople may credit [Steve Jobs] as the man behind the success of Apple, those in the tech world know the real truth that without [Steve Wozniak] nothing would have ever gotten off the ground during the early days of the computer company. As an exhibit of his deep knowledge of the machines he was building, take a look at this recreation of a circuit by [Anders] which allows the 6502 processor to step through instructions one at a time, originally designed by [Woz] himself, even though there are still myths floating around the Internet that this type of circuit can’t work.

Like a lot of Internet myths, though, there’s a kernel of truth at the middle. The original 6502 from the mid-70s had dynamic registers, meaning they would lose their values if the chip was run below a critical clock speed. Since single-stepping the processor is much lower than this speed, it seems logical that this might corrupt the data in the registers. But if the clock is maintained to the registers the processor can be halted after each instruction, allowing even the original 6502 to go through its instructions one at a time.

[Anders]’s project sets up this circuit originally laid out by [Steve Wozniak] but updates it a bit for the modern times. Since the technology of the era would have been TTL, modern CMOS logic requires pull-up resistors to keep any inputs from floating. The key design of the original circuit is a set of flip-flops which latch the information on the data bus, and a switch that can be pressed to let the processor grab its next instruction, as well as a set of LEDs that allow the user to see the value on the data bus directly.

Of course, a computer processor of this era would be at a major handicap without a way to debug code that it was running, so there are even dedicated pins that allow this functionality to occur. Perhaps the Internet myth is a bit overblown for that reason alone, but [Anders] is no stranger to the 6502 and has developed many other projects that demonstrate his mastery of the platform.

Continue reading “Single-Stepping The 6502 Processor”

6502 Hacking Hack Chat

Join us on Wednesday, April 3rd at noon Pacific for the 6502 Hacking Hack Chat with Anders Nielsen!

Back in the early days of the personal computing revolution, you could have any chip you wanted…as long as it was 8-bits. We’ve come a long way since then, and while nobody seriously hopes for a wholesale return to the time when a Commodore 64 or Apple II was the home computing power play, there’s still a lot to be said for the seat-of-the-pants feeling of the day. Our engineering forebears had their work cut out for them, and building the home PC revolution from the ground up with microprocessors that by today’s standards were laughably limited is something worth celebrating.

join-hack-chatEvery retrocomputing enthusiast has their own favorite chip, and for Anders, it’s obviously the 6502 — enough to give birth to his 65uino project, which put the storied microprocessor at the heart of an Arduino pin-compatible microcontroller. It’s a neat project that seems to have caught a lot of people’s imaginations and opened up a world of hardware and software hacks that modern hardware just doesn’t need.

Getting closer to the silicon is the goal of retrocomputing, and Anders is making it easy to get involved. And we’re lucky enough to have him stop by the Hack Chat to talk all about teaching the 6502 some 21st-century tricks. Stop by and join in the discussion, and maybe you’ll catch the 8-bit bug too.

Our Hack Chats are live community events in the Hackaday.io Hack Chat group messaging. This week we’ll be sitting down on Wednesday, April 3 at 12:00 PM Pacific time. If time zones have you tied up, we have a handy time zone converter.

When Is A 6502 Not Quite A 6502?

We all know that fake chips are a risk when it comes to buying parts on eBay or from Chinese markets such as AliExpress. It’s a simple enough scam, take a cheap chip and mark it as an expensive one, pocket the difference. It’s happened in several different forms, with everything from completely different devices through cheaper equivalents to incredibly, chips purpose fabricated to emulate better-known ones. We have a chance to see such a scam in action via [LinuxJedi], with a 6502 that wasn’t quite as it seemed.

The chip in question was a Rockwell 65C02 destined for an Acorn Atom, and when installed it failed to deliver the expected power consumption saving. Unsurprisingly when tested it turned out to be a fake, in this case a run-of-the-mill 6502 with new markings. The interesting part for Hackaday readers comes in the physical clues. The too-bright markings started to dissolve with a bit of acetone. A deeper investigation revealed the date and wafer codes did not agree with the branding. A new chip was secured which also turned out to be a fake, though in this case a real 65C02 rated for a lower clock speed than marked.

It’s evident that in-demand retro chips are likely to be an ever-greater minefield of fakes as time passes, and the number of survivors dwindles. It’s as well to be aware then and learn from any fakes like these posted online. It’s not the first fake chip we’ve brought you.

A Mysterious 6502 Apple 2 Simulator

Nice, visual simulators of CPUs such as the 6502 are usually made much later and with more modern tooling than what they simulate. But what if that wasn’t the case? What if a simulator runs on the very hardware it’s simulating?

This is what [Tea Leaves] stumbled upon when he found a mysterious disk with only “APL6502.SIM” on it. [Tea Leaves] demonstrates the simulator with a basic 6502 assembly program, revealing an animated, beautiful Apple 2 simulator that actually runs on the Apple 2! The simulator shows all the major components of a 6502 and actually animates the complete data flow of an instruction.

But why is this mysterious? It’s mysterious because – a “hello” program aside – it’s the only thing on the disk! Not so much as a single clue as to where it came from. [Tea Leaves] finds out where it comes from, including incorrectly copied disk images and a revelation at the end.

Video after the break.
Continue reading “A Mysterious 6502 Apple 2 Simulator”

Driving An OLED Screen With A 6502 Single-Board Computer

Twenty years ago, if you wanted an LCD for a project, you’d probably end up with something salvaged from a mobile phone or an HD44780 character display. These days, little OLEDs can be had for a few bucks and they’ve taken the maker world by storm. [Anders Nielsen] has recently been experimenting with driving these displays from the vintage 6502 CPU, and he’s even got scrolling operation down pat.

The best part is that [Nielsen] is doing all this on a single-board computer running his own assembly code. That’s right – there’s no compilers here. It’s bare metal coding at it’s best. The build uses a 6507 chip running at 1 MHz, paired with a 6532 RIOT and just 128 bytes of RAM—a similar setup to the Atari 2600.

The video explains how the code stacks up and drives the display, achieving the scrolling effect. It makes a huge difference to usability, especially compared to chunking pages at a time to the postage stamp-sized screen. He demonstrates a legitimate usage case too, using the setup as a serial terminal for a Raspberry Pi.

The 6502 architecture still looms large in the collective consciousness; we’ve been talking about programming it in assembly for years. Video after the break.

Continue reading “Driving An OLED Screen With A 6502 Single-Board Computer”

Celebrating The 6502 With Song

In a wonderful ode to tech nostalgia, The Taylor and Amy Show, comprised of YouTubers [Taylor] and [Amy], have released a new video “THE 6502 SONG”. This song had me singing along in roughly six clock cycles, possibly a little dancing around may have occurred as well. This isn’t just any chip they’re singing about; it’s the venerable 6502 microprocessor, the silicon heart behind iconic machines like the Apple II, Commodore 64/128, and the Atari 2600.

Their lyrics reminds me of when I lived for assembly language mnemonics and counting clock cycles, the “feeling” of a processor coming out of tristate to pronounce what it had learned in the last 500ns, and the undulations of the DRAMs like speed bumps. To top it off, portions of the song were actually recorded live at the Vintage Computer Festival Midwest 2023, where fans and computing history aficionados alike were treated to an impressive display of vintage tech.

What sets “THE 6502 SONG” apart isn’t just its catchy, melodic tune; it’s the expert blend of historical detail and genuine enthusiasm that resonates with everyone from grizzled assembly-language programmers to youngsters newly fascinated by the allure of 8-bit computing. With guest appearances from other female tech YouTubers like [Veronica Explains] and [Evie’s Revue], [AJ], [Jeri and Amy- Tilt5] and [FuzzyBad].

I believe [Chuck Peddle] father of the 6502, would be proud to see his creation live on and be appreciated so.

Continue reading “Celebrating The 6502 With Song”

The Neo6502 Is A Credit-Card Sized Retro Computer

The venerable MOS Technology 6502 turned up in all kinds of computers and other digital equipment over the years. Typically, it was clocked fairly slow and had limited resources, but that was just how things used to be. Today, the 6502 can run at an altogether quicker pace, and the Neo6502 was the board built to take it there.

The Neo6502 from [Olimex] is a credit-card sized retro computer built around the W65C02. If you’re unfamiliar with that chip, it’s essentially a 6502 that can go fast. How fast? It can be readily overclocked to a blazing 16 MHz, if you’re so inclined!

Unlike some 6502 retro builds, the Neo6502 doesn’t live so firmly in the past. It’s outfitted with an HDMI video interface to make it easy to hook up to modern monitors, so you needn’t fuss around with old displays. Similarly, it has a USB host port to accept input from a keyboard, and audio out via a 3.5 mm jack. There’s also a tiny PCB-mount speaker, as well as I2C, SPI, and UART interfaces. Finally, there’s 2 MB of flash onboard, and a 40-pin connector hosting all the 6502 signals that you know and love. Which is all of them. Much of this lavish equipment comes courtesy of an RP2040 microcontroller onboard that handles all the bits and bobs that aren’t fit for the CPU itself.

It’s still a new project, with things like a BASIC interpreter currently in development and boards not yet openly available.  But, if you’ve always wanted to play with a hotshot 6502, this could be the board for you. Try out the emulator and see how you go.

Continue reading “The Neo6502 Is A Credit-Card Sized Retro Computer”