sburrow wrote:
drogon wrote:
But I don't see any reason your way shouldn't work if the PIC can sample the ROM select signals (A13:15] and respond fast enough.
I have been going off the assumption that the the PIC will be considerably slower than the 6502 in reaction time. It takes 4 clock cycles to do one instruction, and thus I don't think I can reliably have it load data onto the bus or tri-state in time for things to work smoothly. Unless the 6502 is running in the kHz range during bootloading I suppose.
In the "romless" threads here I did consider a system, but never got round to even posting it let alone testing it - that was to have a switch on the clock, so that one way clock pulses came from the oscillator and the other way it could be "hand-cranked" from the µC. So the µC gets the clock, resets the 6502, then because we know the exact number of clock pulses that the '02 need during reset, vector fetch and so on, we can hand-crank the 6502 and feed it data as required, so after its done the JMP (resetV) we feed it instructions in the order LDA #xx ; STA $yyyy to get it to fill RAM with the boot code then a final JMP to the start and switch the clock over. You need to pay attention to R/W and so on, but that's do-able.
To get the µC to act as a slow VIA - clock-stretching? Or again flipping the clock switch... It all starts to get a bit messy though...
Quote:
drogon wrote:
There is latency in the way I do it though - the ATmega needs time to switch the buses over - tristate/release, etc. PIC might be faster. I do get about 33KB/sec transfer over the interface though which is fast enough.
I don't think the PIC is any faster.
barnacle wrote:
The STM is reasonably nifty when it comes to changing port directions but disappointingly slow at responding to interrupts
Yep, I'm expecting that. I know the PIC isn't inherently designed for 6502 systems, but the possibility of replacing the ROM and VIA in one chip sounds nice. I read through that link you sent, thank you.
Things to think about, thank you!
Chad
Can a CPLD emulate a VIA and an ACIA/UART? I've not really looked at them past the old GALs, although I have been dabbling with an FPGA which would be a billion times more capable but the complexity?
Actually a single chip CPLD solution that did UART, SPI and VIA - although it doesn't really need to do full VIA, just 2 x 8-bit ports with handshaking and separate timers, so separate blocks inside the same chip...
Other things in a similar light to this include the PiTubeDirect project - this connects a Raspberry Pi directly to the bus on a BBC Micro at 2Mhz. a 1GHz Pi can emulate the FIFOs used in the original
Acorn Tube interface but AIUI the code is tight and almost on the limits. (There are architectural issues with very high speed/precise timings on the Pi - nothing really to do with it's CPU clock though).
The other projects are using the RP2040 µC. It's better suited for this - as it's used in the Neo6502 and Pico6502 projects - the RP2040 emulates RAM and I'm not sure what else, but it's probably able to emulate a VIA, ACIA, etc. if someone writes the code.
But is that getting a bit far away from the goal? It's a tricky one to know or judge. In my Ruby project in the ATmega there is about 8000 lines of *.c and *.h files plus the FAT32 library plus my own real-time bare-metal OS/Harness that I run everything under... But what would the equivalent be in (say) VHDL to describe a VIA or ACIA? Or is it not even worth drawing those sorts of parallels ...
... although I do look back at some other "period" systems - the Apple II being the most successful - and it moved from a raft of TTL to VLSI chips, combining more and more functionality into custom ICs from '77 to about '85... Even up to '91 with the whole of an Apple IIe on a single plug-in card for the Macintoshes of that time... And today I get cycle-accurate Apple II and BBC Micro emulators in my web browser... Are we just progressing on from that?
-Gordon
_________________
--
Gordon Henderson.
See my
Ruby 6502 and 65816 SBC projects here:
https://projects.drogon.net/ruby/