Lessons learned from a walkabout in 6502.org

779 views
Skip to first unread message

Bill Shen

unread,
Feb 2, 2021, 2:07:15 PM2/2/21
to retro-comp
I took a detour in the 6502 world in the last couple months and learned a few things that I thought I'd share here:
I built two 6502 SBC during those two months, first one is based on a big CPLD, EPM7192S, that now has evolved into a generic 8-bit processor platform.  The initial design is documented here: https://www.retrobrewcomputers.org/doku.php?id=builderpages:plasmo:protor5:proto65:proto65r01
However, the more interesting features yet to come is a VGA/PS2 interface and a notion of generic platform for standalone 8-bit processors of 1970's and 1980's.  It is something I'll be working on in the months ahead.

The 2nd one is derived from ZRCC concept.  It is documented here: https://www.retrobrewcomputers.org/doku.php?id=builderpages:plasmo:crc65
It is now clear to me an inexpensive CPLD/RAM/CFdisk framework can accommodate most 8-bit processors in a "headless" configuration, i,e.,SBC without video/keyboard and relying on terminal software for communication.  The Z80 version is named ZRCC (Z80_RAM_CPLD_CF); the 6502 version is called CRC65 (CPLD_RAM_CF_6502); CRC85 (8085), CRC09 (6809), are logical follow-on projects.

It is possible to drive a controller-less LCD display, specifically 320x240 UG-32F01, using a microprocessor as the controller.  The microprocessor will be busy 75-90% of the times, but should have enough bandwidth to take in data from the master processor.  This realization breathes new life into Z80LCD, https://www.retrobrewcomputers.org/doku.php?id=builderpages:plasmo:z80lcd

What I've learned from 6502 assembly language is initially it appears to be a primitive processor with bare minimum set of instructions and barely enough CPU registers to do the work.  But after a while I realize it is efficient and actually easy to learn (precisely because it is so simple), and it is shockingly FAST for something so primitive; a 14MHz CMOS 65C02 is about the performance of 30MHz Z80 and like Z80, it can be overclocked recklessly.  I have reliably overclocked 20MHz Z80 to 30MHz, and it turned out 14MHz 65C02 can be reliably overclocked to 22MHz making it the fastest retro processor.

A couple small projects that would be fun to port to the Z80 world:
1.  RTC + 128x64 OLED is a nice analogy-ish clock, see attached picture.
CRC65_with_RTC_analog_clock_F.jpg
2.  65SPI is a full-feature SPI controller in a ATF1504 CPLD that can be simplified and ported to Z80 world
(a long thread here: http://forum.6502.org/viewtopic.php?f=4&t=1265  with my contribution at the end)

Insights into the Altera CPLD I've used extensively over last 3-4 years:
1.  Some JTAG-locked EPM7064S and EPM7128S from eBay can be unlocked by applying 12V to OE pin--not always reliable, but there are some success.
2.  My favorite EPM7064S and 7128S are not orphaned CPLD; the design files can easily translated to Atmel programming format to program ATF1504AS and ATF1508AS.  Atmel CPLD devices and programmer are readily available from Mouser
  Bill


Bill Shen

unread,
Mar 14, 2021, 9:06:54 PM3/14/21
to retro-comp
I'll share a couple interesting VGA video related projects I'm working on in 6502.org.  The first one is using 6502 as a VGA controller

CRC65 SBC is so simple with only few components that the nominal 14MHz 6502 CPU can be reliably overclocked to 25.175MHz which is the pixel clock rate for 60Hz VGA.  6502 instruction execution is fast enough to access a memory every 8 clocks such that memory content is loaded into a 8-bit shift register to drive VGA video.  This way the memory contents can be displayed as 1-bit 640x480 graphic.

Significant modification to CRC65 CPLD is required to add the horizontal sync generation in hardware; that and associated 6502 software are required to bit-bang the vertical sync signal and display graphic memory.  The attached picture shows what it can do.  The 6502 is busily displaying image data during the video portion but has throughput equivalent to 2MHz 6502 to do other tasks during the vertical retrace period.

Homepage for 6502 VGA controller is here:
https://www.retrobrewcomputers.org/doku.php?id=builderpages:plasmo:crc65:vga65

The same concept can be extended to color 640x480 display, but it requires more memory and bigger CPLD.
  Bill

DSC_65040313.jpg

Bill Shen

unread,
Mar 14, 2021, 9:35:28 PM3/14/21
to retro-comp
Second project is based on the realization that VGA graphic generation is so simple, it can be done with a modest CPLD like EPM7064S or ATF1504AS.  To take that idea one more step is the observation that VGA video signals are same as signals driving system RAM and it is completely unobtrusive to system operation.  Another way of saying it is video memory is write-only memory which occurs in parallel to regular memory write accesses and whatever is written to the system memory is displayed in some form unknown to the system memory.  A video daughter board with CPLD and dual port RAM can be constructed that plugs into the existing system RAM socket; the original RAM is moved up to the daughterboard and RAM signals used to drive CPLD and a dual port RAM to generate text-based VGA output.  In fact, it does not need to be text-based VGA; how the content of memory is displayed is defined by the programmable font tables so the content of a region of memory monitored by the video subsystem can be display in other meaningful way in real time.

The prototype hardware shows the few components (CPLD, dual-port RAM, 25.175MHz clock, HD15 connector) needed to display 3K region of memory.
  Bill




DSC_64730222.jpg
VGA6448_banner.jpg

Bill Shen

unread,
Oct 21, 2021, 9:48:01 AM10/21/21
to retro-comp
My winter project 2021/2022 is making various retro computers stand alone, i.e. with its own monitor, keyboard and sufficient number of communication channels to outside world.  This is the first attempt which is 14.7MHz 6502 (background) with VGA/keyboard (middle) and quad serial channel (foreground) on a 5-slot RC2014 backplane.  Hardware seems to be working, but I've got lots of software work to do.
  Bill
DSC_66401021.jpg

Mark T

unread,
Oct 21, 2021, 12:14:22 PM10/21/21
to retro-comp

I’ve been following your progress on 6502.org, although not a big fan of the 6502 there are quite a few interesting details in some of the projects. The related anycpu.org also has some interesting projects though not so much activity.
Message has been deleted

Mark T

unread,
Oct 22, 2021, 10:51:20 AM10/22/21
to retro-comp

Looks really professional finish, did you modify cpm to run on 6502 or you just posted this in the wrong thread. It would probably be better to start a new thread and give a little info on the inside of the box.
On Friday, October 22, 2021 at 10:18:07 AM UTC-4 Pellatonian wrote:
This was my attempt at a stand-alone CP/M system last winter. I seemed to remember an Olivetti desktop system in the early 1980's which gave me the idea. Made with various of-the-shelf components, many from China, including a 14" VGA monitor. Has Serial and WiFi options. The odd colour washout seems to be an artifact from my telephone's camera.

IMG_0013.jpg

Pellatonian

unread,
Oct 23, 2021, 10:19:23 AM10/23/21
to retro-comp
yes, I was more interested in the concept of a stand-alone system than the processor/OS involved. Duly deleted.

Alan Cox

unread,
Oct 23, 2021, 10:33:33 AM10/23/21
to retro-comp
On Sat, 23 Oct 2021 at 15:19, Pellatonian <pella...@gmail.com> wrote:
yes, I was more interested in the concept of a stand-alone system than the processor/OS involved. Duly deleted.

There is actually a CP/M shareware clone for 6502 called DOS/65. It's a little bit clunky in how it addresses the differing memory maps but it's a pretty complete clone, although rather short of apps.


(confusingly there are several other 'DOS65' operating systems from various hardware vendors of the retro period)

Alan

Mark T

unread,
Oct 23, 2021, 3:26:38 PM10/23/21
to retro-comp

I think it would be good to start a separate thread, and maybe show the inside so we can see how you did it. Like I said earlier its a very professional finish, as good as a lot of the professional systems back in the eighties and better than some.

Greg Holdren

unread,
Oct 24, 2021, 12:41:55 AM10/24/21
to retro-comp
On Saturday, October 23, 2021 at 7:33:33 AM UTC-7 Alan Cox wrote:

There is actually a CP/M shareware clone for 6502 called DOS/65. It's a little bit clunky in how it addresses the differing memory maps but it's a pretty complete clone, although rather short of apps.


(confusingly there are several other 'DOS65' operating systems from various hardware vendors of the retro period)

Alan
 
Here is a 6502.org message about a newer version 3.xx of DOS/65 in a rather old thread (2017) posted by the OS author Rich Leary. The thread had a revival this last spring with Floobydust mentioning that he obtaining the source for 3.xx from Rich and making it ROM bootable on his C02 Pocket SBC. One of the goals for version 3 is to make it ROM bootable. For those interested in the latest code.


Greg

Bill Shen

unread,
Jan 5, 2022, 11:58:39 AM1/5/22
to retro-comp
Curious to see if google forum accept animated GIF.
Hmmm, it does, now see how it plays.

BTW, this is my latest effort in VGA graphic, http://forum.6502.org/viewtopic.php?f=4&t=6955.

Still hang out at 6502.org working on Apple II and 6502 related projects.
VGA512x480_test_pattern.gif

Bill Shen

unread,
Oct 27, 2022, 9:54:43 PM10/27/22
to retro-comp
I've had some success porting version 2 of DOS/65 to CRC65 SBC.  DOS/65 is very similar to CP/M so the porting process is very similar to a CP/M port.  I even make the disk format same as my CP/M implementation so DOS/65 can read and write the CP/M disk.  This is particularly useful for moving DOS/65 distribution files to a compact flash disk before I got DOS/65 version of XMODEM working.

I'm now  satisfied with version 2 so I'm ready to move on to porting version 3 of DOS/65.  I'm happy to read in the DOS/65 v3 documentation that DOS/65 v3 is now freeware so anyone can modify and redistribute it.  

Before moving to version 3, I like to show this 6-minute YouTube video of creating a version 2 DOS/65 disk from scratch on a 29.5MHz CRC65 SBC.  https://www.youtube.com/watch?v=YtoE_I_Dx5o

The console is set to 230400, CRC65 is set to serial bootstrap mode and a formatted blank CF disk installed before the video.  Video starts with execution of a TeraTerm macro file, newDOS65CF.ttl.  W65C02 is overclocked to 29.5MHz which is about 3 times the performance of 20MHz Z80 so thing are moving rather fast.  Here are highlights and explanation of what happened for a few key points in time:

The fast moving part is in the first 11 seconds when serial bootstrap is first loaded which then loads and executes the CRC65 monitor.  The monitor then load the DOS/65 binary and a helper program to save save DOS65 in CF disk's system track and autoboot program in CF's master boot record.
At 0:11 DOS/65 and monitor software are done loading, the CF disk is now auto-bootable into DOS/65.
-----------------------
XMODEM, assembler, and mkcom hex files are loaded into memory and saved as executable .com files in drive A of DOS/65.
At 0:26 shows the directory of drive A with XM.COM, ASM.COM, and MKCOM.COM installed.
-----------------------
XMODEM is used to load system utility programs into drive D.  The utility programs are alloc208.asm, compl205.asm, compr204.asm, copy203.asm, cputype.asm, debug204.asm, dump100.asm, edit205.asm, more202.asm, and run207.asm.  Several BASIC sources are also loaded.  
At 2:39 shows all files are loaded into drive D
-----------------------
The assembler, ASM.COM, is used to assemble the utility programs followed by MKCOM.COM converting assembler outputs to executable .COM files.
At 5:05 shows all utility programs have been assembled and converted into executable.
-----------------------
COMPILE.COM is used to compile the BASIC sources followed by RUN.COM to execute the compiled BASIC code.
At 5:25 BASIC program FLST215S displays the file status of drive A and drive D.
At 5:33 BASIC program SYST212S display system status
At 5:53 Mandelbrot benchmark result displayed.
  Bill

Bill Shen

unread,
Dec 18, 2022, 12:35:40 PM12/18/22
to retro-comp
I may have created the fastest 6502 computer based on production W65C02 CPU.  Here is the discussion about it.

I was successful getting W65C02 to run at 36MHz on a hand-wired prototype.  The prototype is a rather ugly duckling; here is a picture of it.  More pictures can be found here.  At the end of the page is an animated GIF of the 36MHz 6502 booted into DOS/65 (a CP/M clone for 6502) and ran ASCIIART benchmark in about 10 seconds.  The same benchmark will take 155 seconds to run on a 7.37MHz Z80.
  Bill


DSC_71501215.jpg
Reply all
Reply to author
Forward
0 new messages