| |
Flavioweb
Registered: Nov 2011 Posts: 463 |
Arduino-based 1541 emulator. Possible?
Talking about Arduino with an hw-hacker father of a friend, i started to thinking about on how to build a full-compatible 1541 clone (6510, cia, ram, etc...) using Arduino hw.
I found this 6502 emulator:
http://www.df.lth.se/~richard/6502emu2.pde
May be possible to build a full sd card reader fully 1541 compatible (for low level drive programming)? |
|
| |
SIDWAVE Account closed
Registered: Apr 2002 Posts: 2238 |
anything is possible, if the Arduino has possibility for interfacing to the C64. (user/serial ports)
i suspect it has not, and you have to solder a usb interface to the c64 no ? |
| |
lft
Registered: Jul 2007 Posts: 369 |
Quoting Flavioweb
I found this 6502 emulator:
http://www.df.lth.se/~richard/6502emu2.pde
This 6502 emulator is not cycle-exact. You would probably have to write a 6502 emulator in assembly language. This could very well be possible on a 20 MHz AVR, but don't forget you also have to emulate four 16-bit latched timers that are updated every microsecond.
SIDwave: Whatever the problem is, it's not the electrical interfacing. |
| |
Fierman
Registered: Feb 2002 Posts: 85 |
interfacing is the least of your problems. timing and speed are, and you can just forget about using an older atmel based arduino for this purpose. it won't do. |
| |
Krill
Registered: Apr 2002 Posts: 2980 |
I also doubt that it's possible at all with 20 MHz.
There will be lots of issues concerning updating all internal state (as lft said) while operating in a very tight serial input-to-output response time frame.
We're talking about less than 20 AVR cycles per 6502 cycle for emulation of not only the 6502 but also a few other chips and glue logic here.
Better go for something faster. |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
<Post edited by chatGPZ on 22/4-2013 21:19>
ppl have tried it with faster (100mhz) embedded systems - with little success. the problem is that the timing must be cycle exact in relation to the "outside world" - which is close to unpossible unless you have virtually "unlimited" resources.
or if you just want to hear that it can be done, easily - ask jim drew on lemon =) |
| |
WVL
Registered: Mar 2002 Posts: 902 |
I've got some experience with AVR's and there's no way you could do an emulation of the 1541 hardware on an Arduino (with AVR chips). You could probably do an IEC emulation and support generic load/save/getbyte commands, but that would be about all. Another problem is the amount of memory that's available : the Nano and Uno only have 2KB of memory, the Mega still only has 32KB... Having no memory means you have to read really fast from SD at the same time when you have to be really precise with your timing to communicate with your 64, impossible.
I even doubt it would be possible with the new Due that has a cortex M3 @ 84MHz, and that one also only has 96KB, still not even close enough to hold a single .d64..
Forget it.
It's not for nothing that the ultimate and chamelon are FPGA based.. |
| |
Krill
Registered: Apr 2002 Posts: 2980 |
Quoting Groepazthe timing must be cycle exact in relation to the "outside world" - which is close to unpossible unless you have virtually "unlimited" resources.
This sounds a bit funny. Care to elaborate? |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
"This sounds a bit funny. Care to elaborate?"
just a failed attempt to say "We're talking about less than 20 AVR cycles per 6502 cycle for emulation of not only the 6502 but also a few other chips and glue logic here. Better go for something faster." :=)
PS: http://www.forum64.de/wbb3/board65-neue-hardware/board284-masse.. |
| |
Skoe Account closed
Registered: Jan 2008 Posts: 34 |
I started to do it with an XMOS at about 400 MIPS shared among 8 Hardware-Threads some years ago (This one: XS1-L6A-64-TQ48). It was a mixture of C Code and Assembly. The I/O-Timing was sub-cycle accurate (+/- 100 ns AFAIR, compared with a logic analyzer to the real thing) and many fast loaders worked already. But only the ones that used the subset of the VIAs I implemented ;)
When I started another refactoring of my code I lost the patience and suspended the project - possibly forever.
What I can say today: I used less than 50% of the processing power and the code wasn't well optimized. So it is quite sure that it is doable on that controller. But I am sure it is not possible on < 100 MIPS with a compatibility of e.g. a 1541U. Today I think the cheapest solution that would be no pain in the ass to implement (compared to the evilness of sub-µs realtime on a controller) with > 99% compatibility could be based on a low-cost ARM controller (e.g. LPC13xx) for high-level tasks and a very small FPGA for CPU/VIAs/Head etc.
But as there is the 1541U/Chameleon for high compatibility and the sd2iec/arm2iec for low cost I'm not interested in another solution anymore. |
| |
Krill
Registered: Apr 2002 Posts: 2980 |
Quoting Groepazif you just want to hear that it can be done, easily - ask jim drew on lemon =)
Trying to ignore that guy, he uses to claim having done all sorts of drive feats but _always_ fails to deliver code or details, taking forever to find lost source codes etc. |
... 28 posts hidden. Click here to view all posts.... |
Previous - 1 | 2 | 3 | 4 - Next |