cbmeeks wrote:
This has been one of the reasons why I have delayed starting my 65c02 homebrew. I've always 'dreaded' the part where I have to mess with serial connections to/from my 65c02 and my Mac. I know it's probably easy for most of you.
Anyway, assuming I get started and connect the 65c02 to my Propeller (for ROM) and SRAM, I'm going to need to communicate with it.
My "L-Star" project is based on a Propeller bitbanging the 65C02. See
https://hackaday.io/project/3620 and
https://github.com/jacgoudsmit/l-star. It's based on a previous project called Propeddle that used more glue logic so the Propeller also had control over interrupts and whatnot. Propeddle is more advanced but L-Star is easier to understand. Feel free to use whatever you want from my Github repo (MIT license).
I found that a very easy way to let the 65C02 communicate with the outside world is to emulate the PIA of the Apple-1. Basically it takes up 4 addresses in 6502 address space, and the 6502 reads and writes data in a parallel way by storing a byte into, or reading a byte from a reserved address. The high bit of those bytes is used for flow control so only 7 bits of each byte are usable to transfer data, but 7 bits of data is enough for an ASCII terminal (*). The Propeller takes care of catching and providing the bytes in another cog, and converting them to/from the standard serial port that you also need for programming the Propeller. L-star also lets you use a (1-pin) video output and a PS/2 keyboard.
Quote:
I thought I would start with a small ROM that just blinked an LED to confirm the computer is working.
My first program when I started dabbling with Propellers bitbanging 6502's was to run a (text) video cog and sharing the video buffer with the 6502. I just hand-assembled a ROM that would increment a memory location in the video buffer, and looped forever. The result can be seen at
https://www.youtube.com/watch?v=WBdACu4OK-s.
Quote:
Then, I need to upload some type of BASIC or "OS" so that it understands the serial requests right?
With an Apple-1 PIA emulator at address $D010, you can map the Woz monitor at $FF00 and some ram at $0000 and start playing. L-star's Apple-1 emulator maps an 8K ROM with Woz mon, Ken Wessen's Krusader and Apple Integer Basic into the top of 6502 address space, and there's enough memory left over to emulate about 16K of RAM. I played Star Trek (the BASIC program) on it
I also made a setup that emulates the Ohio Scientific / OSI Superboard II (also known as the OSI Challenger C1P, also known as the UK101), but I still have to finish the ACIA emulator.
Quote:
So, what OS should I use?
It should be clear to you by now that it's very easy with current-day resources to bring up a simple 6502 system that has nothing other than a microcontroller to talk to the world. Basically most things you want to do have already been invented and can be easily obtained. Parts are cheap (you can even get a 512KB SRAM chip for a few dollars) and ROMs of old 6502 machines have been dumped and can be easily found on the Internet. A lot of Parallax enthusiasts have shared code such as serial port drivers and video drivers; all you need to do is write the "glue" firmware to let the 6502 access them. And if you run out of cogs, or memory, or pins, just add another Propeller!
I'm thinking in the future I would like to implement a hobby "bring-up system" that runs on the Propeller and lets you type 6502 assembly code which is then stored in a memory area that the 6502 thinks is ROM. This would possibly be a great way for beginners to get to know the 6502 and educate themselves on machine language, without spending a lot of money and time on EPROM burners and erasers and stuff like that.
I would also like to do something like a semi-graphic interface to emulate the KIM-1 or Elektor Junior 7-segment displays and keyboard on a video screen.
===Jac
(*) There are many ways to transfer digital information from the Propeller to the 6502. The most obvious one would be what I would call "simulated direct memory access": just let the Propeller load the binary data into a hub memory area somehow (maybe by emulating a floppy disk with the EEPROM or by transferring data via the serial port) and let the 6502 access it as part of its address area. It's up to you and you have total freedom of inventing "protocols" to transfer data between 6502 and Propeller.