Hello! Just a quick question: I am planning on using RS-232 ACIAs to send serial data to a 65c02 computer. Any (older) RS-232 chip supports no more than 2 MHz clock speeds per serial pulse and the newest chips only support up to 14MHz. In this instance, should I use a PWM pin to simulate the 1MHz clock required by the RS-232 chip? And what is the best way to ensure the Arduino waits until the PWM pin is done with its clock signal before moving on to the next step/bit?
I think, and I may be very wrong, the ACIA needs a phi2 input (1-2MHz) to actually put a byte into its internal bus from a computer on D0-D7, then it is transferred between ACIAs via the actual baud rate on the serial transmit pin. Not entirely sure about this, though.
A complete "6502 computer" can accept RS232 serial data generated by any typical system, so why do you think you need more than one ACIA chip?
@Johnwasser: The ACIA chip requires the PHI2 clock for data transfers between the chip and a 650x processor. It must be the same PHI2 clock used by the processor.
The current way I have it set up it I have an Arduino sending serialized data to a VIA that the 65c02 reads from. The way I have the VIA setup, I have to rotate the actual serial bit (several times) that comes in and then reconstruct the byte in the 65c02's RAM. I was hoping I could use two ACIAs to accept the serial data and reconstruct the byte and then send the byte itself back to the 65c02 - hardware faster than software, I'm hoping, and I can set the baud rate so I don't have to deal with the Arduino sending bits up to 16x faster than the current speed of my 65c02.
Sounds like a Rube Goldberg type of solution to me. I would use one ACIA as it is intended to be used: a serial interface for the 65C02, and be done with it.
Cool! Yeah, good idea - I always miss the forest for the trees with these types of things. Would I have to slow down the Arduino sending data out, though? I don't know if 16MHz is too fast to send data for that ACIA chip to receive.
The Arduino can send serial data at any standard speed, from 300 to 115200 Baud (serial bits per second), using its built in ACIA (called a UART). The 16 MHz clock is for the Arduino CPU.
What you described before, apparently reading a port pin on your 65C22 VIA, is called "bit banged RS232" and is perfectly acceptable for the tiny amount of data you would be transferring.
Gotcha! Okay, perfect. I guess didn't realize the Serial.begin function is used also for sending data in and out of the Arduino on pin 1 and 2 - I've only ever used it as the serial monitor. Never even occurred to me... That makes perfect sense to me, now!
Okay, cool. I've heard about bit banging, but never read a technical description of what it was exactly. Just wanted to branch out after getting that (mostly) complete and interface with "correct hardware" - an external ACIA attached to the 65c02 data line.
@jremington Good to know. I just looked up the SoftwareSerial library and its associated code - I will definitely go that route, going forward. Thanks for the tips! A huge, huge help!!
@Whandall Not much 6502 experience, at all. I've always wanted to learn Assembly, even in college. Unfortunately my college sucked and we barely did any programming, even as a Comp Sci major. I found Ben Eater on YouTube and started with his videos to make a CPU from scratch. After messing around with that, I moved onto his videos about the 6502 hardware and software. Been making some modifications a la C64 to make it more usable, more RAM, adding in the serial bit banging (for now!), will add in the Ben Eater graphics card here sooner or later and go from there hopefully!
I was bitten by the 65C0x bug while living and working in Munich in the 1980s. The technical magazine MC had a special issue that described the "EMUF", a complete 65C04 computer with just a few chips. I had a lot of fun with that board, and still have both that issue of MC and EMUF, somewhere.
I'm following Ben Eaters videos too, they are very good.
My first exposure to a 6502 was a KIM-1,
at the university, which was brand new at the time.
I still have the parts of the Apple II+ (only lost the case) but they are not assembled,
and probably need some restoration.
This is another channel that I can recommend:
This guy is running a hardware turing machine to emulate a 6502 system running packman.
@jremington That's pretty cool! Yeah, I wish 65xx stuff was a little more prevalent/easier to get access to. Would be nice to just go down the street and pick up parts, rather than having to order stuff online and wait for it to ship, and hope you didn't forget something.
@Whandall Oh wow, that's pretty cool! I was born in the early 90s, so anything that is 65xx - I think the first computer I used was probably Win98. Haha! Thanks for the other YouTube links! Always looking for more resources.