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.
I thought I would start with a small ROM that just blinked an LED to confirm the computer is working.
Then, I need to upload some type of BASIC or "OS" so that it understands the serial requests right?
So, what OS should I use?
And, on the hardware, are there any examples of adding a serial connection to the computer? I would like to use the serial port of the propeller if I could. And by serial port, I actually mean the USB port that is on my propeller dev board.
Any ideas on how to start this?
Thanks.
Looking for ideas on how to communicate with my 65c02...
Looking for ideas on how to communicate with my 65c02...
Cat; the other white meat.
Re: Looking for ideas on how to communicate with my 65c02...
If the propeller sits on the 6502 bus, and is able to run or stall the 6502, then you should be able to intercept some chosen addresses, such that a read or write to these addresses is handled by the propeller as a read or respectively a write to its serial connection. You can get away without implementing a corresponding status register, but it would help a little to write one of those too: to see if there's an incoming byte to read, and to see if its ready to take the next outgoing byte. Beyond that, you might add interrupts, but you don't need to.
I think EhBASIC and also the early Microsoft Basics need only to be hooked up to a character input and character output routine: then you have a command line prompt and the ability to compute.
I think EhBASIC and also the early Microsoft Basics need only to be hooked up to a character input and character output routine: then you have a command line prompt and the ability to compute.
Re: Looking for ideas on how to communicate with my 65c02...
Quote:
... are there any examples of adding a serial connection to the computer? I would like to use the serial port of the propeller if I could. And by serial port, I actually mean the USB port that is on my propeller dev board.
Good luck on your project.
Cheerful regards, Mike
-
JenniferDigital
- Posts: 92
- Joined: 25 May 2015
Re: Looking for ideas on how to communicate with my 65c02...
I've a fun but slightly silly idea. Why don't you hook up a centronics (parallel port) printer for output then you can pretend it's one of those machines you see in flaky black and white. On the other hand, serial ports really aren't as scary as people think, just keep it minimal. TXD, RXD, CTS, RTS and ground. Set both ends the same and you're off to a good start.
- BigDumbDinosaur
- Posts: 9425
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Re: Looking for ideas on how to communicate with my 65c02...
DigitalDunc wrote:
I've a fun but slightly silly idea. Why don't you hook up a centronics (parallel port) printer for output then you can pretend it's one of those machines you see in flaky black and white. On the other hand, serial ports really aren't as scary as people think, just keep it minimal. TXD, RXD, CTS, RTS and ground. Set both ends the same and you're off to a good start.
My POC unit talks to both the console and my UNIX software development machine via TIA-232, with both ports running at 115.2 Kbps. A TIA-232 plug-in card can be added to any PC that has a PCI, PCI-X or PCI-E slot. The idea of struggling to get a USB interface going to a hobby computer is ridiculous when proven and easily adapted interface technology like TIA-232 and Centronics (parallel) already exists.
x86? We ain't got no x86. We don't NEED no stinking x86!
Re: Looking for ideas on how to communicate with my 65c02...
BigDumbDinosaur wrote:
My POC unit talks to both the console and my UNIX software development machine via TIA-232, with both ports running at 115.2 Kbps. A TIA-232 plug-in card can be added to any PC that has a PCI, PCI-X or PCI-E slot. The idea of struggling to get a USB interface going to a hobby computer is ridiculous when proven and easily adapted interface technology like TIA-232 and Centronics (parallel) already exists.
On my side, I just noticed within the past few minutes that the docking station for my main computer (a laptop) has a Male DB9 port on it... And it actually works, which is the really surprising part.
Re: Looking for ideas on how to communicate with my 65c02...
I have used an FTDI cable to do USB->Serial conversion for 6 or 7 projects including one with a 6502 and another for an EEPROM programmer. It's very easy to get going.
http://www.ftdichip.com/Products/Cables ... Serial.htm
Actually, FTDI sells another chip (FT2232?) that can do USB->SPI. If you are afraid of serial, this would be even simpler than that. Get a 74HC595 or 74HC164 for output and a 74HC165 for input and you can transfer data between the PC and 6502.
http://www.ftdichip.com/Products/Cables/USBMPSSE.htm
http://www.ftdichip.com/Products/Cables ... Serial.htm
Actually, FTDI sells another chip (FT2232?) that can do USB->SPI. If you are afraid of serial, this would be even simpler than that. Get a 74HC595 or 74HC164 for output and a 74HC165 for input and you can transfer data between the PC and 6502.
http://www.ftdichip.com/Products/Cables/USBMPSSE.htm
Re: Looking for ideas on how to communicate with my 65c02...
I use these to talk to my 6502 computer:
FTDI adapter
I especially like the arrows on the PCB showing which lines are driven by the adapter and which sensed, which helps me avoid contention, especially with RS-232. Does TX mean TX from the DTE ( computer / laptop) perspective or from DCE ( modem / peripheral device) perspective? I always have to double check.
And this is how I simulate a UART device on the 6502 bus:
UART_read() and UART_write()
This example is slightly complicated by the fact that the actual UART on my 6502 computer is provided by a second AVR which is accessed via SPI although that is transparent to the 6502.
FTDI adapter
I especially like the arrows on the PCB showing which lines are driven by the adapter and which sensed, which helps me avoid contention, especially with RS-232. Does TX mean TX from the DTE ( computer / laptop) perspective or from DCE ( modem / peripheral device) perspective? I always have to double check.
And this is how I simulate a UART device on the 6502 bus:
UART_read() and UART_write()
This example is slightly complicated by the fact that the actual UART on my 6502 computer is provided by a second AVR which is accessed via SPI although that is transparent to the 6502.
- jac_goudsmit
- Posts: 229
- Joined: 23 Jun 2011
- Location: Rancho Cucamonga, California
- Contact:
Re: Looking for ideas on how to communicate with my 65c02...
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.
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.
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.
Quote:
Then, I need to upload some type of BASIC or "OS" so that it understands the serial requests right?
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?
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.
Re: Looking for ideas on how to communicate with my 65c02...
Hi cbmeeks,
having a 65(C)02 talk to the Mac is easy. I suggest you use a 65(C)51 to start with because then you can use many of the monitor ROMs that have been published e.g. Daryl's http://sbc.rictor.org/sbcos.html. I normally use a modified original Apple (F8) ROM that instead using built-in video and keyboard uses the 65(C)51 as default IO device. To connect to the Mac I bought some of these http://www.mouser.ch/ProductDetail/FTDI ... dam%2fwe00. FTDI provides an official Mac OS X driver. I use SecureCRT to connect over the USB-to-Serial Adapter. Also a CMOS 6502 system draws so little power that I use the same adapter to provide 5V for the system. the USB-to-Serial Adpater has TTL levels and interfaces directly with RXD and TXD of the 65(C)51. It is a good idea to have a pull-up on RXD (1kOhm) near the 65(C)51 to avoid reflections that disturb the serial signal when running the 65C51 with 115kbaud. Just use the following code
instead of
On the Mac I use 64tass as 6502 cross-assembler.
cheers
Peter
having a 65(C)02 talk to the Mac is easy. I suggest you use a 65(C)51 to start with because then you can use many of the monitor ROMs that have been published e.g. Daryl's http://sbc.rictor.org/sbcos.html. I normally use a modified original Apple (F8) ROM that instead using built-in video and keyboard uses the 65(C)51 as default IO device. To connect to the Mac I bought some of these http://www.mouser.ch/ProductDetail/FTDI ... dam%2fwe00. FTDI provides an official Mac OS X driver. I use SecureCRT to connect over the USB-to-Serial Adapter. Also a CMOS 6502 system draws so little power that I use the same adapter to provide 5V for the system. the USB-to-Serial Adpater has TTL levels and interfaces directly with RXD and TXD of the 65(C)51. It is a good idea to have a pull-up on RXD (1kOhm) near the 65(C)51 to avoid reflections that disturb the serial signal when running the 65C51 with 115kbaud. Just use the following code
Code: Select all
ACIA1portset lda #$10 ; 115200baud/8/1
sta ACIA1ctl ; control reg Code: Select all
ACIA1portset lda #$1F ; 19.2K/8/1
sta ACIA1ctl ; control reg
cheers
Peter